eclipse-ee4j / jaxb-ri

Jaxb RI
https://eclipse-ee4j.github.io/jaxb-ri/
BSD 3-Clause "New" or "Revised" License
204 stars 111 forks source link

Importing elements from schema with no namespace into schema with a namespace fails #1016

Open Tomas-Kraus opened 10 years ago

Tomas-Kraus commented 10 years ago

I have a complex schema most of which uses the empty namespace, except for one file, CDQobjects.xsd. The elements in there need to rely on some elements from the empty namespace and imports the appropriate file CreditCurves.xsd. However when I run xjc on the schema it fails with error:

parsing a schema... [ERROR] src-resolve: Cannot resolve the name 'RelativeCreditSpreadCurve' to a(n) 'element declaration' component. line 13 of file:/opt/app/ci/workspace/trunk/domain/pricing/src/main/xsd/CDQobjects.xsd

[ERROR] src-resolve: Cannot resolve the name 'CreditSpreadCurve' to a(n) 'element declaration' component. line 14 of file:/opt/app/ci/workspace/trunk/domain/pricing/src/main/xsd/CDQobjects.xsd

However, if I remove all of the other schema files and leave just the one with the error and the one it relies on, without editing them:

Then xjc creates the java classes correctly.

I tried to whittle down the test case to a simpler schema to make it easier for you to reproduce the problem but I ran into some strange and seemingly improbable dependencies:

The error seems to consistently occur on Windows with the package of Schema files that I have attached. I hope you can reproduce it locally and then just delete bits until you get to a simple case that reliably fails and helps you uncover the problem.

Ah. I just started looking for the attach button to include the schema and there doesn't seem to be one! How should I send you the test case?

Environment

Windows 7 or Linux, Java 6u18

Affected Versions

[2.2.7]

Tomas-Kraus commented 6 years ago
Tomas-Kraus commented 10 years ago

@glassfishrobot Commented Reported by markjenner

Tomas-Kraus commented 10 years ago

@glassfishrobot Commented Was assigned to yaroska

Tomas-Kraus commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA JAXB-1016