spring-petclinic / spring-petclinic-graphql

PetClinic Example based on GraphQL
Other
212 stars 123 forks source link

Incompatible with Java 11 #8

Closed Hubbitus closed 2 years ago

Hubbitus commented 5 years ago

./mvnw spring-boot:run run just fine on Java 8 but fails on 11 version with:

$ ./mvnw spring-boot:run
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dsun.java2d.pmoffscreen=false -XX:+UseCompressedOops -XX:+DoEscapeAnalysis -XX:+AggressiveOpts -XX:+EliminateLocks -XX:+UseNUMA -XX:+TieredCompilation
OpenJDK 64-Bit Server VM warning: Option AggressiveOpts was deprecated in version 11.0 and will likely be removed in a future release.
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building petclinic 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> spring-boot-maven-plugin:2.0.1.RELEASE:run (default-cli) > test-compile @ spring-petclinic >>>
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ spring-petclinic ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 11 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ spring-petclinic ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 83 source files to /home/pasha/@Projects/@Senso/webapp.spring-petclinic-graphql/backend/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/pasha/@Projects/@Senso/webapp.spring-petclinic-graphql/backend/src/main/java/org/springframework/samples/petclinic/model/Vets.java:[18,33] package javax.xml.bind.annotation does not exist
[ERROR] /home/pasha/@Projects/@Senso/webapp.spring-petclinic-graphql/backend/src/main/java/org/springframework/samples/petclinic/model/Vets.java:[19,33] package javax.xml.bind.annotation does not exist
[ERROR] /home/pasha/@Projects/@Senso/webapp.spring-petclinic-graphql/backend/src/main/java/org/springframework/samples/petclinic/model/Vets.java:[29,2] cannot find symbol
  symbol: class XmlRootElement
[ERROR] /home/pasha/@Projects/@Senso/webapp.spring-petclinic-graphql/backend/src/main/java/org/springframework/samples/petclinic/model/Vet.java:[23,33] package javax.xml.bind.annotation does not exist
[ERROR] /home/pasha/@Projects/@Senso/webapp.spring-petclinic-graphql/backend/src/main/java/org/springframework/samples/petclinic/model/Vets.java:[34,6] cannot find symbol
  symbol:   class XmlElement
  location: class org.springframework.samples.petclinic.model.Vets
[ERROR] /home/pasha/@Projects/@Senso/webapp.spring-petclinic-graphql/backend/src/main/java/org/springframework/samples/petclinic/model/Vet.java:[55,6] cannot find symbol
  symbol:   class XmlElement
  location: class org.springframework.samples.petclinic.model.Vet
[INFO] 6 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.110 s
[INFO] Finished at: 2019-02-09T23:24:33+03:00
[INFO] Final Memory: 32M/148M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project spring-petclinic: Compilation failure: Compilation failure:
[ERROR] /home/pasha/@Projects/@Senso/webapp.spring-petclinic-graphql/backend/src/main/java/org/springframework/samples/petclinic/model/Vets.java:[18,33] package javax.xml.bind.annotation does not exist
[ERROR] /home/pasha/@Projects/@Senso/webapp.spring-petclinic-graphql/backend/src/main/java/org/springframework/samples/petclinic/model/Vets.java:[19,33] package javax.xml.bind.annotation does not exist
[ERROR] /home/pasha/@Projects/@Senso/webapp.spring-petclinic-graphql/backend/src/main/java/org/springframework/samples/petclinic/model/Vets.java:[29,2] cannot find symbol
[ERROR] symbol: class XmlRootElement
[ERROR] /home/pasha/@Projects/@Senso/webapp.spring-petclinic-graphql/backend/src/main/java/org/springframework/samples/petclinic/model/Vet.java:[23,33] package javax.xml.bind.annotation does not exist
[ERROR] /home/pasha/@Projects/@Senso/webapp.spring-petclinic-graphql/backend/src/main/java/org/springframework/samples/petclinic/model/Vets.java:[34,6] cannot find symbol
[ERROR] symbol:   class XmlElement
[ERROR] location: class org.springframework.samples.petclinic.model.Vets
[ERROR] /home/pasha/@Projects/@Senso/webapp.spring-petclinic-graphql/backend/src/main/java/org/springframework/samples/petclinic/model/Vet.java:[55,6] cannot find symbol
[ERROR] symbol:   class XmlElement
[ERROR] location: class org.springframework.samples.petclinic.model.Vet
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
arey commented 5 years ago

Hi @Hubbitus. Java 11 do not include neither Java Activation nor the JAXB API. Could I let you test the java9+ profile in the https://github.com/spring-petclinic/spring-framework-petclinic/blob/master/pom.xml then submit a PR?

Hubbitus commented 5 years ago

It was master. And I don't think I could make PR in near time, sorry.

shantanu-vsbhosale commented 2 years ago

I faced the same error with adoptopenjdk8 & adoptopenjdk11. Cannot use this project. @arey Also, tried to set java version 9 in pom.xml and run. Still, the same error.

arey commented 2 years ago

I'm working on this issue.

arey commented 2 years ago

This PR https://github.com/spring-petclinic/spring-petclinic-graphql/pull/37/files should fix this issue. I've tested it with Java 8 and Java 11 (both Maven build and runtime)

nilshartmann commented 2 years ago

Newest release is using jdk 11