10.12.2009 19:19:19 com.google.apphosting.utils.jetty.JettyLogger warn
WARNUNG: Nested in javax.servlet.ServletException: init:
java.lang.NoClassDefFoundError: org/jibble/pircbot/PircBot
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
Diese Exception kann auftreten, wenn man versucht ein externes .jar mit GWT für die Serverseite zu verwenden. Die Fehlermeldung sagt aus, daß der eingebundene Pfad zu dem .jar (in diesem Fall org.jibble.pircbot.PircBot) nicht gefunden werden kann. Dies passiert normalerweise nur dann, wenn der Pfad zu dem .jar im JAVA Build Path nicht gesetzt wurde. Wenn man mit GWT arbeitet, ist das aber leider nicht alles was getan werden muß:
Der übliche Weg ein .jar einzubinden ist, die Einstellungen des Projektes zu bearbeiten, indem man mit der rechten
Maustaste auf das Projekt klickt und aus dem PopUp-Menu “Eigenschaften” oder “Properties” wählt. In dem erscheinenden Fenster wählt man dann “Java Build Path” und ergänzt hier dann die externen .jars.
Wenn man das GWT-Plugin für eclipse verwendet, dann ist das nicht die einzige Stelle wo das .jar ergänzt werden muß. Zusätzlich muß hier das .jar noch in das WAR-Verzeichnis des Projektes kopiert werden. Um genau zu sein muß das .jar in folgendem Pfad abgelegt werden: YouProject/war/WEB-INF/lib/.
Nachdem man das .jar dort abgelegt hat, wird die lokale GWT-Runtime ohne weitere Fehlermeldung funktionieren. Der Hintergrund dazu ist folgender: Die GWT-Runtime des eclipse Plugins verwendet nicht die eclipse-Umgebung, sondern läuft ausschließlich aus dem “war”-Verzeichnis des Projektes, welches später auch auf den Application-Server deployed wird.
I’ve been looking all over for this!
Thanks.
It was helpful.Thanks.
What about standard java classes like java.util.Calendar? Can you use them in any way?
@Tiberiu: Yes – on Serverside, you can use all Java-Classes. On the client Side not all classes are in GWT – only the commonly used classes in the Java standard class library can be used (such as most of the java.lang package classes and a subset of the java.util package classes). Have a look at the JRE Emulation Library http://www.gwtapps.com/doc/html/jre.html for further details.
Thank you for your answer. I had to change my core classes such that I can use just the emulated objects.
hı
ı want to use openid and i put . jar files about openid as builth path and i copied to ./lib my files but when i start my application its give error where i use something of about my jar fiels.
error is likes
07:17:23.815 [ERROR] [dene16] Line 44: No source code is available for type org.openid4java.discovery.DiscoveryInformation; did you forget to inherit a required module?
can someone help me pls?
@Bunyamın
I’m not sure how or where you want to use this in your project: If you are trying to use this on the “client-side”, the Google App Engine will prevent this library from working, since it is not supported as far as I know. If you are trying to use it as an servlet, you must additionally add the servlet to your web.xml. Please feel free to contact me again, if this does not help you.
client or servlet actually we are prepering a project for our class and we are using gwt-ext also we have to add hibernate and openid tecnology i am trying use openid4java.jar files but its not working and other .jar files too
cant i use a external . jar files?
so for example there are GHchart.jar but its has GHchart.gwt.xml so i can use in myapplicatin.gwt.xml its okey
but openid4java doesnt have a .gwt.xml i think i have to write my open4javabunal.gwt.xml
after this solve i will try to work server-side actually i trying on this proplem over 1 week
i start to server side so its look like okey
thank you very much
@Bunyamın
On the client (frontend) side, you won’t be able to use these jars. On the server-side it should work without any problems – as far as I understand, you tried to use them client-side: but jars can not be translated into AJAX up to now.
Thanks a lot!
Erik you are great!! I have this problem since 2 weeks now and GWT help didnt say anything about it… :/
Hope to hear a lot about GWT and other stuff in future!
Grüße aus Dresden
You are FANTASTIC! Thanks you saved my day
Great, buddy! You’ve save MANY people’s day.