Details
Description
In case of multimodule deployment, LazyInitProxyFactory#createProxy() ends up with NoClassDefFound error while trying to wrap a class which is being injected into a Wickets component.
CGLibInterceptor handler = new CGLibInterceptor(type, locator); Enhancer e = new Enhancer(); e.setInterfaces(new Class[] { Serializable.class, ILazyInitProxy.class, IWriteReplace.class }); e.setSuperclass(type); e.setCallback(handler); e.setNamingPolicy(new DefaultNamingPolicy() { @Override public String getClassName(final String prefix, final String source, final Object key, final Predicate names) { return super.getClassName("WICKET_" + prefix, source, key, names); } }); return e.create();
As we can see, Enhancer is not configured with an context-relative classloader. This is the root of the issue.