ClassNotFoundException

140 views
Skip to first unread message

yves

unread,
Feb 13, 2011, 12:10:18 PM2/13/11
to gwtai


Hi all,

I downloaded gwtai 0.3 and implemented the CounterApplet example in my
app.
Compilation is ok, but the execution fails. In place of the applet a
rectangle is displayed with an error message "error : click here to
get more info". The increment buttom is displayed correctly.

In the Java console I get the error below. The very strange part is
the "Caused by" info where it shows an http connection to xxx/
CounterAppletImpl/class.class. It seems that every dot, included the
last one, has been replaced by a slash. Resulting in
"CounterAppletImpl/class".

I am using FF 3.6 or Chrome 10.0, Java 1.6.0_23

Does anybody have an idea if I missed something in the deployment, or
what kind of problem I might have ?
Thanks in advance
Yves

java.lang.ClassNotFoundException:
com.mycompany.applet.CounterAppletImpl.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager
$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:http://
localhost/com/mycompany/applet/CounterAppletImpl/class.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 9 more
Exception : java.lang.ClassNotFoundException:
com.mycompany.applet.CounterAppletImpl.class

Michael.Krog

unread,
Feb 13, 2011, 1:27:14 PM2/13/11
to gwtai
Could you post your CounterApplet interface?

-Michael

yves

unread,
Feb 14, 2011, 4:50:51 PM2/14/11
to gwtai
here it is:

import com.google.gwt.gwtai.applet.client.*;

@ImplementingClass(com.mycompany.applet.CounterAppletImpl.class)
@Height("60")
@Width("350")
@Archive("GwtAI-Client.jar,GwtAI-Demo.jar")
public interface CounterApplet extends Applet {

public void increment();

public void decrement();

public Object getCurrentValue();

}

I tried also with @Codebase("applet"), but it didn't changed the
problem.
Yves
Message has been deleted

Neal

unread,
Feb 16, 2011, 7:34:12 AM2/16/11
to gwtai
I have this exact same problem.

Did you find a solution?

Neal

het...@gmail.com

unread,
Feb 16, 2011, 1:03:56 PM2/16/11
to gw...@googlegroups.com
There is an entry in the FAQ (http://code.google.com/p/gwtai/wiki/FAQ) on this issue. I packaged my applet classes in a jar and then added that to the annotation and that fixed it. It looks like IE held on to a previous version on the applet so it kept failing after it was fixed.
Cheers,
John

Saad

unread,
Mar 1, 2011, 11:08:10 AM3/1/11
to gwtai
Hi,

I can't understand, where did you put the file referring to the jar in
its @Archive annotation (i guess CounterApplet.java) ? Does your GWT
project contains the file CounterApplet.java or does it just use the
jar file ?

I mean :

1) Where did you put the file CounterApplet.java : in your gwt
project ? in the application which you created the jar from ? both
(redundancy) ?
2) Where did you put the file CounterAppletImpl.java : in your gwt
project ? in the application which you created the jar from ? both
(redundancy) ?
3) Can you explain more precisely your arborescence and architecture
(how much projects ?) ?
4) Did you do the same as what is indicated in the last question in
the FAQ ?

Much appreciated, thanks.

Saad

unread,
Mar 2, 2011, 8:33:55 AM3/2/11
to gwtai
het...@gmail.com wrote me an answer. I hope it'll help someone (i
didn't try it yet) :

---
I'm not sure what the minimum configuration is but I have the
following:

1) CounterApplet is in both - I'm pretty sure the cross-compiler needs
the class file and the java file. The applet jar needs the interface
too at run time
2) I put the Impl in a jar which I put in the root of the war. I left
it in the WEB-INF/classes too but I think it is ignored
3) We have a legacy applet that we are trying to run inside a GWT
application. The GWT app has a menu bar that allows navigation between
an applet frame and a different GWT app.
4) Yes. Be sure to add the applet's jar file to your @Archive
annotation. The cross-compiler will turn this into the correct
codebase for launching the applet.
Good luck!
---
Reply all
Reply to author
Forward
0 new messages