Problems with applet calling an ejb!
Hello!I'm playing around with a small server-client-arch at home.
At this image you see a map over it:
http://eunvwq.blu.livefilestore.com/y1pWpW8wJEKiroPdHFWKlL3nN-QSPntjmXLQcW5INXMV3Mo6kY8X_JXii1hui-ulB1N9VgJJayIlZs/applet.jpghttp://eunvwq.blu.livefilestore.com/y1pWpW8wJEKiroPdHFWKlL3nN-QSPntjmXLQcW5INXMV3Mo6kY8X_JXii1hui-ulB1N9VgJJayIlZs/applet.jpg
Now I got a problem.
The problem is that a signed java applet does not manage to call a ejb.
The problem I get is this exception:
java.lang.ClassNotFoundException: namesejb.server.NameManagerSessionBean_o0oo54_HomeImpl_816_WLStub
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.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 weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:138)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:120)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:135)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:164)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:293)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:248)
at weblogic.jndi.internal.ServerNamingNode_816_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:375)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:363)
at javax.naming.InitialContext.lookup(Unknown Source)
at namesjavaapplication.panels.EjbPanel.addName(EjbPanel.java:71)
...
At row 71 I got this code:
Object object1 = context.lookup("namesejb/client/NameManagerEJBHome");
System.out.println( object1.getClass().getName() );
NameManagerEJBHome nameManagerEJBHome = (NameManagerEJBHome)PortableRemoteObject.narrow(object1, NameManagerEJBHome.class);
NameManangerEJBObject nameManangerEJBObject = nameManagerEJBHome.create(); nameManangerEJBObject.addName(textField.getText());
How ever the strange thing is that the same code works fine from a java_webstart_app downloaded from the same html.
The code also works fine from a standalone app.
The applet and the java_webstart just wraps the standalone app.
The html for the applet looks like:
<HTML>
<HEAD>
</HEAD>
<BODY>
<APPLET CODE="namesapplet.NamesApplet" ARCHIVE="namesapplet_signed.jar" WIDTH="450" HEIGHT="600">
</APPLET>
</BODY>
</HTML>
The jnlp for the java_webstart looks like:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+">
<information>
<title>Signed Names Web Start App XXXbuild_timeXXX</title>
<vendor>Fredrik Andersson</vendor>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.2+" />
<jar href="http://192.168.1.35:7021/nameswebapplication/nameswebstart_signed.jar"/>
</resources>
<application-desc main-class="namesjavaapplication.NamesJavaApplication" >
<argument> -verbose </argument>
</application-desc>
</jnlp>
Is there a way to pack a applet-jar and add some jar files?
My guess is that it tries to load a wrong class file.
When I run it from the standalone the System.out.println( object1.getClass().getName() ); gives me:
namesejb.server.NameManagerSessionBean_o0oo54_HomeImpl_816_WLStub
This problem is very similar to this problem of mine:
http://www.eksperten.dk/spm/816761
Any suggetstions is most welcome.
Best regards
Fredrik