[jboss-user] [EJB 3.0] - Re: Simple injection of SessionContext not working
jaikiran
do-not-reply at jboss.com
Tue Jul 25 06:58:29 EDT 2006
Downloaded the source code of JBoss-4.0.4 GCA and after debugging found that the culprit was the following statement in ResourceHandler.java of JBoss:
Line number: 283
if (!ref.type().equals(Object.class))
ref.type() returns null and the subsequent call to equals method throws a NullpointerException.
Surprisingly, this is a very simple injection and i have seen this type of injection being used in the EJB3 Trail.
I even tried moving the annotation to method level:
@Resource
| public void setSessionContext(SessionContext sessionCtx) {
| System.out.println("Setting the session context: " + sessionCtx);
| this.sessionContext = sessionCtx;
| }
Even in this case i get the NullPointerException. This time at:
anonymous wrote : java.lang.NullPointerException
| at org.jboss.ejb3.injection.ResourceHandler.loadMethodInjectors(ResourceHandler.java:183)
The reason is the same as mentioned above, this time in the loadMethodInjectors method.
Am i doing something wrong? Cant believe that this simple injection fails.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960634#3960634
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960634
More information about the jboss-user
mailing list