Hi,
The peice of code that i want to discuss, parses a custom XML using SAXParser. The main class contains following code:
SAXParserFactory parserFactory = SAXParserFactory.newInstance();
parserFactory.setValidating(false);
SAXParser parser=parserFactory.newSAXParser();
XMLReader reader = parser.getXMLReader();
reader.setEntityResolver(new CustomEntityResolver());
reader.setContentHandler(new MyContentHandler());
InputSource is = new InputSource(this.getClass().getResourceAsStream("my.xml"));
reader.parse(is);
The class CustomEntityResolver implements org.xml.sax.EntityResolver and gives definition for method
public InputSource resolveEntity(
String publicId, String systemId) throws SAXException, IOException {
InputStream iStream = this.getClass().getResourceAsStream(systemId);
InputSource iSource = new InputSource(is);
return iSource;
}
and my.xml starts with
<? xml ver...?>
<!DOCTYPE SYSTEM "shivey.dtd">
the ARGUMENT systemId returned while executing application on weblogic as "shivey.dtd"-- as defined in XML, BUT when the same application is is executed on
JBOSS 4.0.2, the value for systemId comes as "file:///c:/JBOSS_HOME/bin/shivey.dtd" and hence I GET A MALFormedURL exception.
Observation: The iStream object created on Weblogic is of java.io.BufferedStream, but same object is of type sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream on Jboss.
I appreciate any help in advance.
Thanks,
Shivey Upadhyay