Open oleksii-sl opened 10 years ago
I finally have found reason of such behavior.
The code in WL do the following:
getClass().getClassLoader().loadClass(configFile).newInstance()
newInstance method throws only
java.lang.Class#newInstance throws InstantiationException, IllegalAccessException
It does not throw
IllegalArgumentException, InvocationTargetException
as java.lang.reflect.Constructor#newInstance
does, it throws exception which occurred not wrapped with InvocationTargetException
Apparently on client side we don't expect InvocationTargetException and it's not handled.
I've added following into org.springsource.loaded.ri.ReflectiveInterceptor#jlrConstructorNewInstance
Line 1002:
try {
return c.newInstance(params);
} catch (InvocationTargetException e) {
throw (RuntimeException)e.getCause();
}
Instead of just return c.newInstance(params);
and the error missed.
After all I got another error, but I hope it's because of dev build ( I donwloaded master branch and applied fix of above issue ).
Caused By: java.lang.NullPointerException
at org.springsource.loaded.ri.ReflectiveInterceptor.fixModifier(ReflectiveInterceptor.java:420)
at org.springsource.loaded.ri.ReflectiveInterceptor.fixModifiers(ReflectiveInterceptor.java:415)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlClassGetDeclaredFields(ReflectiveInterceptor.java:1605)
at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.getFields(BaseJ2eeAnnotationProcessor.java:1024)
at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.getFields(BaseJ2eeAnnotationProcessor.java:1017)
Hello,
I see that not all classes are preprocessed and in such case I see something like:
Also I see that WL classes are preprocessed and as a consequence of (invalid?) processing I get following error:
Is it possible to introduce property for filtering of classes? (e.g. if I put com.customcode.* - only packages with such prefix will be processed by spring loaded)
////Update Now I see that it's possible ( I checked the code ), but it should be documented I guess. I've applied filter and server starts much faster, but the error still reproduces. Weblogic version is 10.3.3, java version is 1.6, OS linux 64 bit. If I remove spring-loaded agent - everything is fine.
Update I turned on debug mode on internal jvm class: com.sun.security.auth.login.ConfigFile using -Djava.security.debug=all option And restarted server with and without spring-loaded agent. On the line where usually error occured with agent I see following:
With turned on agent I see following debug lines from jvm class and same stacktrace following as above: