Looks like the real issue you're asking is "How do I access the ClassLoader for a given XML file?"
This would enable you to do cl.getResourceAsStream("whatever.xml");
However, the JEE spec leaves room for vendors to plug in their own custom classloading strategies to enable features such as hot deployment. So you've got no hook to access the CL you need.
Since classes are linked to the CL that defined them, you might try packaging your XML in an EJB JAR, and then attempting to get to it by saying something like:
...but this would assume that the same CL was used for all resources in your EJB JAR.
I think a better question to ask is: what are you doing that requires you to access something packaged in your application's deployable units? Surely there's a more elegant way for you to get at this configuration?
Thanks for the reply. What I am attempting to do is get a few small pieces of information to a MDB packaged in an ear file. This information is bootstrap for the application and therefore needs to be given someone prior to deployment.
I have packaged the XML in the .ear file however this has not solved the problem. Is there a better way to approach this?
I attempted to configure using the deployment descriptor xml as you would do it with a .sar however this did not seem to work.
Am I going about this the wrong way?