Hi All,

I have fixed this. 

Just made the method an instance method from static method and used.

InputStream fi =
this.getClass().getClassLoader().getResourceAsStream(xmlFile) ;

Then, I removed the DOCTYPE from the XML File and it works.

-Saroj

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Saroj Kumar
Sent: Saturday, August 31, 2002 12:30 AM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] How to read an XML in JAR File


Hi All,

I have got a XML which defines some constants which are read by my
Session Bean while serving some requests. Reading is done in a helper
class. I am unable to read this XML file.

I use :

    
     InputStream fi = ClassLoader.getSystemResourceAsStream(xmlFile) ;

        I am getting fi as NULL.
     
     InputStreamReader isr = new InputStreamReader(fi);
     
     
     InputSource is = new InputSource(isr);
     
     
     DOMParser parser = new DOMParser();
     
     parser.parse(is)

Any help would be great;

SAROJ



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to