For your websphere environment

check the version of axiom jar 
(assume axiom-api-1.1.1.jar)

check the version of Xerces
(assume version 2.8.0 xercesImpl.jar)

in either case I would copy the 2 good jars to your webspere deployment library 
folder

HTH
M--

  ----- Original Message ----- 
  From: Jack Sprat 
  To: axis-user@ws.apache.org 
  Sent: Monday, September 24, 2007 12:53 PM
  Subject: [Axis2] schema validation exception


  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     
 atorg.apache.axiom.om.impl.dom.DocumentImpl.getDoctype(DocumentImpl.java:225)  
    
atorg.apache.xerces.jaxp.validation.DOMValidatorHelper.setupEntityMap(UnknownSource)
      
atorg.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(UnknownSource)  
    at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(UnknownSource)  
    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. 

Reply via email to