tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paolo Spadafora" <>
Subject R: Cannot instantiate class: org.openejb.client.LocalInitialContextFactory
Date Fri, 13 Feb 2009 16:54:08 GMT
I think you have to set java permission on applet side. Probably need to
sign the applet.
Also, when doing a remote lookup you need to obtain the remote interface
(QdbBeanRemote), not the local.


-----Messaggio originale-----
Da: mgyh [] 
Inviato: venerdì 13 febbraio 2009 17.27
Oggetto: Re: Cannot instantiate class:

Your suggestions did get me past my initial problem.  I guess that I did not
realize that the applet was running in a separate VM.  I don't think that I
completely understand that.  I'll do some reading on the side to get a
better grasp of this.

However, once I made these changes, I get an AccessControlException as
follows: access denied
(java.util.PropertyPermission /QdbBeanLocal read)

could you offer suggestions to get past this?  QdbBeanLocal is my JNDI name
for my bean, which is located successfully from jsp.  I have tried the
following unsuccessfully:
1) I tried the JNDI name QdbBeanRemote also
2) I added the following permissions to Tomcat's catalina.policy file
    permission  org.apache.naming.JndiPermission 
"jndi://localhost/QdbBean", "read";
    permission  org.apache.naming.JndiPermission 
"jndi://localhost/QdbBeanLocal", "read";
    permission  org.apache.naming.JndiPermission 
"jndi://localhost/QdbBeanRemote", "read";
3) restarted Tomcat

no luck. I am not particularly good at understanding security policy.  What
am I missing?

KMalhi wrote:
> Hi,
> Here is what you would need to do to make it work. Firstly, you would need
> to add the following jars in the root directory of your webapp --
> javaee-api.jar and  openejb-client.jar (you can copy these from
> <Tomcat-install>/webapps/openejb/lib ).
> Update the Applet code as shown (notice that we are not using
> LocalInitialContextFactory here)
>             Properties props = new Properties();
>             props.put(Context.PROVIDER_URL,    "
>             Context ctx = new InitialContext(props);
> Update the HTML as shown -- notice the archive attribute which has the
> comma
> separated list of jars needed by the applet (the version of jars on your
> machine might be different than mine- but that should not matter)
> <applet
>  codebase = "."
>  code     = "qdbapplets.MyApplet.class"
>  name     = "TestApplet"
>  width    = "400"
>  height   = "300"
>  hspace   = "0"
>  vspace   = "0"
>  align    = "top"
> archive="openejb-client-3.1.1-SNAPSHOT.jar,javaee-api-5.0-1.jar"
> </applet>
>> What is the
>> > difference between the successful JSP code and the unsuccessful java
>> > applet?  I did add the openejb-core-3.1.jar to my classpath, but this
>> > didn't work.  Any ideas?
> JSP is running in the same VM as openejb, hence you can use
> LocalInitialContextFactory. Applet runs in a separate VM, hence it would
> need RemoteInitialContextFactory
> In order to get more information, please refer to this page --
> -- 
> Karan Singh Malhi

View this message in context:
Sent from the OpenEJB User mailing list archive at

View raw message