Skip to content
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

Failed to compile input schema(s)! Error messages should have been provided. #153

Closed
aleroot opened this issue Jul 28, 2018 · 4 comments
Closed
Assignees
Labels
Milestone

Comments

@aleroot
Copy link

aleroot commented Jul 28, 2018

Hi, when I insert an xsd file into the folder that is source for classes generation, I get the following eclipse error:

Failed to compile input schema(s)! Error messages should have been provided. (org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.14.0:generate:quickconnect:generate-sources)

org.apache.maven.plugin.MojoExecutionException: Failed to compile input schema(s)! Error messages should have been provided.
	at org.jvnet.mjiip.v_2_3.XJC23Mojo.generateCode(XJC23Mojo.java:70)
	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:478)
	at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute(RawXJC2Mojo.java:320)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360)
	at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52)
	at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:115)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:105)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:795)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:216)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:259)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:312)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:315)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:367)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:388)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:142)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:232)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)

What is wrong with the file, here two samples files that are causing the error, with other files the plugin is working correctly, so what is wrong with these two files(BookingRetrievalRS.xsd - ProductAvailRateRetrievalRS.xsd) ?

My plugin maven configuration looks like the following:

			<plugin>
				<groupId>org.jvnet.jaxb2.maven2</groupId>
				<artifactId>maven-jaxb2-plugin</artifactId>
				<executions>
					<execution>
						<id>quickconnect</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>generate</goal>
						</goals>
						<configuration>
							<schemaDirectory>src/main/resources/schema</schemaDirectory>
							<generatePackage>test.quickconnect.bind</generatePackage>
							<generateDirectory>${project.build.directory}/generated-sources/quickconnect</generateDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
@highsource
Copy link
Owner

Please post the complete mvn -X clean install log.

I also don't recomment using generatePackage.

@aleroot
Copy link
Author

aleroot commented Jul 28, 2018

Here it is the complete log file .
mvn.log

@highsource
Copy link
Owner

You have problems because of collisions. Either identical names for types or collisions in the ObjectFactory.

I'd start by removing generatePackage and configuring a different package per namespace using bindings. This will probably make most of the problems go away.

If some problems will still persist, you may need to customize names of the schema-derived classes with <jaxb:class ... /> or <jaxb:factoryMethod ... /> binding customizations.

You should be able to find instructions for both on StackOverflow. If not, ask questions there and ping me. I prefer answering on StackOverflow so that more people could benefit from answers.

The last option, if it for some reason still not worls is to send me a PR with the reproducing project in https://github.com/highsource/maven-jaxb2-plugin-support.

@highsource highsource self-assigned this Jul 29, 2018
@highsource highsource added this to the 0.14.x milestone Jul 29, 2018
@aleroot
Copy link
Author

aleroot commented Jul 29, 2018

Perfect, I've solved with an ad-hoc xjb mapping.

Anyway it would be useful to have the error log that come into eclipse problem view more explanatory or detailed . It was not clear it was a mapping issue.

@aleroot aleroot closed this as completed Jul 29, 2018
laurentschoelens pushed a commit to laurentschoelens/jaxb-tools that referenced this issue May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants