Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: XML Schema: complexContent/extension

  1. #11
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    If it does work if you put it a separate file, it's probably a bug in SWS. Could you file one at the JIRA?

    Thanks,
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  2. #12

    Default

    So is it a bug? Is there a solution to get validator working with abstract schema types?

    I'm facing the same problem (http://forum.springframework.org/showthread.php?t=42668)

  3. #13
    Join Date
    Mar 2006
    Location
    Germany, Karlsruhe
    Posts
    157

    Default

    Hi Exgorth.

    Yes, it's a bug of the Java validator. I thought they will automatically update to a new xerces version which would solve the problem (i hope).

    Arjen described a workaroud in my JIRA report and i use it until now...

    Cheers,

    Ingo

  4. #14

    Default

    I've set the system property:
    Code:
    <plugin>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>maven-jetty-plugin</artifactId>
      <configuration>
        <systemProperties>
          <systemProperty>
            <name>javax.xml.validation.SchemaFactory</name>
            <value>org.apache.xerces.jaxp.validation.XMLSchemaFactory</value>
          </systemProperty>
        </systemProperties>
      </configuration>
    </plugin>
    and i'm still getting the same errors
    Code:
    XML validation error on request: UndeclaredPrefix: Cannot resolve 'sch:Flight' as a QName: the prefix 'sch' is not declared.
    XML validation error on request: cvc-elt.4.1: The value 'sch:Flight' of attribute 'http://www.w3.org/2001/XMLSchema-instance,type' of element 'sch:details' is not a valid QName.
    XML validation error on request: cvc-type.2: The type definition cannot be abstract for element sch:details.
    XML validation error on request: UndeclaredPrefix: Cannot resolve 'sch:Flight' as a QName: the prefix 'sch' is not declared.
    XML validation error on request: cvc-attribute.3: The value 'sch:Flight' of attribute 'xsi:type' on element 'sch:details' is not valid with respect to its type, 'QName'.
    My schema is differs from listed in SWS-35
    in attributeFormDefault="unqualified" instead of attributeFormDefault="qualified"

    So why the workaround doesn't works for me?

  5. #15
    Join Date
    Mar 2006
    Location
    Germany, Karlsruhe
    Posts
    157

    Default

    I've set the system property:
    I hope you also have a version of the original apache-xerces in your classpath? The property alone isn't enough. As far as i know, if the class of the property isn't fount, then Java falls back to the buggy version.

  6. #16

    Default

    I've packaged app in .war file and the following jars i have in WEB-INF/lib:

    Code:
    acegi-security-1.0.3.jar
    activation-1.1.jar
    aopalliance-1.0.jar
    commons-logging-1.1.jar
    jaxb-api-2.1.jar
    jaxb-impl-2.1.3.jar
    log4j-1.2.12.jar
    mail-1.4.jar
    oro-2.0.8.jar
    saaj-api-1.3.jar
    saaj-impl-1.3.jar
    spring-aop-2.0.5.jar
    spring-beans-2.0.5.jar
    spring-context-2.0.5.jar
    spring-core-2.0.6.jar
    spring-dao-2.0.6.jar
    spring-oxm-1.0-rc3-SNAPSHOT.jar
    spring-oxm-tiger-1.0-rc3-20070815.014704-28.jar
    spring-remoting-2.0.5.jar
    spring-support-2.0.5.jar
    spring-web-2.0.5.jar
    spring-webmvc-2.0.5.jar
    spring-ws-core-1.0-rc3-SNAPSHOT.jar
    spring-ws-core-tiger-1.0-rc3-20070815.014704-28.jar
    spring-ws-security-1.0-rc3-20070815.014704-28.jar
    spring-xml-1.0-rc3-SNAPSHOT.jar
    stax-api-1.0-2.jar
    stax-api-1.0.1.jar
    wsdl4j-1.6.1.jar
    xalan-2.7.0.jar
    xercesImpl-2.8.1.jar
    xml-apis-1.3.03.jar
    xmldsig-1.0.jar
    xmlsec-1.3.0.jar
    xmlsec-2.0.jar
    xws-security-2.0-FCS.jar
    and deployed the .war to the clean apache-tomcat-6.0.13.

    also i've added into the catalina.bat:

    Code:
    set JAVA_OPTS=%JAVA_OPTS% -Djavax.xml.validation.SchemaFactory=org.apache.xerces.jaxp.validation.XMLSchemaFactory
    to noop

  7. #17
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Please read the bug report carefully. The property to set is:

    Code:
    javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema
    Note the semicolon, and the W3C schema reference after it.

    So for tomcat, you would do:

    Code:
    set JAVA_OPTS=%JAVA_OPTS% -Djavax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema=org.apache.xerces.jaxp.validation.XMLSchemaFactory
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  8. #18

    Thumbs up

    Thanx, Arjen and res1st.

    It's all validates now!!!

    for jetty i've set:

    Code:
    <plugin>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>maven-jetty-plugin</artifactId>
      <configuration>
        <systemProperties>
          <systemProperty>
            <name>javax.xml.validation.SchemaFactory</name>
            <value>http\://www.w3.org/2001/XMLSchema=org.apache.xerces.jaxp.validation.XMLSchemaFactory</value>
          </systemProperty>
        </systemProperties>
      </configuration>
    </plugin>
    and for tomcat:

    Code:
    set JAVA_OPTS=%JAVA_OPTS% -Djavax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema=org.apache.xerces.jaxp.validation.XMLSchemaFactory
    Again, thanx a lot!

  9. #19
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Great!

    Note that a slightly better solution for Jetty would be this:
    Code:
    <plugin>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>maven-jetty-plugin</artifactId>
      <configuration>
        <systemProperties>
          <systemProperty>
           <name>javax.xml.validation.SchemaFactory\:http\://www.w3.org/2001/XMLSchema</name>
            <value>org.apache.xerces.jaxp.validation.XMLSchemaFactory</value>
          </systemProperty>
        </systemProperties>
      </configuration>
    </plugin>
    Since the property name is "javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema", after all.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

Posting Permissions

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