1 Reply Latest reply on Sep 19, 2003 8:11 AM by iwan_eising

    ClassLoaders / Castor Mapping Files

    elliottm Newbie

      Hello all,

      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");
      map.loadMapping(u);
      m.setMapping(map);

      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!

      -- Marc