You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Juergen Donnerstag (JIRA)" <ji...@apache.org> on 2007/12/02 10:08:43 UTC

[jira] Resolved: (WICKET-1162) Use non-default namingPolicy when creating Proxies via CGLib

     [ https://issues.apache.org/jira/browse/WICKET-1162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juergen Donnerstag resolved WICKET-1162.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.0-rc2
         Assignee: Juergen Donnerstag

thanks

> Use non-default namingPolicy when creating Proxies via CGLib
> ------------------------------------------------------------
>
>                 Key: WICKET-1162
>                 URL: https://issues.apache.org/jira/browse/WICKET-1162
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-guice
>    Affects Versions: 1.3.0-rc1
>         Environment: Guice 1.0,
>            Reporter: uwe schaefer
>            Assignee: Juergen Donnerstag
>             Fix For: 1.3.0-rc2
>
>
> As soon, as i use bindInterceptor(...) to an Instance, i run into a problem injecting this (CGLib enhanced) instance to a Component.
> The exception thrown: 
> java.lang.LinkageError: loader (instance of  org/mortbay/jetty/webapp/WebAppClassLoader): attempted  duplicate class definition for name: "org/codesmell/jpadao/AbstractEntityDao$$FastClassByCGLIB$$aaf4cf30"
>      at java.lang.ClassLoader.defineClass1(Native Method)
>      at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>      at java.lang.reflect.Method.invoke(Method.java:597)
>      at com.google.inject.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
>      at com.google.inject.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
>      at com.google.inject.cglib.reflect.FastClass$Generator.create(FastClass.java:64)
>      at com.google.inject.cglib.proxy.MethodProxy.helper(MethodProxy.java:92)
>      at com.google.inject.cglib.proxy.MethodProxy.init(MethodProxy.java:56)
>      at com.google.inject.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:186)
>      at com.google.inject.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:66)
> I assume the problem should disappear, if LazyInitProxyFactory.createProxy(...) was patched like:
> [...]
> 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(SOME_WICKET_SPECIFIC_NAMING_POLICY); // <- single new line
> return e.create();
> [...]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.