jQuery in Action, 2nd edition*
The moose likes XML and Related Technologies and the fly likes XJC unable to parse xsd and generate java classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XJC unable to parse xsd and generate java classes" Watch "XJC unable to parse xsd and generate java classes" New topic
Author

XJC unable to parse xsd and generate java classes

Ravi Tej Pidatala
Greenhorn

Joined: Jan 29, 2012
Posts: 14
Hello ,

I have an xsd which I am trying to parse using xsd , generate java classes and xml from it . Below is the xsd . While I use command

xjc even.xsd , I am getting the error ,

parsing a schema...
[WARNING] schema_reference.4: Failed to read schema document 'http://schemas.xmlsoap.org/soap/encoding/', because 1) cou
ld not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
line 2 of file:Event.xsd
I tried to find if xsd is valid online , but got result that its a valid xsd. Can you tell how to generate java classes through this xsd and generate xml from it ?


g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 511
    
    3
[WARNING] schema_reference.4: Failed to read schema document 'http://schemas.xmlsoap.org/soap/encoding/', because 1) cou
ld not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
line 2 of file:Event.xsd

In your case here, the most probable reason is that of 2). Make sure you've internet access during the operation of compilation. If your schema is shown as such, you can even comment the xs:import out all together as it does not use the vacabulary coming from soapenc. That would be the simplest and you would generate a much cleaner class layouts.

The schema also contains a fatal error though the process failed before the problem reveals itself.

At the xs:element ObjectType, you define a default value for it. However, the simpleType of that element is restricted to an enumeration. The default has thereby to appear at least in the list of enumerated value to be consistent, otherwise, as such, it would be a fatal error.
Ravi Tej Pidatala
Greenhorn

Joined: Jan 29, 2012
Posts: 14
Hello Tsuji , thanks for your reply . It was an issue of connection to internet . I was actually connected to internet and able to browse , but through command prompt i was unable to ping any website (may be because of some proxy or settings ) .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XJC unable to parse xsd and generate java classes