quality@glassfish.java.net

Re: CDI failing to create EJBs with Security Manager eanabled

From: Sherry Shen <Sherry.Shen_at_Sun.COM>
Date: Mon, 01 Mar 2010 10:43:55 -0800

Hi Felipe,

Will the workaround in this Glassfish issue help you to move forward?
https://glassfish.dev.java.net/issues/show_bug.cgi?id=8972

+grant codeBase "file:${com.sun.aas.instanceRoot}/applications/numberguess/-" {
+ permission java.lang.reflect.ReflectPermission "suppressAccessChecks";

I saw the JBoss issue for root cause is still open.
https://jira.jboss.org/jira/browse/WELD-32

Thanks for your feedback!

Sherry

Felipe Gaścho wrote, On 2/27/2010 1:59 AM:

>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)
>
>
>
>
>
>