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?
What do you get for
System.out.println(Class.getClassLoader());
System.out.println(Thread.currentThread().getContextClassLoader());
I would think they are the same for something in
WEB-INF/lib in both circumstances?
Regards,
Adrian