chenejac / VIVOTestMigrationJIRA

0 stars 0 forks source link

VIVO-1939: Eclipse envirovment, JPMS does not allow xml-apis in VIVO (jdk 11) #1828

Open chenejac opened 3 years ago

chenejac commented 3 years ago

alessandro galasso (Migrated from VIVO-1939) said:

envirovment:

Eclipse IDE  , STS 4 

jdk:  {color:#1d1c1d}openjdk version "11.0.8" 2020-07-14 LTS{color} {color:#1d1c1d}OpenJDK Runtime Environment 18.9 (build 11.0.8+10-LTS){color} {color:#1d1c1d}OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode){color}

{color:#1d1c1d}maven 3.6.3{color}

{color:#1d1c1d}apache-tomcat-9.0.39{color}

 

{color:#1d1c1d}when migrating from Java 8 to Java 11 i notice that the JPMS is {color}{color:#1d1c1d} not allowing to use the same package in more than one module:{color}

{color:#1d1c1d}i get compilation errors all over the application:{color}

{color:#1d1c1d}The package xxxx is accessible from more than one module: <unnamed>, java.xml{color}

 

{color:#1d1c1d}Tomcat is also complaining (during startup) about garbage collection Illegal reflective access and the tomcat team about this said : "We'll keep the explicit clearing in place as long as we can" {color}

 

{color:#1d1c1d}my solution:{color}

 

{color:#1d1c1d}tomcat 9 launch configuration:{color}

{color:#1d1c1d}--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED{color}

 

{color:#1d1c1d}pom.xml{color}

{color:#1d1c1d}

org.owasp.antisamy antisamy 1.5.10 commons-httpclient commons-httpclient xml-apis xml-apis

{color}

 

{color:#1d1c1d}

org.apache.maven.plugins maven-compiler-plugin 3.8.0 11 UTF-8

{color}

{color:#1d1c1d} {color}

 

chenejac commented 3 years ago

Ralph O'Flinn said:

Yeah XML-APIS is an incredibly old Java 5 or before jar.  In looking through this just a bit I came across this:

 

[https://stackoverflow.com/questions/51094274/eclipse-cant-find-xml-related-classes-after-switching-build-path-to-jdk-10]

 

Also are you doing this all in Windows or Linux?  Are you specifically tied to Eclipse or do you have options?

chenejac commented 3 years ago

alessandro galasso said:

Hi, yes i'm on windows. It.s not as issue for me that force me to change eclipse for something else, i have a working solution; my fear was to leave in the code an old jar that may be problematic in the future (as  the servers will automaticaly get updated with new linux releases and new jdk 11 java versions)

 

chenejac commented 3 years ago

Andrew Woods said:

Thank you for documenting the issue you are seeing and your resolution, [~accountid:6113d64575ad9600699b6a63].

I would like to include a fix in the core codebase, but am reluctant to force Java 11. As you likely know, VIVO only requires Java 8 to build as we have refrained from using any Java 11 idioms. https://github.com/vivo-project/VIVO/blob/master/pom.xml#L303-L304

With that said, we will keep this ticket open in case others run into the same issue that you have documented.