Hi all,

I believe I've found the root cause of the issue previously reported issue 
(long ago) which may not have ever turned into a 'bug':

http://apache-wicket.1842946.n4.nabble.com/java-lang-NoClassDefFoundError-with-wicket-proxy-ILazyInitProxy-in-Weblogic-9-2-td1921937.html

I too, am experiencing the same issue, on JBoss AS 7.2 (pre wildfly build).

We have an .ear containing an ejb-jar (with @LocalBean annotated no-interface 
ejbs) which we're trying to inject into our Wicket application, packaged in a 
separate .war file in the same .ear.

In the jboss container we have subdeployment isolation turned off.

When stepping through the code with a debugger, I get to the point where wicket 
is trying to create a CGLib proxy class to the non-final EJB class, and then 
things head south.

Here's a quick link to the code in question.
https://fisheye6.atlassian.com/browse/~raw,r=8d774aead8626981c56fa957a0169f115ba9eb36/wicket-git/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java

On line 175, the Enhancer is initially created and inherits the thread's 
contextClassLoader, which is the class loader for the .war module of our 
deployment package. This is fine, this classLoader has access to the 
ILazyInitProxy.class, the IWriteReplace.class, and (obviously) Serializable.
On line 178, when the superclass is set on the Enhancer, the Enhancer's 
classLoader changes to that of type.getClassLoader(). In our case, this the 
module class loader for the type.class -- or, our ejb-jar class loader, which 
does -not- have access to the the wicket .jars containing ILazyInitProxy.

When we get to line 190, things fail, with the underlying exception being 
ClassNotFound for ILazyInitProxy

This is kind of a problem. Sure, we could extract local interfaces for our 
EJBs, but it seems like the real problem here is that Wicket doesn't realize it 
may be in a multi-module deployment.

At this point, I'm leaning toward building a custom JavaEEComponentInjector 
which uses a custom AnnotJavaEEInjector, which uses a custom 
JavaEEProxyFieldValueFactory just so that I can redirect the invocations of 
LazyInitProxyFactory.createProxy() to a different method to experiment with 
this without having to rebuild all of wicket.

Thoughts?

Regards,
-Bryan Varner

Reply via email to