• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stuck in Strange Problem while migrating application from weblogic to JBoss.

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Shivey Upadhyay
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another Observation: The above code is using weblogic.xml.jaxp.RegistrySAXParserFactory in weblogic and org.apache.xerces.jaxp.SAXParserFactoryImpl in JBoss, is there any equivalent SAXParserFactory implementation supported by JBoss, that provides what is specified as SYSTEM in DOCTYPE declaration as is (i.e., without applying file:///...as prefix)?
 
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic