Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: sax parser unable to read spring xsd

  1. #1
    Join Date
    Oct 2007
    Posts
    4

    Default sax parser unable to read spring xsd

    Running on JBOSS-4.0.5GA with xfire-2.1.6 soap stack.

    Changing to spring 2.5 declarative transaction and have an application context doc (transaction.xml) with the following beans tag;

    <?xml version="1.0" encoding="UTF-8"?>

    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.5.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schem...ing-tx-2.5.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schem...ng-aop-2.5.xsd
    http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd" ........

    which gets the following error when the server starts:

    org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans-2.5.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>.

    the URIs are reachable via browser.
    server has no problem with earlier dtd based docs.

    looked at proxy setting, it looks okay.
    anyone have similar experience?

  2. #2
    Join Date
    Nov 2005
    Location
    Reutlingen, Germany
    Posts
    2,098

    Default

    It should not even try to access the remote document. Spring usually reads the schemas from the class path.

    Joerg
    This post can contain insufficient information.

  3. #3
    Join Date
    Oct 2007
    Posts
    4

    Default

    Problem solved: unprintable character in the header

  4. #4

    Default

    Hello,

    Running on JBOSS-5.0.0.GA, I'm facing the same kind of problem :

    Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans-2.5.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>. @ vfszip:/D:/SocleTechniqueJEE/jboss-5.0.0.GA/server/default/deploy/PetClinicWeb.war/WEB-INF/applicationContext-hibernate.xml[9,106]

    Whereas link to the xsd is OK :

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    		xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
    		xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
    		xsi:schemaLocation="
    			http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    			http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
    			http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
    			http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
    Please give more accurate explanations on how you did solve this issue,

    Kind regards,

    tstebut

  5. #5
    Join Date
    Nov 2008
    Posts
    19

    Default

    The XSDs are not read from the URI. There is a spring.schemas file in the Spring META-INF folder, which points these URIs to the location in the classpath. The problem could be either that something is preventing the XSDs to be available from the classpath.

    Could you post the complete stack trace?

  6. #6
    Join Date
    Feb 2009
    Location
    India
    Posts
    14

    Default

    have this problem resolved? I am facing same kind of problem. I shall be very thankful if u share the solution.

  7. #7
    Join Date
    Nov 2008
    Posts
    19

    Default

    I didn't look into it much, but either or your XML contains invalid characters - say a unicode unescaped character or as a workaround you could use the DTD format in your Spring XMLs.

    HTH!

  8. #8
    Join Date
    Feb 2009
    Location
    India
    Posts
    14

    Default

    Thanks San !.... problem is resolved, it seems right that there are some invalid characters issue. I just remove some spaces in application-servlet.xml after <?xml version="1.0" encoding="UTF-8"?>. But still I strange about this problem.

  9. #9

    Default

    Invalid characters is not the only reason. I got similar error because a required library was missing.

    Code:
    org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/integration/xml/spring-integration-xml-1.0.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>
    Fixed by adding org.springframework.integration.xml-1.0.4.RELEASE.jar

    So looks like it is a misleading error message that just means something is wrong somewhere.

  10. #10
    Join Date
    Aug 2010
    Posts
    3

    Default

    Quote Originally Posted by sangupta View Post
    The XSDs are not read from the URI. There is a spring.schemas file in the Spring META-INF folder, which points these URIs to the location in the classpath. The problem could be either that something is preventing the XSDs to be available from the classpath.

    Could you post the complete stack trace?
    have this problem resolved? I am facing same kind of problem. I shall be very thankful if u share the solution.
    No one indebted for others,while many people don't know how to cherish others.Buy Guild Wars 2 gold cheapest!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •