-
1. Re: How to access DB/session beans from applet?
jaikiran Mar 20, 2006 7:03 AM (in response to efratb)You should have the jndi.properties file in the applet's classpath. The file usually contains:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Check the %JBOSS_HOME%/server/default/conf directory for the sample jndi.properties file -
2. Re: How to access DB/session beans from applet?
efratb Mar 20, 2006 7:09 AM (in response to efratb)And where should I locate this file?
What do you mean by the applet's classpath? The path from which the applet is being invoked? (Where the html/jsp file is?)
Thanks a lot,
Efrat -
3. Re: How to access DB/session beans from applet?
jaikiran Mar 20, 2006 7:16 AM (in response to efratb)In the jsp, you might have used the applet tag. If you have specified a ARCHIVE param(something like the following):
<param name = "ARCHIVE" value = "myApplet.jar" />
Then, the jndi.properties should be placed directly under the myApplet.jar package.
If you havent used the ARCHIVE parameter, then the jndi.properties needs to be placed in the directory which contains the applet -
4. Re: How to access DB/session beans from applet?
efratb Mar 20, 2006 7:24 AM (in response to efratb)Yes, I'm using the ARCHIVE param.
So the jar should include the jndi.properties? -
5. Re: How to access DB/session beans from applet?
jaikiran Mar 20, 2006 7:26 AM (in response to efratb)Yes
-
6. Re: How to access DB/session beans from applet?
efratb Mar 20, 2006 8:01 AM (in response to efratb)I did it and now I'm getting a different exception:
javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1317)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1446)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.imagine.em.QOD_GW.charts.BitRateChartApplet.init(BitRateChartApplet.java:64)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.PlainDatagramSocketImpl.peekData(Native Method)
at java.net.DatagramSocket.receive(Unknown Source)
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1287)
... 7 more
Maybe it has something to do with the jboss & bussiness jars (e.g. jbosssx-client.jar) ??
Where should I place them?
Thanks,
Efrat -
7. Re: How to access DB/session beans from applet?
jaikiran Mar 20, 2006 8:23 AM (in response to efratb)Try adding the following entry to the jndi.properties file, in addition to whatever is already there:
java.naming.provider.url=jnp://localhost:1099
-
8. Re: How to access DB/session beans from applet?
jaikiran Mar 20, 2006 8:24 AM (in response to efratb)Your jndi.properties should look like:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces java.naming.provider.url=jnp://localhost:1099
-
9. Re: How to access DB/session beans from applet?
efratb Mar 20, 2006 8:52 AM (in response to efratb)I did it, and now I get this exception:
java.lang.ClassFormatError: Truncated class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyInterfaces(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.rmi.MarshalledObject.get(Unknown Source)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.imagine.em.QOD_GW.charts.BitRateChartApplet.init(BitRateChartApplet.java:64)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
basic: Exception: java.lang.ClassFormatError: Truncated class file
java.lang.ClassFormatError: Truncated class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyInterfaces(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.rmi.MarshalledObject.get(Unknown Source)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.imagine.em.QOD_GW.charts.BitRateChartApplet.init(BitRateChartApplet.java:64)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Any idea??
Thanks,
Efrat -
10. Re: How to access DB/session beans from applet?
rludwick Mar 31, 2006 12:45 PM (in response to efratb)Efrat,
Did you solve your problem? The same thing is happening to me when I try to do a lookup on ConnectionFactory from an applet.
Robert -
11. Re: How to access DB/session beans from applet?
efratb Apr 2, 2006 1:02 AM (in response to efratb)Hi,
Yes, I solved the problem somehow...
I added all the jboss jars to the classpath, and the files of the server side I added to the applet's jar.
Good luck...
Efrat