Meaningless Drivel is fun!*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAXB namespace issue" Watch "JAXB namespace issue" New topic
Author

JAXB namespace issue

Richard Roszak
Greenhorn

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?

Thanks
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
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
Greenhorn

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JAXB namespace issue
 
Similar Threads
Different Schemas using com.sun.tools.xjc.maven2
Metro JAX-WS @schemaValidation How to specify schemas instead of annotaion generated
JAXB XJC compiling Issue
JAXB issue | Jboss error on startup
how to import 2 xsd's which have same namespace?