-
1. Re: @In gets not injected thou it exists
yilmaz_ Oct 24, 2007 4:11 AM (in response to axismundi)"private ApplicationUser" this must be interface
and "applicationUser" this must be component name @Name( "applicationUser" )
alsa you can use @In(create=true) -
2. Re: @In gets not injected thou it exists
axismundi Oct 24, 2007 4:33 AM (in response to axismundi)thanks for your input.
the component declaration surely doesn't need to be an interface.
I added @Name("applicationUser") to my ApplicationUser class, but still it is not being injected. And anyway, the component "applicationUser" IS in fact existing in the Seam session-ctx (according to Seam debug-page).
Secondly, and even more strange, the injection for applicationUser works well in another SFSB:@Stateful @Name("orderManagement") @Scope(ScopeType.SESSION) public class OrderManagementBean implements OrderManagement { @In private ApplicationUser applicationUser; <-- gets injected properly! ---------------- @Stateful @Name("shopTree") @Scope(ScopeType.SESSION) public class ShopTreeBean implements ShopTree { @In private ApplicationUser applicationUser; <-- NOT injected !
yes, both EJBs run in the same application.
By the way, the applicationUser component is put into session-ctx by the authentication class via @Out-jection. -
3. Re: @In gets not injected thou it exists
axismundi Oct 24, 2007 5:29 AM (in response to axismundi)a few debug lines before the error occurs, Seam logs
DEBUG [org.jboss.seam.Component] trying to inject with hierarchical context search: applicationUser DEBUG [org.jboss.seam.contexts.Contexts] found in session context: applicationUser
Unfortunely the message doesn't refer to the component to which it is injecting. -
4. Re: @In gets not injected thou it exists
nickarls Oct 24, 2007 5:47 AM (in response to axismundi)Could there be a non-required outjection somewhere that could overwrite it before the call?
-
5. Re: @In gets not injected thou it exists
axismundi Oct 24, 2007 6:27 AM (in response to axismundi)"nickarls" wrote:
Could there be a non-required outjection somewhere that could overwrite it before the call?
The applicationUser is @Out-jected only once, that is in the authenticator class, which has EVENT-scope and should not be called.@Name("authenticator") @Scope(ScopeType.EVENT) public class Authenticator implements Serializable { @Out(scope=ScopeType.SESSION) private ApplicationUser applicationUser;
-
6. Re: @In gets not injected thou it exists
nickarls Oct 24, 2007 6:37 AM (in response to axismundi)Can you access the correct instance with Contexts.lookupInStatefulContexts(...)?