I have this class to produces some Java EE resources. My project is a EAR with EJB and CDI.
public class Resources {
@Dependent
@Produces
@Resource(mappedName = "java:comp/EJBContext")
protected SessionContext sessionContext;
}
And it's works fine in JBoss AS 7. But when I use Wildfly (beta1 compiled from github today), I'm getting this exception.
Caused by: org.jboss.weld.exceptions.NullInstanceException: WELD-000044: Unable to obtain instance from null
What's wrong? How I can produces SessionContext using Wildfly? There is a different way in Wildfly, or it's a bug (since Wildfly are not ready for production yet)?
Update Using the last version of Wildfly compiled from Github, this code works fine. I think that it was a expected bug, since Wildfly is beta. Thank you guys.