You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "felix.rilling@cryptshare.com (Jira)" <ji...@apache.org> on 2021/09/30 11:54:00 UTC

[jira] [Created] (WICKET-6923) Package Private Spring Beans cannot be injected since Wicket 9.5

felix.rilling@cryptshare.com created WICKET-6923:
----------------------------------------------------

             Summary: Package Private Spring Beans cannot be injected since Wicket 9.5
                 Key: WICKET-6923
                 URL: https://issues.apache.org/jira/browse/WICKET-6923
             Project: Wicket
          Issue Type: Bug
          Components: wicket-ioc, wicket-spring
    Affects Versions: 9.5.0
         Environment: JDK 11.0.12, Jetty 9.4.43.v20210629
            Reporter: felix.rilling@cryptshare.com


In Wicket 9.4.0 using wicket-spring, it is possible to use @SpringBean in a webpage to inject a spring component whose constructor is package private.

Starting with wicket 9.5.0, the following error is thrown:
{code:java}
[...]
Caused by: java.lang.reflect.InvocationTargetException: null
	at java.base/jdk.internal.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:459)
	at net.sf.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:339)
	... 102 common frames omitted
Caused by: java.lang.IllegalAccessError: [...].Wicket_Proxy_SomeComponent$$EnhancerByCGLIB$$8d29d168 cannot access its superclass [...].SomeComponent ([...].Wicket_Proxy_SomeComponent$$EnhancerByCGLIB$$8d29d168 is in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @10aabada;[...].SomeComponent is in unnamed module of loader 'app')
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	... 107 common frames omitted
{code}
 changing the component constructor to public works.

Possibly introduced by WICKET-6913, this seems to be a restriction with ByteBuddy (https://stackoverflow.com/questions/34756496/interceptor-class-visibility-in-byte-buddy)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)