I wanted to follow up and explain how I resolved this problem.

First, because I was using code I had written using Jonas, there were
EJB-1.0 coding styles in the code (namely the code to get the InitialContext
and the bean's Home) that had to be updated. I fixed the call to get the
InitialContext, added <ejb-ref> elements to application-client.xml to define
the environment properties I needed to get the bean Homes, and changed the way
that I called the initialContext.lookup() to use the ejb-ref property names.

Second, I had a statement in the code to set the security manager to an rmi
manager, apparently because Jonas required this for their Java 1.1 support:

   System.setSecurityManager( new java.rmi.RMISecurityManager() );

Of course, that statement ultimately ended up being the reason for the access
denied errors I was seeing. The minute I removed that line, the access denied
errors disappeared.

It all works now.

tim.

> After some serious trial and error to get the Orion server up and running
> with an existing set of EJB code, I have finally succeeded in getting my
> Entity Bean auto-deployed and the server now seems happy.
> 
> So, being naive, I simply grabbed a TestSuite.java client program to try
> and test the new EntityBean. The program is dying on this line:
> 
>    InitialContext iCtx = new InitialContext( env );
> 
> Where env is setup as follows:
> 
>       Properties env = new Properties();
>       env.put( Context.SECURITY_PRINCIPAL, "admin" );
>       env.put( Context.SECURITY_CREDENTIALS, "123" );
>       env.put( Context.INITIAL_CONTEXT_FACTORY,
>               "com.evermind.server.ApplicationClientInitialContextFactory" );
>       env.put( Context.PROVIDER_URL, "ormi://localhost/sequence" );
> 
> 
> Now, when I run my client, I get the following stack trace:
> 
>       java.security.AccessControlException: access denied
>       java.security.AccessControlContext.checkPermission:
>       java.security.AccessController.checkPermission:
>       java.lang.SecurityManager.checkPermission:
>       java.lang.SecurityManager.checkPropertyAccess:
>       java.lang.System.getProperty:
>       com.evermind.server.XMLConfiG:
>       com.evermind.server.ServerComponent:
>       com.evermind.server.deployment.ApplicationClientArchive:
>       com.evermind.server.ApplicationClientInitialContextFactory:
>       javax.naming.spi.NamingManager.getInitialContext:
>       javax.naming.InitialContext.getDefaultInitCtx:
>       javax.naming.InitialContext.<init>:
>       mhi.ejb.seq.TestSuite.getInitialContext:
> 
> Where mhi.ejb.seq.TestSuite.getInitialContext() contains the line of code
> above that instantiates the InitialContext.
> 
> The "admin" def in $ORION/principals.xml is activated.
> 
> Thank you,
> 
> tim.
> 


Reply via email to