java webstart - how to read xml from jar

By: ernest du plessis - linksar
java webstart - how to read xml from jar
2003-03-20 01:12
I read a xml file into my java application.With the following line:

JasperCompileManager.compileReportToFile("xmlfile.xml");

The problem is when the class file and xml is complied to a jar.The application can not find the xml file.

Is there another way to read this xml file when it is in a jar?






By: Suraj Amin - suraj_amin
RE: java webstart - how to read xml from jar
2003-03-20 04:27
Hi there,

You could use the following to complile:
JasperReport jasperReport = JasperCompileManager.compileReport( this.getClass().getResourceAsStream("xmlfile.xml"));

--
Regards,
Suraj Amin

Homepage: http://www.geocities.com/suraj_amin/

/* May the source be with you */
2006 IR Open Discussion's picture
Joined: Aug 10 2006 - 3:29am
Last seen: 16 years 9 months ago

1 Answer:

I tried your suggestions, but it gives me
java.lang.NullPointerExceptions.


Tom
bztom34's picture
14
Joined: Mar 5 2007 - 9:20am
Last seen: 16 years 2 months ago
Feedback