Hi all,
I'm having a serious problem with
j2ee Classloading.
I have "inherited" a J2EE application where all business classes (invoked by the EJB) are placed in the Application's Server classpath (Weblogic 8.1.4).
Very bad because every time a class is changed the a.s. must be restarted.
So I re-enginereed the package putting the business classes in a jar that is referenced by the EJB's MANIFEST file.
This way all the classes would be loaded by the EJB classloader and no need to start/stop weblogic.
Unfortunately it's not such !! I discovered that all business classes are loaded via REFLECTION
and the application server cannot find them using the standard J2EE Classloader mechanism.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at irma.business.Dispatcher.callService(Dispatcher.java:70)
..............
Caused by: java.lang.NoClassDefFoundError: irma/utility/log/LogPrintStream
at irma.business.service.LoginService.login(LoginService.java:79)
On the other hand they're found if I put the classes on the application server classpath.
Has anybody got advice for this ? Should I refactor the application giving up reflection ?
Thanks a lot in advance.