-
Bug
-
Resolution: Done
-
Major
-
2.1.1.Final
-
None
When injecting an @ApplicationScoped bean, which extends a class that does not have a no-arg constructor, the following NPE occurs:
Caused by: java.lang.NullPointerException at org.jboss.weld.bean.proxy.ClientProxyProvider.getClientProxy(ClientProxyProvider.java:214) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:727) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:789) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:92) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:358) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:369) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:72) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:60) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.injection.producer.DefaultInjector$1.proceed(DefaultInjector.java:66) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:64) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:90) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:150) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:94) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:78) [weld-core-impl-2.1.1.Final.jar:2013-12-03 09:59] at nl.topicus.digdag.rest.integration.RemoteClientBuilder$Proxy$_$$_WeldClientProxy.createTopicusClient(Unknown Source) [classes:] at nl.topicus.digdag.rest.RemoteAuthenticationRESTService.getRemoteAuthentication(RemoteAuthenticationRESTService.java:223) [classes:]
Debugging the code in ClientProxyProvider.getClientProxy reveals that this caused by the following problem (in Proxies.getUnproxyableTypesExceptionInt):
org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001435: Normal scoped bean class org.openid4java.consumer.AbstractNonceVerifier is not proxyable because it has no no-args constructor - Managed Bean [class nl.topicus.digdag.rest.integration.CachedNonceVerifier] with qualifiers [@Any @Default].
CachedNonceVerifier extends AbstractNonceVerifier. CachedNonceVerifier does have a no-arg constructor, AbstractNonceVerifier does not, but I do not see why it would need it as CachedNonceVerifier is the type that is proxied.
- is duplicated by
-
WELD-1708 (1.1) Proxy creation fails when a superclass does not have a no-arg constructor
- Resolved