Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5850

LazyInitProxyFactory causes NoClassDefFound org/apache/wicket/proxy/ILazyInitProxy in case of multimodule deployment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.18.0, 6.19.0
    • 6.20.0, 7.0.0-M6
    • None
    • None
    • Windows 7 Pro x64, Oracle JDK 7u45 x64, Glassfish 3 (EE6)

    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.

      Attachments

        Activity

          People

            svenmeier Sven Meier
            amorozov Alexander Morozov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: