axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Sprat <rexclaim...@yahoo.com>
Subject [Axis2] schema validation exception
Date Mon, 24 Sep 2007 16:53:21 GMT
I am getting an UnsupportedOperation Exception each time I try to validate an OMElement against
a schema.  I am using Axis2 1.2 with no data binding so my service class receives an OMElement
object.  The validation code is quite simple:

        // Get XML stream reader from OMElement received
        XMLStreamReader reader = doc.getXMLStreamReader();
        //Create the DOOM OMFactory
        OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
        //Create the new builder
        StAXOMBuilder doomBuilder = new StAXOMBuilder(doomFactory, reader);
        //Get the document element
        OMElement omElem = doomBuilder.getDocumentElement();

        try {
            SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
            Schema xsd = factory.newSchema(schemaLocation);
            Validator validator = xsd.newValidator();
            validator.validate(new DOMSource((Element) omElem));
            return true;
        }
        catch (Exception e) {
            return false;
        }

Below is a snippet of the stack trace:


java.lang.UnsupportedOperationException: TODO
      at
org.apache.axiom.om.impl.dom.DocumentImpl.getDoctype(DocumentImpl.java:225)
      at
org.apache.xerces.jaxp.validation.DOMValidatorHelper.setupEntityMap(Unknown
Source)
      at
org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown
Source)
      at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown
Source)
      at javax.xml.validation.Validator.validate(Unknown Source)

Note that this works fine in Tomcat 5.5 but chokes in Websphere 6.1 so I suspect there is
a class loading issue somewhere.  What could be the problem??

Thanks,
T



       
---------------------------------
Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel and lay it on
us.
Mime
View raw message