Open vercevales opened 4 years ago
I have the same problem. I can reproduce both errors (with jaxb2-maven-plugin 2.5.0 and 2.3.1). Are there any known workarounds for this problem yet?
As @vercevales already wrote, the problem is that jaxb-xjc 2.3.2 does not include the missing resources. It seems like this problem has already been fixed in jaxb-xjc in the following commit: https://github.com/eclipse-ee4j/jaxb-ri/commit/0042068395f720bbe368762832e33ede1141f67a
When using jaxb-xjc 2.3.3-b01 (the next version following 2.3.2), I ran into other problems. So I cloned jaxb-xjc, checked out the tag 2.3.2 and cherry-picked commit 0042068395f720bbe368762832e33ede1141f67a. I then installed jaxb-xjc and rebuilt my project. The problem with the missing ZeroOneBooleanAdapter file was gone.
The corresponding issue in the jaxb-ri project is the following: https://github.com/eclipse-ee4j/jaxb-ri/issues/1287
Hi!
Having multiple XSD for SAML (official and standard XSDs) and trying to use them to generate classes I got an error: Exception in thread "main" java.lang.InternalError: Unable to load source code of com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter as a resource.
Digging deeper into the issue I have discovered that the missing resources were removed from jaxb-xjc 2.3.2 (which is used in jaxb2-maven-plugin 2.5.0) whereas in jaxb-xjc 2.2.11 (which is used in jaxb2-maven-plugin 2.3.1) they are present.
POM's build section: `
mvn clean compile output (the classes are generated, but file ZeroOneBooleanAdapter.java is empty):
[INFO] ------------------------------------------------------------------------ Exception in thread "main" java.lang.InternalError: Unable to load source code of com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter as a resource at com.sun.codemodel.fmt.JStaticJavaFile$ResourceLoader.getResourceAsStream(JStaticJavaFile.java:234) at com.sun.codemodel.fmt.JStaticJavaFile.build(JStaticJavaFile.java:84) at com.sun.codemodel.JPackage.build(JPackage.java:446) at com.sun.codemodel.JCodeModel.build(JCodeModel.java:327) at com.sun.codemodel.JCodeModel.build(JCodeModel.java:317) at com.sun.tools.xjc.Driver.run(Driver.java:384) at org.codehaus.mojo.jaxb2.javageneration.AbstractJavaGeneratorMojo.performExecution(AbstractJavaGeneratorMojo.java:475) at org.codehaus.mojo.jaxb2.AbstractJaxbMojo.execute(AbstractJaxbMojo.java:337) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) 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:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/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) at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
when I downgrade the plugin to version `org.codehaus.mojo