jQuery in Action, 2nd edition*
The moose likes EJB and other Java EE Technologies and the fly likes ClassLoader with EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "ClassLoader with EJB" Watch "ClassLoader with EJB" New topic
Author

ClassLoader with EJB

Russ Ray
Ranch Hand

Joined: Feb 11, 2003
Posts: 52
I am using an XML and XSLT file to map/transform METADATA within an EJB. What I want to do is prevent the overkill of creating a web/database application just so I can access and read in my xml and xslt files into the EJB. My initial thought is to store the information under the META-INF directory for the ejb and access it some how.
I have tried the following:
this.getClass().getClassLoader().getResource("file:///META-INF/xml/NewTOInfo.xml");
This class is a utility class called by the MDB. This does not work and it returns a null;
Can someone with a little more experience than I explain how I can go about doing this?
Thanks in advance.....
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

Remove the file protocol.
[ September 24, 2003: Message edited by: Pradeep Bhat ]

Groovy
Russ Ray
Ranch Hand

Joined: Feb 11, 2003
Posts: 52
Thank you VERY much! That got me started! Administrator, you may close this topic!
Russ
[ September 24, 2003: Message edited by: Russ Ray ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ClassLoader with EJB
 
Similar Threads
Deployment Problem ???
Reading resource file
ERROR
Location to place the xml file inside the .ear for JAXBinding?
XSLT Ant Task