Hello,
I am in a serious problem, i have a class that validates the XML against the schema.
When i run it on tomcat it gives no errors and it validates and give proper messages but as soon as i run the same on weblog server it gives errors and not validating it and give errors even though the XML is 100 % valid by XMLSPY.
my code spinet is as under :
public boolean performValidation(String filePath, String schemaLocation) throws SAXException, ParserConfigurationException, SAXNotRecognizedException, IOException {
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);
spf.setValidating(true);
spf.setFeature(" true);
spf.setFeature(" true);
spf.setFeature(" true);
spf.setFeature(" true);
javax.xml.parsers.SAXParser sp = spf.newSAXParser();
sp.setProperty(" "sp.setProperty(" schemaLocation);
org.xml.sax.XMLReader xmlReader;
//Create XMLReader
xmlReader = sp.getXMLReader();
//xmlReader.setEntityResolver(new SchemaLoader());
ContentHandler cHandler = new XMLHandler();
XMLHandler eHandler = new XMLHandler();
xmlReader.setContentHandler(cHandler);
xmlReader.setErrorHandler(eHandler);
xmlReader.parse(filePath);
DfLogger.debug(this, "# of schema validation errors = " + eHandler.getErrorCount(), null, null);
return eHandler.getValid();
}
errors occurs at (xmlReader.parse(filePath)) ... as weblogic calls it own class ..
weblogic goes into....
at weblogic.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
at weblogic.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:173)
at weblogic.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:371)
at weblogic.apache.xerces.impl.xs.XSConstraints.reportSchemaError(XSConstraints.java:316)
at weblogic.apache.xerces.impl.xs.XSConstraints.fullSchemaChecking(XSConstraints.java:446)
at weblogic.apache.xerces.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2154)
at weblogic.apache.xerces.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:706)
at weblogic.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(XMLNamespaceBinder.java:898)
at weblogic.apache.xerces.impl.XMLNamespaceBinder.endElement(XMLNamespaceBinder.java:644)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1008)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1469)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:329)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
at weblogic.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1175)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:152)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:164)
why its going in his own XMLReader and not using my specified jar.. ??
I created a endorsed directory in weblogic and put all the required jars into it but still its not picking up my jars.
thanks
I am in a serious problem, i have a class that validates the XML against the schema.
When i run it on tomcat it gives no errors and it validates and give proper messages but as soon as i run the same on weblog server it gives errors and not validating it and give errors even though the XML is 100 % valid by XMLSPY.
my code spinet is as under :
public boolean performValidation(String filePath, String schemaLocation) throws SAXException, ParserConfigurationException, SAXNotRecognizedException, IOException {
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);
spf.setValidating(true);
spf.setFeature(" true);
spf.setFeature(" true);
spf.setFeature(" true);
spf.setFeature(" true);
javax.xml.parsers.SAXParser sp = spf.newSAXParser();
sp.setProperty(" "sp.setProperty(" schemaLocation);
org.xml.sax.XMLReader xmlReader;
//Create XMLReader
xmlReader = sp.getXMLReader();
//xmlReader.setEntityResolver(new SchemaLoader());
ContentHandler cHandler = new XMLHandler();
XMLHandler eHandler = new XMLHandler();
xmlReader.setContentHandler(cHandler);
xmlReader.setErrorHandler(eHandler);
xmlReader.parse(filePath);
DfLogger.debug(this, "# of schema validation errors = " + eHandler.getErrorCount(), null, null);
return eHandler.getValid();
}
errors occurs at (xmlReader.parse(filePath)) ... as weblogic calls it own class ..
weblogic goes into....
at weblogic.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
at weblogic.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:173)
at weblogic.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:371)
at weblogic.apache.xerces.impl.xs.XSConstraints.reportSchemaError(XSConstraints.java:316)
at weblogic.apache.xerces.impl.xs.XSConstraints.fullSchemaChecking(XSConstraints.java:446)
at weblogic.apache.xerces.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2154)
at weblogic.apache.xerces.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:706)
at weblogic.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(XMLNamespaceBinder.java:898)
at weblogic.apache.xerces.impl.XMLNamespaceBinder.endElement(XMLNamespaceBinder.java:644)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1008)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1469)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:329)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
at weblogic.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1175)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:152)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:164)
why its going in his own XMLReader and not using my specified jar.. ??
I created a endorsed directory in weblogic and put all the required jars into it but still its not picking up my jars.
thanks