Skip to content

Commit 05e5612

Browse files
wcgunterJames Wood
andauthored
Spring 5.3 & Java 17 (#196)
* Update to spring 5.3 * Update to Java 17 * Update to Java 17 - update jacoco script * Update to Java 17 - update github testing scripts * Update to Java 17 - update README * update maven war * Update Maven Surefire to support java 17 * Update Java version in advanced-test CI/CD workflow to 17 * Update jacoco to 0.8.3 for compatability with surefire * Update references to jacoco with 0.8.3 version * Update jacoco to 0.8.7 * Add graalvm javascript engine * Test * Graalvm * Revert, update jacoco * Revert jacocom surefire * Jacoco * Re-add graalvm js * Change to openjdk/nashorn * Update pom.xml * Update pom.xml * Update pom.xml * Update pom.xml * Update pom.xml * Change maximum executorServiceMaxPoolSize * Fix logic in WorkerService * Updated README.md for Java 17 * Fixed some Java version messages --------- Co-authored-by: James Wood <[email protected]>
1 parent 2ecc894 commit 05e5612

File tree

12 files changed

+80
-35
lines changed

12 files changed

+80
-35
lines changed

.github/workflows/camunda.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
steps:
3434
- uses: actions/checkout@v3
3535

36-
- name: Set up JDK 11
36+
- name: Set up JDK 17
3737
uses: actions/setup-java@v3
3838
with:
39-
java-version: '11'
39+
java-version: '17'
4040
distribution: 'temurin'
4141
cache: maven
4242

@@ -163,10 +163,10 @@ jobs:
163163
steps:
164164
- uses: actions/checkout@v3
165165

166-
- name: Set up JDK 11
166+
- name: Set up JDK 17
167167
uses: actions/setup-java@v3
168168
with:
169-
java-version: '11'
169+
java-version: '17'
170170
distribution: 'temurin'
171171
cache: maven
172172

.github/workflows/ldap.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
steps:
3434
- uses: actions/checkout@v3
3535

36-
- name: Set up JDK 11
36+
- name: Set up JDK 17
3737
uses: actions/setup-java@v3
3838
with:
39-
java-version: '11'
39+
java-version: '17'
4040
distribution: 'temurin'
4141
cache: maven
4242

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ See the [wiki](https://github.com/NASA-AMMOS/common-workflow-service/wiki) for m
1717

1818
## Prerequisites
1919

20+
- [**Java 17 JDK**](https://formulae.brew.sh/formula/openjdk@17): CWS only runs on JDK 17. (NOTE: Cannot use JRE)
21+
- For Homebrew users:
22+
- Install OpenJDK 17 using: `brew install openjdk@17`
23+
- Check the exact version installed using `/usr/libexec/java_home -V`
24+
- Add to your Shell startup (e.g. .zprofile): `export JAVA_HOME=$(/usr/libexec/java_home -v X.X.X)`
25+
- Replace the X.X.X version above with the OpenJDK 17 output from the `/usr/libexec/java_home -V` command.
2026
- [**Maven**](https://maven.apache.org/download.cgi): Used to dynamically download libraries and other required project dependencies.
2127
- For Home-brew users:
2228
- Install Maven using: `brew install maven`
@@ -39,15 +45,9 @@ See the [wiki](https://github.com/NASA-AMMOS/common-workflow-service/wiki) for m
3945
- You will need to add your own truststore file to this path: `install/tomcat_lib/cws_truststore.jks`
4046
- See: https://tomcat.apache.org/tomcat-9.0-doc/ssl-howto.html
4147
- **Store Your Keystore Password**: You will need to add your own creds file, which carries the keystore password, to this path: `~/.cws/creds`
42-
- Set the permissions for the **~/.cws/** directory and **creds** file as Owner-Only.
43-
- **~/.cws/** directory: `chmod 700 ~/.cws/`
44-
- **~/.cws/creds** file: `chmod 600 ~/.cws/creds`
45-
- **Java 11 JDK**: CWS only runs on JDK 11 now, but planning for JDK 17 soon.
46-
- For Homebrew users:
47-
- Install OpenJDK 11 using: `brew install openjdk@11`
48-
- Check the exact version installed using `/usr/libexec/java_home -V`
49-
- Add to your Shell startup (e.g. .zprofile): `export JAVA_HOME=$(/usr/libexec/java_home -v X.X.X)`
50-
- Replace the X.X.X version above with the OpenJDK 11 output from the `/usr/libexec/java_home -V` command.
48+
- Set the permissions for the **~/.cws/** directory and **creds** file as Owner-Only.
49+
- **~/.cws/** directory: `chmod 700 ~/.cws/`
50+
- **~/.cws/creds** file: `chmod 600 ~/.cws/creds`
5151

5252

5353
### **Development Environment Configuration**

cws-engine-service/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,19 @@
123123
<artifactId>junit</artifactId>
124124
</dependency>
125125

126+
<dependency>
127+
<groupId>org.graalvm.js</groupId>
128+
<artifactId>js</artifactId>
129+
<version>23.0.2</version>
130+
<scope>runtime</scope>
131+
</dependency>
132+
<dependency>
133+
<groupId>org.graalvm.js</groupId>
134+
<artifactId>js-scriptengine</artifactId>
135+
<version>23.0.2</version>
136+
<scope>runtime</scope>
137+
</dependency>
138+
126139
<!-- IS THIS NEEDED?? -->
127140
<dependency>
128141
<groupId>org.apache.tomcat</groupId>

cws-engine-service/src/main/java/jpl/cws/engine/WorkerService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,8 @@ public boolean syncCounters(String reason) {
902902
public void setJobExecutorMaxPoolSize(Integer executorServiceMaxPoolSize, boolean doDbUpdate) {
903903
if (executorServiceMaxPoolSize != null) {
904904
try {
905-
905+
// we are getting errors if we go beyond 10?
906+
executorServiceMaxPoolSize = Math.min(10, executorServiceMaxPoolSize);
906907
// Log information about JMX remote interface
907908
if (System.getProperty("com.sun.management.jmxremote") == null) {
908909
log.warn("JMX remote appears to be disabled");

cws-engine/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@
2424
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
2525
<artifactId>cws-adaptation-engine</artifactId>
2626
</dependency>
27+
<dependency>
28+
<groupId>org.graalvm.js</groupId>
29+
<artifactId>js</artifactId>
30+
<version>23.0.2</version>
31+
<scope>runtime</scope>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.graalvm.js</groupId>
35+
<artifactId>js-scriptengine</artifactId>
36+
<version>23.0.2</version>
37+
<scope>runtime</scope>
38+
</dependency>
2739
</dependencies>
2840
</profile>
2941
</profiles>

cws-service/src/main/java/jpl/cws/scheduler/Scheduler.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
import static jpl.cws.core.db.SchedulerDbService.FAILED_TO_SCHEDULE;
44
import static jpl.cws.core.db.SchedulerDbService.PENDING;
55

6-
import java.io.ByteArrayOutputStream;
7-
import java.io.IOException;
8-
import java.io.UnsupportedEncodingException;
6+
import java.io.*;
97
import java.net.URLDecoder;
108
import java.sql.Timestamp;
119
import java.util.HashMap;
@@ -129,8 +127,8 @@ public SchedulerJob scheduleProcess(String procDefKey,
129127
String procBusinessKey, String initiationKey,
130128
int priority) throws Exception {
131129

132-
log.trace("Scheduling process definition '" + procDefKey + "' ...");
133-
log.trace(" with variables=" + processVariables);
130+
log.info("Scheduling process definition '" + procDefKey + "' ...");
131+
log.info(" with variables=" + processVariables);
134132

135133
String schedulerJobUuid = null;
136134
boolean rowCreated = false;

cws-test/src/test/resources/configure_with_jacoco.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ else
4848
exit 1
4949
fi
5050

51-
if [[ "$java_version" > "11" && "$java_version" < "12" ]]; then
52-
echo " Java version == 11x [OK]"
51+
if [[ "$java_version" > "17" && "$java_version" < "18" ]]; then
52+
echo " Java version == 17x [OK]"
5353
else
5454
echo " +-------+----------------------------------------------------"
5555
echo " | ERROR | "
5656
echo " +-------+ "
57-
echo " | Java version is less than 11. Must run with Java 11x "
57+
echo " | Java version is not 17. Must run with Java 17x "
5858
echo " | Aborting program... "
5959
echo "--------------------------------------------------------------"
6060
exit 1
@@ -264,7 +264,7 @@ rm -f ${ROOT}/config/my.cnf
264264
sleep 1
265265

266266
if [ "$RECONFIGURE" = true ]; then
267-
${JAVA_HOME}/bin/java -classpath "./installer/*" -javaagent:./server/apache-tomcat-${TOMCAT_VER}/lib/org.jacoco.agent-0.8.2-runtime.jar=destfile=./installer-jacoco.exec,append=false jpl.cws.task.CwsInstaller --reconfigure
267+
${JAVA_HOME}/bin/java -classpath "./installer/*" -javaagent:./server/apache-tomcat-${TOMCAT_VER}/lib/org.jacoco.agent-0.8.7-runtime.jar=destfile=./installer-jacoco.exec,append=false jpl.cws.task.CwsInstaller --reconfigure
268268
else
269-
${JAVA_HOME}/bin/java -classpath "./installer/*" -javaagent:./server/apache-tomcat-${TOMCAT_VER}/lib/org.jacoco.agent-0.8.2-runtime.jar=destfile=./installer-jacoco.exec,append=false jpl.cws.task.CwsInstaller
269+
${JAVA_HOME}/bin/java -classpath "./installer/*" -javaagent:./server/apache-tomcat-${TOMCAT_VER}/lib/org.jacoco.agent-0.8.7-runtime.jar=destfile=./installer-jacoco.exec,append=false jpl.cws.task.CwsInstaller
270270
fi

cws-ui/src/main/webapp/WEB-INF/springmvc-servlet.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
<context:property-placeholder location="classpath:cws-ui.properties"/>
1717

18-
<mvc:annotation-driven />
18+
<mvc:annotation-driven>
19+
<mvc:path-matching suffix-pattern="true" />
20+
</mvc:annotation-driven>
1921

2022
<!-- <bean id="viewResolver"
2123
class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
102 Bytes
Binary file not shown.

pom.xml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
<gson.version>2.8.9</gson.version>
4848
<h2.version>2.2.220</h2.version>
4949
<!-- <httpclient.version>4.3</httpclient.version> -->
50-
<jacoco.version>0.8.2</jacoco.version>
51-
<java.version>11</java.version>
50+
<jacoco.version>0.8.7</jacoco.version>
51+
<java.version>17</java.version>
5252
<javax.mail.version>1.4.7</javax.mail.version>
5353
<jersey-client.version>2.6</jersey-client.version>
5454
<jms.version>1.1</jms.version>
@@ -77,11 +77,11 @@
7777
<log4j.version>2.17.1</log4j.version>
7878
<slf4j-log4j2-bind.version>2.17.1</slf4j-log4j2-bind.version>
7979
<skip.integration.tests>false</skip.integration.tests>
80-
<spring.framework.version>5.2.20.RELEASE</spring.framework.version>
80+
<spring.framework.version>5.3.31</spring.framework.version>
8181
<surefire.version>2.22.2</surefire.version>
8282
<tomcat-catalina.version>9.0.75</tomcat-catalina.version>
8383
<urlrewritefilter.version>4.0.3</urlrewritefilter.version>
84-
<xbean-spring.version>3.17</xbean-spring.version>
84+
<xbean-spring.version>4.24</xbean-spring.version>
8585
<xmlunit.version>2.6.2</xmlunit.version>
8686
</properties>
8787

@@ -109,7 +109,7 @@
109109
<repositories>
110110
<repository>
111111
<id>maven2</id>
112-
<url>http://repo1.maven.org/maven2</url>
112+
<url>https://repo1.maven.org/maven2</url>
113113
</repository>
114114
<repository>
115115
<id>repository.jboss.org-public</id>
@@ -192,6 +192,19 @@
192192
<type>pom</type>
193193
</dependency>
194194

195+
<dependency>
196+
<groupId>org.graalvm.js</groupId>
197+
<artifactId>js</artifactId>
198+
<version>23.0.2</version>
199+
<scope>runtime</scope>
200+
</dependency>
201+
<dependency>
202+
<groupId>org.graalvm.js</groupId>
203+
<artifactId>js-scriptengine</artifactId>
204+
<version>23.0.2</version>
205+
<scope>runtime</scope>
206+
</dependency>
207+
195208
<dependency>
196209
<groupId>org.camunda.bpm</groupId>
197210
<artifactId>camunda-engine</artifactId>
@@ -658,7 +671,13 @@
658671
</execution>
659672
</executions>
660673
</plugin>
674+
<plugin>
675+
<groupId>org.apache.maven.plugins</groupId>
676+
<artifactId>maven-war-plugin</artifactId>
677+
<version>3.3.1</version>
678+
</plugin>
661679
</plugins>
680+
662681
</build>
663682

664683
</project>

utils.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ function check_java_requirements () {
152152
exit 1
153153
fi
154154

155-
if [[ "${JAVA_PATH_VERSION}" > "11" && "${JAVA_PATH_VERSION}" < "12" ]]; then
156-
print " Java version == 11x [OK]"
155+
if [[ "${JAVA_PATH_VERSION}" > "17" && "${JAVA_PATH_VERSION}" < "18" ]]; then
156+
print " Java version == 17x [OK]"
157157
else
158-
print " ERROR: Java version is ${JAVA_PATH_VERSION}. CWS only supports Java version 11x."
158+
print " ERROR: Java version is ${JAVA_PATH_VERSION}. CWS only supports Java version 17x."
159159
exit 1
160160
fi
161161

0 commit comments

Comments
 (0)