I'm have a terrible time accessing my Castor mapping files ever since we started deploying EJBs in our applications.
Basically, I have a class that I would like to Marshall to XML using a Castor mapping file. I've placed the class -- part of the WebApp -- in the same package as the mapping file. When it's just the WebApp running, no problems:
ClassLoader cl = this.getClass().getClassLoader();
Mapping map = new Mapping(cl);
URL u = this.getClass().getResource("./content.xml");
But once an EJB has been instantied -- an EJB completely unrelated to the task at hand, mind you -- the URL comes back null every time.
Anyone have any suggestions? I've noted that once that EJB is instantiated that the ClassLoader is no longer the WebAppClassLoader, but the UnifiedClassLoader.
Thanks in advance!
I've got exactly the same problem. Was this solved already?