Closed jensnerche closed 7 months ago
Can you provide an error description, i.e. does jQA fail while running and/or scanning Java 16 and what is the problem you observe?
[INFO] --- jqassistant-maven-plugin:1.10.0:scan (default) @ uneven-modules ---
[INFO] Scanning for jQAssistant plugins...
[INFO] [Asciidoc, Asciidoc Report, CDI, Common, Core Analysis, Core Report, EJB3, GraphML, GraphQL, JAX-RS, JPA 2, JSON, JUnit, Java, Java EE 6, Maven 2 Repository, Maven 3, OSGi, PlantUML, RDBMS, Spring, TestNG, Tycho, XML, YAML].
[INFO] Connecting to store at 'file:/C:/uneven-modules/target/jqassistant/store/'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.640 s
[INFO] Finished at: 2021-08-23T14:09:14+02:00
[INFO] Final Memory: 84M/296M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.buschmais.jqassistant:jqassistant-maven-plugin:1.10.0:scan (default) on project uneven-modules: Execution default of goal com.buschmais.jqassistant:jqassistant-maven-plugin:1.10.0:scan failed: Error starting org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory, C:\uneven-modules\target\jqassistant: Component 'org.neo4j.kernel.NeoStoreDataSource@1c7f52c8' was successfully initialized, but failed to start. Please see the attached cause exception "Unable to make field private java.lang.String java.lang.Throwable.detailMessage accessible: module java.base doe
s not "opens java.lang" to unnamed module @73b8c79b". Could not get Throwable message field -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.buschmais.jqassistant:jqassistant-maven-plugin:1.10.0:scan (default) on project uneven-modules: Execution default of goal com.buschmais.jqassistant:jqassistant-maven-plugin:1.10.0:scan failed: Error starting org.neo4j.graphdb.f
acade.GraphDatabaseFacadeFactory, C:\uneven-modules\target\jqassistant
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:55)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal com.buschmais.jqassistant:jqassistant-maven-plugin:1.10.0:scan failed: Error starting org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory, C:\uneven-modules\target\jqassistant
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:55)
Caused by: java.lang.RuntimeException: Error starting org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory, C:\uneven-modules\target\jqassistant
at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.initFacade (GraphDatabaseFacadeFactory.java:232)
at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.newFacade (GraphDatabaseFacadeFactory.java:148)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase (GraphDatabaseFactory.java:133)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase (GraphDatabaseFactory.java:122)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$EmbeddedDatabaseCreator.newDatabase (GraphDatabaseFactory.java:178)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase (GraphDatabaseBuilder.java:210)
at com.buschmais.xo.neo4j.embedded.api.FileDatastoreFactory.createGraphDatabaseService (FileDatastoreFactory.java:38)
at com.buschmais.xo.neo4j.embedded.api.FileDatastoreFactory.createGraphDatabaseService (FileDatastoreFactory.java:18)
at com.buschmais.xo.neo4j.embedded.api.EmbeddedNeo4jXOProvider.createDatastore (EmbeddedNeo4jXOProvider.java:24)
at com.buschmais.xo.impl.XOManagerFactoryImpl.
That's a bit of a chicken-egg problem now: The issue is caused by Neo4j 3.5.x which is used by jQA as it is the last Neo4j release supporting Java 8 (which we want to support for legacy projects)
There were in the past also options to use newer Neo4j versions (think it was 2.x vs. 3.x), could that be applied again?
Hi, there are ways to achive both, but I never had a look at them in deep.
@DirkMahler, we have somehow to work on this. I see the need to support older applications, but on the other hand staying with Java 8 is also not a solution for the near future. Let us discuss this in our weekly sync.
There's a workaround available. Just add
--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED
to the environment variable MAVEN_OPTS
or (even easier) create a file .mvn/jvm.config
with that content in the directory of the root module.
Thanks @DirkMahler , this workaround helps to get jQA working with JDK 16. For me it would be enough to close this ticket, maybe a note in the documentation would be helpful:
On the other hand it could be useful to benefit from new features in Neo4j 4.x versions, but I guess that would be a different ticket.
Could it be possible to have both a neo4j 4 backend, and a neo4j 5 backend? The first one could be use to keep compatibility with legacy applications, while the second could be use to have a straight forward compatibility with projects using java 17+.
Next release will provide separate CLI distributions, see https://github.com/jQAssistant/jqa-commandline-tool/issues/31. Furthermore the Maven Plugin will automatically select an according Neo4j version depending on the current runtime (JDK 11 vs. JDK 17 or later)
Feature Description
I, as Java developer would like to use jQAssistant running with JDK 16 to that I'm able to scan and analyze also Java 16 projects.
Additional information on the requested Feature
It is likely that jQA will also not run with the next LTS version 17 which is expected in September 2021 (next month from now).
How to Test
Just compile and scan any Maven (or Gradle) project with OpenJDK 16.
Definition of Done for the Implementers