• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

SAXParseException: schema_reference.4: Failed to read schema document

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am running into following SAXParseException when I am trying to create a Schema from a URL with the following code.

SchemaFactory sf = ShemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
sf.newSchema(url);

I have verified that schema document exists at the location of URL. Initially I thought this is because of space chars in the URL. But even after encoding the URL, I am running into the this exception.

Could any one please let me know the cause for this exception? Any help in this regard is highly appreciated.

Caused by: org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document
'code-source:/C:/ADE/rchalava_vw3/oracle%20spaces/mds/lib/mdsrt.jar!/oracle/mds/xsd/mdsConfig.xsd',
because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2245)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchema(XSDHandler.java:1590)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:438)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:556)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:523)
at com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:206)
at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:489)
at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:521)
 
Marshal
Posts: 27371
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

code-source:/C:/ADE/rchalava_vw3/oracle%20spaces/mds/lib/mdsrt.jar!/oracle/mds/xsd/mdsConfig.xsd


That's a strange URL. I've never seen the "code-source" protocol before. I suppose you don't have anything supporting that protocol?
 
rajesh chalavadi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
'code-source' URL is specific to ORACLE Application server.

Please find more details in http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/util/ResourceUtils.html

about various protocols of websphere, weblogic, Oracle App server etc.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If this was my problem I would try to parse the schema document using SAX in order to use the better error reporting you can get out of an SAXParseException - namely the line number and column number triggering the fault (if the problem is actually in the document.)

If the problem is really in locating the document in the first place, some sort of IOException will probably occur.

The error message you are getting now is not much help.

Bill
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi.. even i am getting the same kind of error...

i have implemented the code in similar manner as specified in the site Cinnamon Service

i am using with spring and haave deployed the service using cinnamon.





any help with this will be appreciated.
thanks.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Same with me even...
getting the same error. verified using external application, it is working fine but by using Schema factory getting error:Failed to read schema..

Any more suggestions for this??
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even I am facing the same issue. Was anyone able to resolve it, if yes, can you please post the solution. It is working in eclipse but not from command line.
I am using the below command line, I have ensured that all files and version in the maven POM files are correct and they exists.

<code>
java -cp jarfilename fullyqualityclassname
</code>

Thanks,
Mansoor
www.linkedin.com/in/mansoorshaikh
 
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep. Keep this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic