jQuery in Action, 3rd edition
The moose likes Web Services and the fly likes JAXB namespace issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAXB namespace issue" Watch "JAXB namespace issue" New topic

JAXB namespace issue

Richard Roszak

Joined: Jan 06, 2009
Posts: 27
I have reference to a namespace that is in a different directory then the xsd that I’m trying to bind. When I try binding I get the following error:

[ERROR] src-resolve: Cannot resolve the name ‘ms:MyMethod.Enumeration’ to a(n) type definition component.

My xsd looks like this:

The line it fails is as follows:

MS.xsd is located ..\..\..\MS directory above where this xsd is located. Not sure on how I need to use xjc to generate the java files while finding the MS.xsd?

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
A quick reply: When I see your XML schema with the import of the MS.xsd schema file, I get the feeling that the MS.xsd file should be located in the same directory as the other XML schema.
An alternative may be to change the schema location in the import statement so that the MS.xsd schema is found.
Best wishes!
Richard Roszak

Joined: Jan 06, 2009
Posts: 27
Thanks Ivan. You are correct. If I move the MS.xsd to current directory or give a relative path in the schemaLocation it works correctly.
I agree. Here's the link: http://aspose.com/file-tools
subject: JAXB namespace issue
It's not a secret anymore!