Uploaded image for project: 'Hibernate ORM'
  1. HHH-12991

Metamodel Generator with Java 11 and Error Prone

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: 5.3.6
    • Fix versions: None
    • Components: hibernate-jpamodelgen
    • Labels:
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      I'm having an issue running the JPA Metamodel Generator with Java 10 and Error Prone ( http://errorprone.info/docs/installation )

      Error Prone maven config requires that the annotation processor path defined rather than relying on it being auto detected.

      <profile>
      	<id>errorprone</id>
      	<activation>
      		<activeByDefault>false</activeByDefault>
      	</activation>
      	<build>
      		<directory>/tmp/errorprone/oss</directory>
      		<plugins>
      			<plugin>
      				<groupId>org.apache.maven.plugins</groupId>
      				<artifactId>maven-compiler-plugin</artifactId>
      				<configuration>
      					<source>11</source>
      					<target>11</target>
      					<compilerArgs>
      						<arg>-XDcompilePolicy=simple</arg>
      						<arg>-Xplugin:ErrorProne</arg>
      					</compilerArgs>
      					<annotationProcessorPaths>
      						<path>
      							<groupId>com.google.errorprone</groupId>
      							<artifactId>error_prone_core</artifactId>
      							<version>2.3.2-SNAPSHOT</version>
      						</path>
      						<path>
      							<groupId>org.hibernate</groupId>
      							<artifactId>hibernate-jpamodelgen</artifactId>
      							<version>5.3.6.Final</version>
      						</path>								
      					</annotationProcessorPaths>
      				</configuration>
      			</plugin>
      		</plugins>
      	</build>
      </profile>
      

      Adding the jpa model gen to the config gets it to run, but it fails due to

      Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
          at java.net.URLClassLoader.findClass (URLClassLoader.java:471)
          at java.lang.ClassLoader.loadClass (ClassLoader.java:588)
          at java.lang.ClassLoader.loadClass (ClassLoader.java:521)
          at org.hibernate.jpamodelgen.xml.JpaDescriptorParser.<init> (JpaDescriptorParser.java:60)
          at org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor.init (JPAMetaModelEntityProcessor.java:99)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init> (JavacProcessingEnvironment.java:678)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next (JavacProcessingEnvironment.java:778)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs (JavacProcessingEnvironment.java:873)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1214)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1326)
          at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1258)
          at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:936)
          at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0 (JavacTaskImpl.java:104)
          at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions (JavacTaskImpl.java:147)
          at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:100)
          at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:94)
          at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:126)
          at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
          at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1129)
          at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:188)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
          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:62)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:566)
          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)
      

      The dependency for jaxb exists on the path and things compile in the non errorprone build. It would appear that hibernate-jpamodelgen needs to declare a dependency on jaxb-api

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated: