New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code generation fails with "Prefix '' is already bound to ''" when episode generation is on on Java 9 #146

Closed
highsource opened this Issue Apr 29, 2018 · 9 comments

Comments

Projects
None yet
4 participants
@highsource
Owner

highsource commented Apr 29, 2018

On Java 9 with episode generation turned on, code generation fails:

[ERROR] Failed to execute goal org.jvnet.jaxb2.maven2:maven-jaxb23-plugin:0.13.3-SNAPSHOT:generate (generate) on project maven-jaxb2-plugin-tests-java-9: Execution generate of goal org.jvnet.jaxb2.maven2:maven-jaxb23-plugin:0.13.3-SNAPSHOT:generate failed: Prefix '' is already bound to '' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jvnet.jaxb2.maven2:maven-jaxb23-plugin:0.13.3-SNAPSHOT:generate (generate) on project maven-jaxb2-plugin-tests-java-9: Execution generate of goal org.jvnet.jaxb2.maven2:maven-jaxb23-plugin:0.13.3-SNAPSHOT:generate failed: Prefix '' is already bound to ''
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	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:564)
	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)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution generate of goal org.jvnet.jaxb2.maven2:maven-jaxb23-plugin:0.13.3-SNAPSHOT:generate failed: Prefix '' is already bound to ''
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	... 20 more
Caused by: java.lang.IllegalArgumentException: Prefix '' is already bound to ''
	at com.sun.xml.txw2.StartTag.addNamespaceDecl(StartTag.java:191)
	at com.sun.xml.txw2.ContainerElement._namespace(ContainerElement.java:333)
	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:564)
	at com.sun.xml.txw2.ContainerElement.invoke(ContainerElement.java:134)
	at com.sun.proxy.$Proxy46._namespace(Unknown Source)
	at com.sun.tools.xjc.addon.episode.PluginImpl.run(PluginImpl.java:174)
	at com.sun.tools.xjc.model.Model.generateCode(Model.java:292)
	at org.jvnet.mjiip.v_2_3.XJC23Mojo.generateCode(XJC23Mojo.java:66)
	at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute(XJC23Mojo.java:41)
	at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute(XJC23Mojo.java:28)
	at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute(RawXJC2Mojo.java:473)
	at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute(RawXJC2Mojo.java:317)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	... 21 more
@highsource

This comment has been minimized.

Show comment
Hide comment
@highsource

highsource Apr 29, 2018

Owner

I think this is actually a problem in the episode plugin. Which is part of XJC, not my code.

Owner

highsource commented Apr 29, 2018

I think this is actually a problem in the episode plugin. Which is part of XJC, not my code.

@nicolaiparlog

This comment has been minimized.

Show comment
Hide comment
@nicolaiparlog

nicolaiparlog May 4, 2018

Contributor

Just FYI: I just built the plugin from the 2.3 directory in the java-9 branch and I still get the same error for episode generation.

Contributor

nicolaiparlog commented May 4, 2018

Just FYI: I just built the plugin from the 2.3 directory in the java-9 branch and I still get the same error for episode generation.

@highsource

This comment has been minimized.

Show comment
Hide comment
@highsource

highsource May 4, 2018

Owner

@nicolaiparlog Please build the whole thing in java-9 branch. Also please delete 0.13.3-SNAPSHOT from the local repo beforehand.

Owner

highsource commented May 4, 2018

@nicolaiparlog Please build the whole thing in java-9 branch. Also please delete 0.13.3-SNAPSHOT from the local repo beforehand.

@davidbilge

This comment has been minimized.

Show comment
Hide comment
@davidbilge

davidbilge May 7, 2018

I have the same problem, but do not use episodes (at least not knowingly). Using maven-jaxb2-plugin version 0.13.3.

davidbilge commented May 7, 2018

I have the same problem, but do not use episodes (at least not knowingly). Using maven-jaxb2-plugin version 0.13.3.

@nicolaiparlog

This comment has been minimized.

Show comment
Hide comment
@nicolaiparlog

nicolaiparlog May 7, 2018

Contributor

It's unclear to me why I have to build the entire project, but it works 😄 : I can now generate episode files (tested in this demo project).

Contributor

nicolaiparlog commented May 7, 2018

It's unclear to me why I have to build the entire project, but it works 😄 : I can now generate episode files (tested in this demo project).

@highsource

This comment has been minimized.

Show comment
Hide comment
@highsource

highsource May 7, 2018

Owner

@davidbilge If you did not explicitly configured episodes to false, then episode files will be generated by default.

Owner

highsource commented May 7, 2018

@davidbilge If you did not explicitly configured episodes to false, then episode files will be generated by default.

@highsource

This comment has been minimized.

Show comment
Hide comment
@highsource

highsource May 7, 2018

Owner

@nicolaiparlog Great. It is necessary to rebuild the whole project since the fix is not in maven-jaxb23-plugin but in one of the core modules.

Owner

highsource commented May 7, 2018

@nicolaiparlog Great. It is necessary to rebuild the whole project since the fix is not in maven-jaxb23-plugin but in one of the core modules.

@highsource

This comment has been minimized.

Show comment
Hide comment
@highsource

highsource May 7, 2018

Owner

OK, I'll release the new version in the next days then. I don't see the need for extra pre-java9/post-java9 versions at the moment, So I'll risk releasing just one version.

Owner

highsource commented May 7, 2018

OK, I'll release the new version in the next days then. I don't see the need for extra pre-java9/post-java9 versions at the moment, So I'll risk releasing just one version.

@lhanson

This comment has been minimized.

Show comment
Hide comment
@lhanson

lhanson May 30, 2018

I'm experiencing the same issue, awaiting the next release. Thanks!

lhanson commented May 30, 2018

I'm experiencing the same issue, awaiting the next release. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment