[GLASSFISH-20761] Request scope not available in ejb @Singleton @Startup @PostConstruct Created: 14/Aug/13  Updated: 14/Aug/13

Status: Open
Project: glassfish
Component/s: None
Affects Version/s: 3.1.2.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: waloszek Assignee: michael.y.chen
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: contextnotactiveexception, postconstruct, requestscoped, singleton, startup

 Description   

When I try to inject a request scoped cdi bean into an ejb singleton startup, a ContextNotActiveException is thrown.
While I was looking for a solution I found the same (fixed) issue in the jboss issue tracker.
The following code illustrates the problem.

@RequestScoped
public class RequestScopedBean {

public void doWhatever()

{ System.out.println("did whatever"); }

}

@Startup
@Singleton
public class SingletonStartupBean {

@Inject
private RequestScopedBean requestScopedBean;

@PostConstruct
public void init()

{ requestScopedBean.doWhatever(); }

}


Generated at Mon Apr 24 13:56:55 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.