Hi,

Thanks for posting. I'm not sure what's going on here. Sounds like a general
issue rather than anything specific to the Tomcat integration.

I'll give your sample a try this afternoon and let you know what I find.

Jon
On 15 Jun 2011 15:04, "mclu" <[email protected]> wrote:
> I have already postet to users list but now I thing its a general problem.
>
> If you read my other post ignore the tomcat embedded stuff.
>
> I have a main class that starts openejb via LocalInitialContextFactory and
> looks up a local bean.
>
> Properties properties = new Properties();
> properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> "org.apache.openejb.client.LocalInitialContextFactory");
> properties.setProperty("openejb.configuration",
> openejbBaseDir+"\\conf\\openejb.xml");
> properties.setProperty("openejb.home", openejbBaseDir);
> InitialContext localContext = new InitialContext(properties);
>
> UserService test2 = (UserService)
> localContext.lookup("UserServiceBeanLocal");
>
>
> If I start this class with:
> java OpenEJBStarter it works.
>
> If I add a java.security file (policy.all) with:
> grant {
> permission java.security.AllPermission;
> };
>
> and starts with
> java -Djava.security.manager
-Djava.security.policy="E:\pointTo\policy.all"
> -Djava.security.debug=access,failure OpenEJBStarter
>
> I get a PermissionException. Check out the security.debug output:
> access: access allowed (javax.security.jacc.EJBMethodPermission
> UserServiceBean create,LocalHome,)
> access: access denied (java.lang.RuntimePermission setContextClassLoader)
> java.lang.Exception: Stack trace
> at java.lang.Thread.dumpStack(Thread.java:1206)
> at
>
java.security.AccessControlContext.checkPermission(AccessControlContext.java:313)
> at
> java.security.AccessController.checkPermission(AccessController.java:546)
> at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> at java.lang.Thread.setContextClassLoader(Thread.java:1351)
> at org.apache.openejb.core.ThreadContext.exit(ThreadContext.java:70)
> at
>
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:186)
> at
>
org.apache.openejb.core.ivm.EjbHomeProxyHandler.create(EjbHomeProxyHandler.java:284)
> at
>
org.apache.openejb.core.ivm.EjbHomeProxyHandler._invoke(EjbHomeProxyHandler.java:169)
> at
>
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:282)
> at $Proxy21.create(Unknown Source)
> at
>
org.apache.openejb.core.ivm.naming.BusinessLocalReference.getObject(BusinessLocalReference.java:33)
> at
> org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:171)
> at
>
org.apache.openejb.core.ivm.naming.ContextWrapper.lookup(ContextWrapper.java:115)
> at javax.naming.InitialContext.lookup(InitialContext.java:392)
> at com.nedap.openejb.OpenEJBStarter.startIt(OpenEJBStarter.java:73)
> at com.nedap.openejb.OpenEJBStarter.main(OpenEJBStarter.java:32)
>
>
> What is wrong here? Or is it a bug?
>
>
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/java-lang-RuntimePermission-setContextClassLoader-if-using-java-security-tp3599454p3599454.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Reply via email to