Skip to content

Conversation

@shroffk
Copy link
Member

@shroffk shroffk commented Jan 26, 2024

I am getting javadoc warnings which break the build ( when building with docs.. which I think the CI is not doing )

should we just ignore them or fix them... they are all in the save and restore service

@shroffk shroffk changed the title Fix the dependencies with vulnerabilities JDK17 and fixing the dependencies with vulnerabilities Jan 29, 2024
@shroffk
Copy link
Member Author

shroffk commented Jan 29, 2024

@georgweiss I added some changes to ignore javadoc warnings only from the save and restore service.
Initially, I tried to fix most of them but I think the warnings were a bit excessive... we can address them over time

@georgweiss
Copy link
Collaborator

@shroffk, I'll try to find time to fix them a.s.a.p.

@shroffk
Copy link
Member Author

shroffk commented Jan 29, 2024

@shroffk, I'll try to find time to fix them a.s.a.p.

I don't think this is that urgent.. no stress :)
I just wanted to make a note to explain why I disabled the javadoc check for the save-restore service

Plus, we might have to redo some of the doc when we implement the restore on the service anyway... this could be done as part of that project/effort

Copy link
Collaborator

@georgweiss georgweiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not update to JavaFX 21 while we're at it?

@shroffk
Copy link
Member Author

shroffk commented Jan 29, 2024

yes, :)

I am just trying to make changes step by step to solve issues as they come along... but yes javaFX21 should be part of this change

Copy link
Collaborator

@georgweiss georgweiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: thumbnail and linear meter modules specify 11 for maven compiler plugin. I think the properties in those pom files should simply be removed.

@shroffk
Copy link
Member Author

shroffk commented Jan 29, 2024

right now I am confused why the test for save-restore-module are not using JDK17

@kasemir
Copy link
Collaborator

kasemir commented Jan 29, 2024

yes javaFX21 should be part of this change

JFX21 removes GTK2. JFX20 still allows GTK2 or 3. In the discussion for #2638 that was seen as a possible reason to move only up to JFX20 for a while.

@shroffk
Copy link
Member Author

shroffk commented Jan 29, 2024

It seemed like the main issues with GTK3 were not reproduceable. At least the rendering issues mentioned by ESS were resolved... I have not yet tested the crashing issues (associated with efxclipse and gtk3) I experienced.

At the very least we can move to jfx 20... but it at some point we will have to bite the bullet and make the move

@shroffk
Copy link
Member Author

shroffk commented Jan 29, 2024

I do not intend to merge this branch immediately... I am trying to have the jdk17 + javafx20/21 branch ready for people to test.
Once people have given the green light we will merge

@kasemir
Copy link
Collaborator

kasemir commented Jan 29, 2024

OK, let's try JFX21 then. Since it's really just one number a a top level file, a site that experiences issues can locally build w/ JFX20 to check if that helps.

@shroffk
Copy link
Member Author

shroffk commented Jan 29, 2024

There is still the open question about jumping to JDK21 also...not sure what our plan should be

@georgweiss
Copy link
Collaborator

right now I am confused why the test for save-restore-module are not using JDK17

Not sure how you conclude this...

@shroffk
Copy link
Member Author

shroffk commented Jan 29, 2024

I am seeing this error both in the CI test and on my local tests. The maven -version and the JAVA_HOME are all set correctly but the unit tests still fail with the following.
The major version 61 means the classes are correctly compiled using jdk17... but when executing the tests it seems like it is not using 17

[INFO] Running org.phoebus.applications.saveandrestore.model.json.JsonSerializationTest
java.lang.instrument.IllegalClassFormatException: Error while instrumenting org/phoebus/applications/saveandrestore/model/SnapshotItem.
	at org.jacoco.agent.rt.internal_43f5073.CoverageTransformer.transform(CoverageTransformer.java:94)
	at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:244)
	at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
	at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:541)
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	at org.phoebus.applications.saveandrestore.model.json.JsonSerializationTest.testNaN(JsonSerializationTest.java:104)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
	at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
	at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:55)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:223)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:175)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:139)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169)
	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581)
Caused by: java.io.IOException: Error while instrumenting org/phoebus/applications/saveandrestore/model/SnapshotItem.
	at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrumentError(Instrumenter.java:159)
	at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:109)
	at org.jacoco.agent.rt.internal_43f5073.CoverageTransformer.transform(CoverageTransformer.java:92)
	... 83 more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 61
	at org.jacoco.agent.rt.internal_43f5073.asm.ClassReader.<init>(ClassReader.java:195)
	at org.jacoco.agent.rt.internal_43f5073.asm.ClassReader.<init>(ClassReader.java:176)
	at org.jacoco.agent.rt.internal_43f5073.asm.ClassReader.<init>(ClassReader.java:162)
	at org.jacoco.agent.rt.internal_43f5073.core.internal.instr.InstrSupport.classReaderFor(InstrSupport.java:280)
	at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:75)
	at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:107)
	... 84 more

@georgweiss
Copy link
Collaborator

@shroffk, please remove jacoco plugin in pom.

@georgweiss
Copy link
Collaborator

@shroffk, I'm currently fixing this. Please be patient, will update this PR.

@shroffk
Copy link
Member Author

shroffk commented Jan 30, 2024

I am working on this too... removing the jacoco plugin from the service too

@georgweiss
Copy link
Collaborator

OK, but I would also fix the Javadoc stuff.

@shroffk
Copy link
Member Author

shroffk commented Jan 30, 2024

OK, but I would also fix the Javadoc stuff.

Brilliant, you should have permission to push to this branch.

@georgweiss
Copy link
Collaborator

@shroffk, I am unable to push to branch jdk-17:

error: src refspec jdk-17 does not match any

@shroffk
Copy link
Member Author

shroffk commented Jan 30, 2024

Can you check that you have the right upstream setup... this seems like a git issue

@georgweiss
Copy link
Collaborator

git push --set-upstream origin jdk-17

This fails...

@shroffk shroffk marked this pull request as ready for review January 30, 2024 19:09
@kasemir
Copy link
Collaborator

kasemir commented Feb 9, 2024

Where are we with this? Right now the maven build of master is broken:

git clone https://github.com/ControlSystemStudio/phoebus.git
cd phoebus
mvn  -DskipTests clean install

ends in

[INFO] ----------------< org.phoebus:service-save-and-restore >----------------
[INFO] Building service-save-and-restore 4.7.4-SNAPSHOT                 [89/89]
[INFO]   from services/save-and-restore/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ service-save-and-restore ---
...
[INFO] --- compiler:3.6.2:compile (default-compile) @ service-save-and-restore ---
...
[INFO] --- javadoc:3.0.1:jar (attach-javadocs) @ service-save-and-restore ---
[INFO] The goal 'org.apache.maven.plugins:maven-javadoc-plugin:3.0.1:javadoc' has not been previously called for the module: 'org.phoebus:core-util:jar:4.7.4-SNAPSHOT'. Trying to invoke it...
[WARN] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[WARNING] Creating fake javadoc directory to prevent repeated invocations: /Users/...phoebus/core/util/target/apidocs
[ERROR] Error fetching link: /Users/.../phoebus/core/util/target/apidocs/package-list. Ignored it.
[ERROR] Error fetching link: /Users/.../phoebus/app/save-and-restore/model/target/apidocs/package-list. Ignored it.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for phoebus (parent) 4.7.4-SNAPSHOT:
[INFO] 
[INFO] phoebus (parent) ................................... SUCCESS [  0.185 s]
[INFO] dependencies ....................................... SUCCESS [  0.007 s]
...
[INFO] service-alarm-config-logger ........................ SUCCESS [  0.584 s]
[INFO] service-save-and-restore ........................... FAILURE [  4.864 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:33 min
[INFO] Finished at: 2024-02-09T09:17:56-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.1:jar (attach-javadocs) on project service-save-and-restore: MavenReportException: Error while generating Javadoc: 
[ERROR] Exit code: 1 - Loading source files for package org.phoebus.service.saveandrestore...

That's with

$ mvn -version
Apache Maven 3.9.1 (2e178502fcdbffc201671fb2537d0cb4b4cc58f8)
Maven home: /Users/.../java/apache-maven
Java version: 20, vendor: Oracle Corporation, runtime: /Users/.../jdk-20.jdk/..
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "14.3", arch: "aarch64", family: "mac"

ant clean run of course works fine, but the README suggests we're all maven aficionados, so might as well keep that in a functional state.

@shroffk shroffk merged commit d556408 into master Feb 9, 2024
@shroffk
Copy link
Member Author

shroffk commented Feb 9, 2024

Yesterday at the monthly meeting all participants gave the greenlight for the move to JDK17

javafx21 will be part of a separate PR

@kasemir
Copy link
Collaborator

kasemir commented Feb 9, 2024

.. and it builds again, even with maven! What an excellent way to conclude the week!!

@shroffk shroffk deleted the jdk-17 branch April 11, 2024 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants