quality@glassfish.java.net

CDI failing to create EJBs with Security Manager eanabled

From: Felipe Gaścho <fgaucho_at_gmail.com>
Date: Sat, 27 Feb 2010 10:59:19 +0100

I don't know how to silve this one, but with Security Manager enabled,
the CDI based applications failed to inject resources:

In the security.policy:

grant codeBase "file:${com.sun.aas.installRoot}/domains/domain1/applications/cejug-classifieds-ear-1.0-SNAPSHOT/-"
{
        permission java.security.AllPermission;
};



Caused by: javax.ejb.EJBException: javax.ejb.CreateException: Could
not create stateless EJB
        at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:718)
        at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:200)
        at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:443)
        ... 42 more
Caused by: javax.ejb.CreateException: Could not create stateless EJB
        at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:526)
        at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:90)
        at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:716)
        ... 44 more
Caused by: java.security.AccessControlException: access denied
(java.lang.reflect.ReflectPermission suppressAccessChecks)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)




-- 
------------------------------------------
   Felipe Gaścho
   10+ Java Programmer
   CEJUG Senior Advisor