[jboss-user] [JBoss Seam] - SessionContext injection throws NullPointerException

milli do-not-reply at jboss.com
Thu May 10 18:17:56 EDT 2007


Hi,

I have a problem injecting sessionContext in to a util class. However it works in session scoped(haven't tried other scopes) seam component.

For example:

It works here:

@Name("seamComp")
  | @Scope(SESSION)
  | public Class SeamComp
  | {
  | @In private Context sessionContext;
  | 
  | .....
  | 
  | }
But it does not work if have a util class like this: It throws NullPointerException

public Class SessionManager
  | {
  | @In private Context sessionContext;
  | 
  | .....
  | }

Or even if tried to pass sessionContext from seamComp to a SessionManager method as a parameter, it throws NullPointerException inside SessionManager. 
I also tried Contexts.getSessionContext() instead of injection and it is the same behaviour.

I can't understand why and I would appreicate any help.

Thanks a lot


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044838#4044838

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044838



More information about the jboss-user mailing list