2006 IR Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 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 */ Link to comment Share on other sites More sharing options...
bztom34 Posted March 8, 2007 Share Posted March 8, 2007 I tried your suggestions, but it gives mejava.lang.NullPointerExceptions. Tom Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now