Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 6th, 2003, 03:08 PM
Registered User
 
Join Date: Oct 2003
Location: Boston, MA, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to leojhartiv Send a message via MSN to leojhartiv Send a message via Yahoo to leojhartiv
Default Read XML Config File From Within EJB JAR

Hello,

I have an EJB JAR, erptsecejb.jar. Within that jar is a class, MyClass which needs to read an XML file also contained within that same JAR. Here is what the paths within the EJB JAR may look like:

com/foo/bar/config/ConfigFile.xml
com/foo/bar/other/MyClass.class

I've tried doing the following:

URL mUrl = MyClass.class.getClassLoader().getResource("com/foo/bar/config/ConfigFile.xml");

URL mUrl = MyClass.class.getClassLoader().getResource("com.fo o.bar.config.ConfigFile.xml");

URL mUrl = MyClass.class.getClassLoader().getResource("Config File.xml");


I also tried added the following to the Manifest file:
Class-Path: com/foo/bar/config

No matter what I do, the class can't find this file. When I perform a mUrl.getPath(), I get a null-pointer exception.

Any suggestions?


Thanks,
Leo Hart
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read XSL from jar present in applications l Archana144 Spring 1 March 21st, 2008 06:49 AM
Reading xml file which is in a JAR file pradheepayyanar J2EE 2 December 26th, 2007 05:52 AM
Read xml file Nehru C# 0 October 8th, 2007 04:40 AM
xml file read data from servlet kotaiah J2EE 0 October 15th, 2006 06:37 AM
DTS Package, XML task. Read XML file and store it Victoria SQL Server DTS 0 July 24th, 2006 02:43 PM



All times are GMT -4. The time now is 08:51 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.