Title: Message
Hi Edward,
 
I am having my xml in jar and need to read this once the bean is invoked in a DOM Tree.
 
Code is :
 
     InputStream fi = this.getClass().getClassLoader().getResourceAsStream(xmlFile) ; // xmlfile is name of file
     
     
     InputStreamReader isr = new InputStreamReader(fi);
            
     InputSource is = new InputSource(isr);
     
     DOMParser parser = new DOMParser();
      //  Parse the Document
      //  and traverse the DOM
      try {
 
         parser.parse(is);
 
    }
catch(Exception e)
{
}

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of ed banfa
Sent: Saturday, August 31, 2002 4:09 PM
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] How to read an XML in JAR File

hello,

could you pls tell me more about your xml file like its location and any more info , I would be very grateful , I am working on something similar too,

thanks in advance

Edward.

 Saroj Kumar <[EMAIL PROTECTED]>wrote:

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 getti! ng 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



Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes

Reply via email to