1 Reply Latest reply on Feb 16, 2003 8:03 PM by Adrian Brock

    runtime environment of .ear vs a .war

    Andy Fyfe Newbie

      I have a .war file. The framework code in WEB-INF/lib/xxx.jar reads various xml files in WEB-INF/yyy.jar, and will create beans. The classes for the beans reside in WEB-INF/classes, and are created using a very simple Class.forName(name).

      If I deploy the .war file, it all works fine.

      However, if I put the .war file into a .ear, and deploy the .ear file, then Class.forName() will throw ClassNotFoundException.

      Thread.currentThread().getContextClassLoader().loadClass(name) works.

      What are the differences to the runtime environment of a .war file if it's part of a .ear vs deployed on its own?