[weld-issues] [JBoss JIRA] Commented: (WELD-870) Add injection point information to exception message when injection into observer fails
de lu (JIRA)
jira-events at lists.jboss.org
Mon Apr 18 12:03:33 EDT 2011
[ https://issues.jboss.org/browse/WELD-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596242#comment-12596242 ]
de lu commented on WELD-870:
----------------------------
I also met this problem in my example.
bellow configuration:
<security:IdentityImpl>
<s:modifies/>
<security:authenticatorClass>com.lude.security.domain.AutheticatorImpl</security:authenticatorClass>
</security:IdentityImpl>
<plidm:JpaIdentityStoreConfiguration>
<s:replaces/>
<plidm:identityClass>com.lude.security.domain.Identity</plidm:identityClass>
<plidm:credentialClass>com.lude.security.domain.IdentityCredential</plidm:credentialClass>
<plidm:relationshipClass>com.lude.security.domain.IdentityRelationship</plidm:relationshipClass>
<plidm:roleTypeClass>com.lude.security.domain.IdentityRoleType</plidm:roleTypeClass>
<plidm:attributeClass>com.lude.security.domain.IdentityAttribute</plidm:attributeClass>
</plidm:JpaIdentityStoreConfiguration>
java code:
public class AutheticatorImpl extends BaseAuthenticator implements Authenticator
{
@Inject
IdentitySession identitySession;
@Inject
Credentials credentials;
@Inject
Identity identity;
when i use identitySession in authenticate method, it will be throws NPE:
00:00:41,062 ERROR [org.jboss.seam.security.IdentityImpl] Login failed: java.lang.RuntimeException: java.lang.NullPointerException
.............
Caused by: java.lang.NullPointerException
at org.picketlink.idm.impl.api.session.IdentitySessionImpl.<init>(IdentitySessionImpl.java:138) [:1.5.0.Alpha02]
at org.picketlink.idm.impl.api.IdentitySessionFactoryImpl.createIdentitySession(IdentitySessionFactoryImpl.java:114) [:1.5.0.Alpha02]
at org.jboss.seam.security.management.picketlink.IdentitySessionProducer.createIdentitySession(IdentitySessionProducer.java:136) [:3.0.0.Final
]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_18]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_18]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_18]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_18]
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305) [:6.0.0.Final]
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54) [:6.0.0.Final]
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163) [:6.0.0.Final]
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299) [:6.0.0.Final]
at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188) [:6.0.0.Final]
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:169) [:6.0.0.Final]
at org.jboss.weld.bean.ProducerMethod$1.produce(ProducerMethod.java:149) [:6.0.0.Final]
at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:361) [:6.0.0.Final]
at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:121) [:6.0.0.Final]
at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99) [:6.0.0.Final]
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:124) [:6.0.0.Final]
at org.jboss.weld.proxies.org$jboss$weld$beanProducerMethod-org$jboss$seam$security$management$picketlink$IdentitySessionProducermethod_create
IdentitySession()_$$_WeldClientProxy.getRealmName(org$jboss$weld$beanProducerMethod-org$jboss$seam$security$management$picketlink$IdentitySessionProdu
cermethod_createIdentitySession()_$$_WeldClientProxy.java)
at com.lude.security.domain.AutheticatorImpl.authenticate(AutheticatorImpl.java:66) [:]
at com.lude.security.domain.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$D:$Seam3$jboss6$server$default$deploy$myseam-1$0$0-SNAPSHOT$war"-
ManagedBean-class_com$lude$security$domain$AutheticatorImpl_$$_WeldClientProxy.authenticate(org$jboss$weld$bean-jboss$classloader:id="vfs:$$$D:$Seam3$
jboss6$server$default$deploy$myseam-1$0$0-SNAPSHOT$war"-ManagedBean-class_com$lude$security$domain$AutheticatorImpl_$$_WeldClientProxy.java)
at org.jboss.seam.security.IdentityImpl.authenticate(IdentityImpl.java:305) [:3.0.0.Final]
... 43 more
> Add injection point information to exception message when injection into observer fails
> ---------------------------------------------------------------------------------------
>
> Key: WELD-870
> URL: https://issues.jboss.org/browse/WELD-870
> Project: Weld
> Issue Type: Enhancement
> Components: Events
> Affects Versions: 1.1.0.Final
> Reporter: Dan Allen
> Assignee: Ales Justin
>
> Injections that fail when an observer method is invoked are massively hard to track down. Here's the information you get:
> org.jboss.weld.exceptions.IllegalArgumentException: WELD-001324 Argument bean must not be null
> at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:714)
> at org.jboss.seam.exception.control.HandlerMethodImpl.notify(HandlerMethodImpl.java:187)
> at org.jboss.seam.exception.control.ExceptionHandlerDispatch.executeHandlers(ExceptionHandlerDispatch.java:128)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:616)
> at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
> at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
> at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
> at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
> at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
> at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
> at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
> at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:270)
> at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
> at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:222)
> at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:632)
> at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:619)
> at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:613)
> I expect to see the type and qualifiers at the failing injection point.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the weld-issues
mailing list