[jira] [Commented] (SUREFIRE-1424) javax.transaction.TransactionManager not visible with Java9
[ https://issues.apache.org/jira/browse/SUREFIRE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16224180#comment-16224180 ] Alan Bateman commented on SUREFIRE-1424: Tibor - the "Class loaders" section of JEP 261 (http://openjdk.java.net/jeps/261#Class-loaders) has all the details. The important thing is that the class loader arrangement is identical to past releases (system/application -> platform -> boot). Custom class loader that use the default class loader for delegation will not notice. The only code that will be impacted is code that has been bypassing the delegation and going directly to the boot loader. > javax.transaction.TransactionManager not visible with Java9 > --- > > Key: SUREFIRE-1424 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1424 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 2.20.1 > Environment: Apache Maven 3.5.0 > (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00) > Maven home: /Users/snicoll/tools/maven > Java version: 9, vendor: Oracle Corporation > Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home > Default locale: en_BE, platform encoding: UTF-8 > OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac" >Reporter: Stephane Nicoll >Assignee: Tibor Digana > > I am trying to port Spring Boot to Java9 and I am hitting an issue that looks > like Maven specific. I've managed to trim down the problem to [a simple class > that doesn't involve Spring > Boot|https://github.com/snicoll-scratches/test-jta-java9] > If I run this project on the command line, I get the following: > {noformat} > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 s <<< > FAILURE! - in com.example.testjtajava9.TestJtaJava9ApplicationTests > contextLoads(com.example.testjtajava9.TestJtaJava9ApplicationTests) Time > elapsed: 0.006 s <<< ERROR! > java.lang.NoClassDefFoundError: javax/transaction/TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > {noformat} > If I run that test with IntelliJ IDEA, it passes. This sample project has > also a simple Gradle build that shows it works with Gradle as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SUREFIRE-1424) javax.transaction.TransactionManager not visible with Java9
[ https://issues.apache.org/jira/browse/SUREFIRE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16220403#comment-16220403 ] Alan Bateman commented on SUREFIRE-1424: The java.sql module is one of several "non-core" modules that have been moved away from the boot loader so that they can run with reduced permissions. This was done as part of the ongoing security / defense-in-depth work in the JDK. The spec guarantees that all standard types are visible to the platform class loader (formerly known as the extension class loader). It does not guarantee that all standard types are visible to the boot loader. This should only impact code that uses custom class loaders with "null" as the parent and tries to load some non-core classes. > javax.transaction.TransactionManager not visible with Java9 > --- > > Key: SUREFIRE-1424 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1424 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 2.20.1 > Environment: Apache Maven 3.5.0 > (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00) > Maven home: /Users/snicoll/tools/maven > Java version: 9, vendor: Oracle Corporation > Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home > Default locale: en_BE, platform encoding: UTF-8 > OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac" >Reporter: Stephane Nicoll >Assignee: Tibor Digana > > I am trying to port Spring Boot to Java9 and I am hitting an issue that looks > like Maven specific. I've managed to trim down the problem to [a simple class > that doesn't involve Spring > Boot|https://github.com/snicoll-scratches/test-jta-java9] > If I run this project on the command line, I get the following: > {noformat} > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 s <<< > FAILURE! - in com.example.testjtajava9.TestJtaJava9ApplicationTests > contextLoads(com.example.testjtajava9.TestJtaJava9ApplicationTests) Time > elapsed: 0.006 s <<< ERROR! > java.lang.NoClassDefFoundError: javax/transaction/TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > {noformat} > If I run that test with IntelliJ IDEA, it passes. This sample project has > also a simple Gradle build that shows it works with Gradle as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SUREFIRE-1424) javax.transaction.TransactionManager not visible with Java9
[ https://issues.apache.org/jira/browse/SUREFIRE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16220306#comment-16220306 ] Alan Bateman commented on SUREFIRE-1424: --add-modules java.sql is a no-op when compiling or running code on the class path. In order to diagnose the issue then someone needs to look at org.apache.maven.surefire.booter.IsolatedClassLoader, I assume it must be created with a parent of "null" rather than the system class loader. > javax.transaction.TransactionManager not visible with Java9 > --- > > Key: SUREFIRE-1424 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1424 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 2.20.1 > Environment: Apache Maven 3.5.0 > (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00) > Maven home: /Users/snicoll/tools/maven > Java version: 9, vendor: Oracle Corporation > Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home > Default locale: en_BE, platform encoding: UTF-8 > OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac" >Reporter: Stephane Nicoll >Assignee: Tibor Digana > > I am trying to port Spring Boot to Java9 and I am hitting an issue that looks > like Maven specific. I've managed to trim down the problem to [a simple class > that doesn't involve Spring > Boot|https://github.com/snicoll-scratches/test-jta-java9] > If I run this project on the command line, I get the following: > {noformat} > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 s <<< > FAILURE! - in com.example.testjtajava9.TestJtaJava9ApplicationTests > contextLoads(com.example.testjtajava9.TestJtaJava9ApplicationTests) Time > elapsed: 0.006 s <<< ERROR! > java.lang.NoClassDefFoundError: javax/transaction/TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > {noformat} > If I run that test with IntelliJ IDEA, it passes. This sample project has > also a simple Gradle build that shows it works with Gradle as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SUREFIRE-1424) javax.transaction.TransactionManager not visible with Java9
[ https://issues.apache.org/jira/browse/SUREFIRE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16220269#comment-16220269 ] Alan Bateman commented on SUREFIRE-1424: The java.sql and java.sql.rowset modules are not upgradeable. It would be useful to get more details on the NoClassDefFoundError: javax/sql/DataSource issue. Is there a custom class loader in the picture with the null/bootstrap class loader as its parent? There is no guarantee that the classes in all of the standard modules are visible via the bootstrap class loader. If there is code that assumes all classes are visible via the bootstrap class loader then it will need to be fixed to use the application/system or platform class loader as its parent for delegation. > javax.transaction.TransactionManager not visible with Java9 > --- > > Key: SUREFIRE-1424 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1424 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 2.20.1 > Environment: Apache Maven 3.5.0 > (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00) > Maven home: /Users/snicoll/tools/maven > Java version: 9, vendor: Oracle Corporation > Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home > Default locale: en_BE, platform encoding: UTF-8 > OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac" >Reporter: Stephane Nicoll >Assignee: Tibor Digana > > I am trying to port Spring Boot to Java9 and I am hitting an issue that looks > like Maven specific. I've managed to trim down the problem to [a simple class > that doesn't involve Spring > Boot|https://github.com/snicoll-scratches/test-jta-java9] > If I run this project on the command line, I get the following: > {noformat} > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 s <<< > FAILURE! - in com.example.testjtajava9.TestJtaJava9ApplicationTests > contextLoads(com.example.testjtajava9.TestJtaJava9ApplicationTests) Time > elapsed: 0.006 s <<< ERROR! > java.lang.NoClassDefFoundError: javax/transaction/TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > {noformat} > If I run that test with IntelliJ IDEA, it passes. This sample project has > also a simple Gradle build that shows it works with Gradle as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SUREFIRE-1424) javax.transaction.TransactionManager not visible with Java9
[ https://issues.apache.org/jira/browse/SUREFIRE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16214230#comment-16214230 ] Alan Bateman commented on SUREFIRE-1424: I assume this is what you are looking for: Commons Annotations javax.annotation:javax.annotation-api:1.3.1 JavaBeans Activation Framework javax.activation:javax.activation-api:1.2.0 Java Transaction API javax.transaction:javax.transaction-api:1.2 JAXB javax.xml.bind:jaxb-api:2.3.0 org.glassfish.jaxb:jaxb-runtime:2.3.0 (implementation) JAX-WS javax.xml.ws:jaxws-api:2.3.0 com.sun.xml.ws:jaxws-rt::2.3.0 (implementation) The source code for each of these is maintained at https://github.com/javaee . > javax.transaction.TransactionManager not visible with Java9 > --- > > Key: SUREFIRE-1424 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1424 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 2.20.1 > Environment: Apache Maven 3.5.0 > (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00) > Maven home: /Users/snicoll/tools/maven > Java version: 9, vendor: Oracle Corporation > Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home > Default locale: en_BE, platform encoding: UTF-8 > OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac" >Reporter: Stephane Nicoll >Assignee: Tibor Digana > > I am trying to port Spring Boot to Java9 and I am hitting an issue that looks > like Maven specific. I've managed to trim down the problem to [a simple class > that doesn't involve Spring > Boot|https://github.com/snicoll-scratches/test-jta-java9] > If I run this project on the command line, I get the following: > {noformat} > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 s <<< > FAILURE! - in com.example.testjtajava9.TestJtaJava9ApplicationTests > contextLoads(com.example.testjtajava9.TestJtaJava9ApplicationTests) Time > elapsed: 0.006 s <<< ERROR! > java.lang.NoClassDefFoundError: javax/transaction/TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > {noformat} > If I run that test with IntelliJ IDEA, it passes. This sample project has > also a simple Gradle build that shows it works with Gradle as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SUREFIRE-1424) javax.transaction.TransactionManager not visible with Java9
[ https://issues.apache.org/jira/browse/SUREFIRE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16213855#comment-16213855 ] Alan Bateman commented on SUREFIRE-1424: Dropping `--add-modules=java.se.ee`, which I think is what Enrico is proposing with #2, is the way to go. Anyone with a library or application that depend on the Maven artifact and it should just work. Ditto for module projects where they can deploy the java.transaction module on the module path and it should just work too. > javax.transaction.TransactionManager not visible with Java9 > --- > > Key: SUREFIRE-1424 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1424 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 2.20.1 > Environment: Apache Maven 3.5.0 > (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00) > Maven home: /Users/snicoll/tools/maven > Java version: 9, vendor: Oracle Corporation > Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home > Default locale: en_BE, platform encoding: UTF-8 > OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac" >Reporter: Stephane Nicoll >Assignee: Tibor Digana > > I am trying to port Spring Boot to Java9 and I am hitting an issue that looks > like Maven specific. I've managed to trim down the problem to [a simple class > that doesn't involve Spring > Boot|https://github.com/snicoll-scratches/test-jta-java9] > If I run this project on the command line, I get the following: > {noformat} > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 s <<< > FAILURE! - in com.example.testjtajava9.TestJtaJava9ApplicationTests > contextLoads(com.example.testjtajava9.TestJtaJava9ApplicationTests) Time > elapsed: 0.006 s <<< ERROR! > java.lang.NoClassDefFoundError: javax/transaction/TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > {noformat} > If I run that test with IntelliJ IDEA, it passes. This sample project has > also a simple Gradle build that shows it works with Gradle as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SUREFIRE-1424) javax.transaction.TransactionManager not visible with Java9
[ https://issues.apache.org/jira/browse/SUREFIRE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16213778#comment-16213778 ] Alan Bateman commented on SUREFIRE-1424: Again, at issue here is that you cannot upgrade a module by means of a JAR file on the class path. For class path applications, the JDK does not resolve the java.transaction module so you can put JTA on the class path and it should work like any library on the class path. However if you compile or run with `--add-modules java.transaction` (or "java.se.ee" or "ALL-SYSTEM") then java.transaction will be resolved so the class path will never be search for classes in the javax.transaction package. Constrast that with JDK 8 where the only supported way to upgrade JTA with the version from Java EE was to use the endorsed standards override mechanism. Aside from app servers, few knew about that mechanism and instead deployed the JTA JAR file on the class path. If you probe closely then you'll see that the javax.transaction.xa classes were always loaded from the JDK. In the case of the javax.transaction package (where Java SE only defines a small subset), some of the classes were loaded from the JDK, some from the JAR file. It was only an accident that it ever worked. > javax.transaction.TransactionManager not visible with Java9 > --- > > Key: SUREFIRE-1424 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1424 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 2.20.1 > Environment: Apache Maven 3.5.0 > (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00) > Maven home: /Users/snicoll/tools/maven > Java version: 9, vendor: Oracle Corporation > Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home > Default locale: en_BE, platform encoding: UTF-8 > OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac" >Reporter: Stephane Nicoll >Assignee: Tibor Digana > > I am trying to port Spring Boot to Java9 and I am hitting an issue that looks > like Maven specific. I've managed to trim down the problem to [a simple class > that doesn't involve Spring > Boot|https://github.com/snicoll-scratches/test-jta-java9] > If I run this project on the command line, I get the following: > {noformat} > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 s <<< > FAILURE! - in com.example.testjtajava9.TestJtaJava9ApplicationTests > contextLoads(com.example.testjtajava9.TestJtaJava9ApplicationTests) Time > elapsed: 0.006 s <<< ERROR! > java.lang.NoClassDefFoundError: javax/transaction/TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > {noformat} > If I run that test with IntelliJ IDEA, it passes. This sample project has > also a simple Gradle build that shows it works with Gradle as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Comment Edited] (SUREFIRE-1424) javax.transaction.TransactionManager not visible with Java9
[ https://issues.apache.org/jira/browse/SUREFIRE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16210846#comment-16210846 ] Alan Bateman edited comment on SUREFIRE-1424 at 10/19/17 10:27 AM: --- It's the same issue. If you run with - -add-modules $XXX where XXX is any of "java.transaction", "java.corba", "java.se.ee" or "ALL-SYSTEM" then you'll load the java.transaction module from the JDK. I think you are instead hoping that the Java Transaction classes on the class path will be loaded and this will work if the - -add-modules is dropped. This will all be much similar once the JDK jettisons these modules, the first steps in that direction happened in JDK 9. Running with - -add-modules to use the java.transaction in the JDK unwinds that, and makes it harder to upgrade. was (Author: alanbateman): It's the same issue. If you run with {{-add-modules $XXX` where XXX }} is any of "java.transaction", "java.corba", "java.se.ee" or "ALL-SYSTEM" then you'll load the java.transaction module from the JDK. I think you are instead hoping that the Java Transaction classes on the class path will be loaded and this will work if the {{-add-modules}} is dropped. This will all be much similar once the JDK jettisons these modules, the first steps in that direction happened in JDK 9. Running with {{-add-modules}} to use the java.transaction in the JDK unwinds that, and makes it harder to upgrade. > javax.transaction.TransactionManager not visible with Java9 > --- > > Key: SUREFIRE-1424 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1424 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 2.20.1 > Environment: Apache Maven 3.5.0 > (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00) > Maven home: /Users/snicoll/tools/maven > Java version: 9, vendor: Oracle Corporation > Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home > Default locale: en_BE, platform encoding: UTF-8 > OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac" >Reporter: Stephane Nicoll >Assignee: Tibor Digana > > I am trying to port Spring Boot to Java9 and I am hitting an issue that looks > like Maven specific. I've managed to trim down the problem to [a simple class > that doesn't involve Spring > Boot|https://github.com/snicoll-scratches/test-jta-java9] > If I run this project on the command line, I get the following: > {noformat} > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 s <<< > FAILURE! - in com.example.testjtajava9.TestJtaJava9ApplicationTests > contextLoads(com.example.testjtajava9.TestJtaJava9ApplicationTests) Time > elapsed: 0.006 s <<< ERROR! > java.lang.NoClassDefFoundError: javax/transaction/TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > {noformat} > If I run that test with IntelliJ IDEA, it passes. This sample project has > also a simple Gradle build that shows it works with Gradle as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Comment Edited] (SUREFIRE-1424) javax.transaction.TransactionManager not visible with Java9
[ https://issues.apache.org/jira/browse/SUREFIRE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16210846#comment-16210846 ] Alan Bateman edited comment on SUREFIRE-1424 at 10/19/17 10:27 AM: --- It's the same issue. If you run with {{-add-modules $XXX` where XXX }} is any of "java.transaction", "java.corba", "java.se.ee" or "ALL-SYSTEM" then you'll load the java.transaction module from the JDK. I think you are instead hoping that the Java Transaction classes on the class path will be loaded and this will work if the {{-add-modules}} is dropped. This will all be much similar once the JDK jettisons these modules, the first steps in that direction happened in JDK 9. Running with {{-add-modules}} to use the java.transaction in the JDK unwinds that, and makes it harder to upgrade. was (Author: alanbateman): It's the same issue. If you run with {{--add-modules $XXX` where XXX }} is any of "java.transaction", "java.corba", "java.se.ee" or "ALL-SYSTEM" then you'll load the java.transaction module from the JDK. I think you are instead hoping that the Java Transaction classes on the class path will be loaded and this will work if the {{--add-modules}} is dropped. This will all be much similar once the JDK jettisons these modules, the first steps in that direction happened in JDK 9. Running with {{--add-modules}} to use the java.transaction in the JDK unwinds that, and makes it harder to upgrade. > javax.transaction.TransactionManager not visible with Java9 > --- > > Key: SUREFIRE-1424 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1424 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 2.20.1 > Environment: Apache Maven 3.5.0 > (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00) > Maven home: /Users/snicoll/tools/maven > Java version: 9, vendor: Oracle Corporation > Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home > Default locale: en_BE, platform encoding: UTF-8 > OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac" >Reporter: Stephane Nicoll >Assignee: Tibor Digana > > I am trying to port Spring Boot to Java9 and I am hitting an issue that looks > like Maven specific. I've managed to trim down the problem to [a simple class > that doesn't involve Spring > Boot|https://github.com/snicoll-scratches/test-jta-java9] > If I run this project on the command line, I get the following: > {noformat} > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 s <<< > FAILURE! - in com.example.testjtajava9.TestJtaJava9ApplicationTests > contextLoads(com.example.testjtajava9.TestJtaJava9ApplicationTests) Time > elapsed: 0.006 s <<< ERROR! > java.lang.NoClassDefFoundError: javax/transaction/TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > {noformat} > If I run that test with IntelliJ IDEA, it passes. This sample project has > also a simple Gradle build that shows it works with Gradle as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Comment Edited] (SUREFIRE-1424) javax.transaction.TransactionManager not visible with Java9
[ https://issues.apache.org/jira/browse/SUREFIRE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16210846#comment-16210846 ] Alan Bateman edited comment on SUREFIRE-1424 at 10/19/17 10:26 AM: --- It's the same issue. If you run with {{--add-modules $XXX` where XXX }} is any of "java.transaction", "java.corba", "java.se.ee" or "ALL-SYSTEM" then you'll load the java.transaction module from the JDK. I think you are instead hoping that the Java Transaction classes on the class path will be loaded and this will work if the {{--add-modules}} is dropped. This will all be much similar once the JDK jettisons these modules, the first steps in that direction happened in JDK 9. Running with {{--add-modules}} to use the java.transaction in the JDK unwinds that, and makes it harder to upgrade. was (Author: alanbateman): It's the same issue. If you run with `--add-modules $XXX` where XXX is any of "java.transaction", "java.corba", "java.se.ee" or "ALL-SYSTEM" then you'll load the java.transaction module from the JDK. I think you are instead hoping that the Java Transaction classes on the class path will be loaded and this will work if the `--add-modules` is dropped. This will all be much similar once the JDK jettisons these modules, the first steps in that direction happened in JDK 9. Running with `--add-modules` to use the java.transaction in the JDK unwinds that, and makes it harder to upgrade. > javax.transaction.TransactionManager not visible with Java9 > --- > > Key: SUREFIRE-1424 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1424 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 2.20.1 > Environment: Apache Maven 3.5.0 > (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00) > Maven home: /Users/snicoll/tools/maven > Java version: 9, vendor: Oracle Corporation > Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home > Default locale: en_BE, platform encoding: UTF-8 > OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac" >Reporter: Stephane Nicoll >Assignee: Tibor Digana > > I am trying to port Spring Boot to Java9 and I am hitting an issue that looks > like Maven specific. I've managed to trim down the problem to [a simple class > that doesn't involve Spring > Boot|https://github.com/snicoll-scratches/test-jta-java9] > If I run this project on the command line, I get the following: > {noformat} > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 s <<< > FAILURE! - in com.example.testjtajava9.TestJtaJava9ApplicationTests > contextLoads(com.example.testjtajava9.TestJtaJava9ApplicationTests) Time > elapsed: 0.006 s <<< ERROR! > java.lang.NoClassDefFoundError: javax/transaction/TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > {noformat} > If I run that test with IntelliJ IDEA, it passes. This sample project has > also a simple Gradle build that shows it works with Gradle as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SUREFIRE-1424) javax.transaction.TransactionManager not visible with Java9
[ https://issues.apache.org/jira/browse/SUREFIRE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16210846#comment-16210846 ] Alan Bateman commented on SUREFIRE-1424: It's the same issue. If you run with `--add-modules $XXX` where XXX is any of "java.transaction", "java.corba", "java.se.ee" or "ALL-SYSTEM" then you'll load the java.transaction module from the JDK. I think you are instead hoping that the Java Transaction classes on the class path will be loaded and this will work if the `--add-modules` is dropped. This will all be much similar once the JDK jettisons these modules, the first steps in that direction happened in JDK 9. Running with `--add-modules` to use the java.transaction in the JDK unwinds that, and makes it harder to upgrade. > javax.transaction.TransactionManager not visible with Java9 > --- > > Key: SUREFIRE-1424 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1424 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 2.20.1 > Environment: Apache Maven 3.5.0 > (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00) > Maven home: /Users/snicoll/tools/maven > Java version: 9, vendor: Oracle Corporation > Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home > Default locale: en_BE, platform encoding: UTF-8 > OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac" >Reporter: Stephane Nicoll >Assignee: Tibor Digana > > I am trying to port Spring Boot to Java9 and I am hitting an issue that looks > like Maven specific. I've managed to trim down the problem to [a simple class > that doesn't involve Spring > Boot|https://github.com/snicoll-scratches/test-jta-java9] > If I run this project on the command line, I get the following: > {noformat} > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 s <<< > FAILURE! - in com.example.testjtajava9.TestJtaJava9ApplicationTests > contextLoads(com.example.testjtajava9.TestJtaJava9ApplicationTests) Time > elapsed: 0.006 s <<< ERROR! > java.lang.NoClassDefFoundError: javax/transaction/TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > {noformat} > If I run that test with IntelliJ IDEA, it passes. This sample project has > also a simple Gradle build that shows it works with Gradle as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SUREFIRE-1424) javax.transaction.TransactionManager not visible with Java9
[ https://issues.apache.org/jira/browse/SUREFIRE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16186079#comment-16186079 ] Alan Bateman commented on SUREFIRE-1424: Maven runs on the class path. The default set of root modules when you are compiling code or running on the class path includes the java.sql module [1] so you don't need to do anything (you don't need `--add-modules java.sql`). Once you get the all the plugins using the standalone versions of the modules shared with Java EE then you shouldn't need any special module options. [1] http://openjdk.java.net/jeps/261#Root-modules > javax.transaction.TransactionManager not visible with Java9 > --- > > Key: SUREFIRE-1424 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1424 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 2.20.1 > Environment: Apache Maven 3.5.0 > (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00) > Maven home: /Users/snicoll/tools/maven > Java version: 9, vendor: Oracle Corporation > Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home > Default locale: en_BE, platform encoding: UTF-8 > OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac" >Reporter: Stephane Nicoll >Assignee: Tibor Digana > > I am trying to port Spring Boot to Java9 and I am hitting an issue that looks > like Maven specific. I've managed to trim down the problem to [a simple class > that doesn't involve Spring > Boot|https://github.com/snicoll-scratches/test-jta-java9] > If I run this project on the command line, I get the following: > {noformat} > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 s <<< > FAILURE! - in com.example.testjtajava9.TestJtaJava9ApplicationTests > contextLoads(com.example.testjtajava9.TestJtaJava9ApplicationTests) Time > elapsed: 0.006 s <<< ERROR! > java.lang.NoClassDefFoundError: javax/transaction/TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > {noformat} > If I run that test with IntelliJ IDEA, it passes. This sample project has > also a simple Gradle build that shows it works with Gradle as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SUREFIRE-1424) javax.transaction.TransactionManager not visible with Java9
[ https://issues.apache.org/jira/browse/SUREFIRE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16185514#comment-16185514 ] Alan Bateman commented on SUREFIRE-1424: You shouldn't need to be concerned with the java.sql module. The only modules that you need to be concerned about are: java.corba java.transaction java.activation java.xml.bind java.xml.ws java.xml.ws.annotation and the java.se.ee aggregator. These modules are deprecated in Java SE and are proposed to be removed in a future release. Aside from java.corba, the 5 modules shared with Java EE are standalone technologies, each with one or more JSRs and its own download. Each of these projects used to be on java.net but moved to the Java EE github project recently. I don't know if the move to Eclipse will change anything there. In any case, each of the standalone versions can be deployed on the class path with JDK 9. In time they will be deployable as modules too and this will allow them to be deployed on the upgrade module path (--upgrade-module-path) to upgrade/override the module in the run-time image with the standalone or Java EE module. This will actually work with all except for the transaction API as there are a couple of issues to sort out there before it can be deployed as a module. As I understand it, the Spring folks in the JIRA issue are deploying the JTA JAR file on the class path. That should just work but is complicated by `--add-module=java.se.ee` as that will cause the java.transaction module to be resolved. You can't split the javax.transaction package between a module and the class path. For the surefire plugin then dropping the --add-modules should be looked at. You'll need to do that anyway once java.se.ee goes away. If the plugin relies on JAXB then adding a dependency on the standalone version should work. -Alan > javax.transaction.TransactionManager not visible with Java9 > --- > > Key: SUREFIRE-1424 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1424 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 2.20.1 > Environment: Apache Maven 3.5.0 > (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00) > Maven home: /Users/snicoll/tools/maven > Java version: 9, vendor: Oracle Corporation > Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home > Default locale: en_BE, platform encoding: UTF-8 > OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac" >Reporter: Stephane Nicoll >Assignee: Tibor Digana > > I am trying to port Spring Boot to Java9 and I am hitting an issue that looks > like Maven specific. I've managed to trim down the problem to [a simple class > that doesn't involve Spring > Boot|https://github.com/snicoll-scratches/test-jta-java9] > If I run this project on the command line, I get the following: > {noformat} > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 s <<< > FAILURE! - in com.example.testjtajava9.TestJtaJava9ApplicationTests > contextLoads(com.example.testjtajava9.TestJtaJava9ApplicationTests) Time > elapsed: 0.006 s <<< ERROR! > java.lang.NoClassDefFoundError: javax/transaction/TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at > com.example.testjtajava9.TestJtaJava9ApplicationTests.contextLoads(TestJtaJava9ApplicationTests.java:9) > {noformat} > If I run that test with IntelliJ IDEA, it passes. This sample project has > also a simple Gradle build that shows it works with Gradle as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029)