JDOM

9 views
Skip to first unread message

salama

unread,
May 9, 2008, 12:46:31 PM5/9/08
to Google Web Toolkit
Hello, people!
I hava an application that uses JDOM to parsing xml.
I need to keep JDOM, because my task is only to do the web interface
(and I wana do it using gwt).
But when I launch the application, it gives-me an error:
java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder
I think its because the jdom.jar needs to be in Build Path.
How can I resolve this problem?
The full error mensage is:
[WARN] StandardWrapperValve[shell]: Servlet.service() for servlet
shell threw exception
java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder
at br.com.work.server.Xml.leArquivo(Xml.java:33) [this line is:
SAXBuilder builder = new SAXBuilder(true);]
at br.com.work.server.Xml.Load(Xml.java:26)
at br.com.work.server.ControladorImpl.loadXml(ControladorImpl.java:
29)
at br.com.work.server.ControladorImpl.<init>(ControladorImpl.java:20)
at
com.google.gwt.dev.shell.GWTShellServlet.tryGetOrLoadServlet(GWTShellServlet.java:
876)
at
com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:
241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
214)

salama

unread,
May 12, 2008, 10:54:06 AM5/12/08
to Google Web Toolkit
nobody?

gregor

unread,
May 12, 2008, 11:48:49 AM5/12/08
to Google Web Toolkit
Hi Salama,

Are you trying to use JDOM on the client side?

regards
gregor

salama

unread,
May 12, 2008, 12:12:33 PM5/12/08
to Google Web Toolkit
No.. I'm using only on the server side....
the server side use JDOM and returns a String[].

Olivier Monaco

unread,
May 11, 2008, 4:03:15 AM5/11/08
to Google Web Toolkit
Hi,

I think you doesn't understand what is GWT. GWT is a compiler that
translates your Java source files to JavaScript instead of Java byte-
code. So, first, you need the source code of all classes you use.
Second, you don't have access to all Java features you commonly use
(file access, stream/readers, Map/Collection/List, MessageFormat...).
Remember your target is JavaScript and Internet browser. GWT provides
a small library that emulate the must-have classes (Map, HashMap,
List, ArrayList...) using pure-JavaScript. It provides also some
ursefull classes (XML parsing, JSON parsing, Ui Widgets...). But no
more.

If you need some third party library (like JDOM), first you need the
Java source files in your ClassPath. Then, it must only use GWT
emulated classes an no more. If this library depends on some other
libraries, you need also their Java source files and so on.

So, forgot JDOM and takes a look at
http://google-web-toolkit.googlecode.com/svn/javadoc/1.4/com/google/gwt/xml/client/package-summary.html

Olivier.

gregor

unread,
May 12, 2008, 2:41:11 PM5/12/08
to Google Web Toolkit
Hi Salama,

Then you should have no problem because you're GWT remote servlets can
use any libraries they like. You just need to make sure that the JDOM
jar is in the classpath of your dev shell set up, and if you deploy
the app, say as a WAR, then make sure the JDOM jar is included, e.g.
at WEB-INF\lib.

regards
gregor

salama

unread,
May 13, 2008, 3:35:22 PM5/13/08
to Google Web Toolkit
Yes, I'm really using JDOM only on server side.
The JDOM jar is in the classpath of my eclipse project, but when I
execute Application-shell.cmd, and I try to do something in my
application (something that run a function on server side that uses
JDOM), I have: java.lang.NoClassDefFoundError: org/jdom/input/
SAXBuilder
My GWT Development Shell doesn't find my jdom.jar!!!! Maybe I need to
put something in Xml file, to show where is the jar file... I don't
know...
If I run my application using a console interface (not using GWT), it
works, because JDOM jar is in the classpath of my eclipse project and
eclipse can find it.
Gregor, I'm sorry, I installed GWT five days ago. What is "dev shell
set up"?


On 12 maio, 15:41, gregor <greg.power...@googlemail.com> wrote:
> Hi Salama,
>
> Then you should have no problem because you're GWT remote servlets can
> use any libraries they like. You just need to make sure that theJDOM
> jar is in the classpath of your dev shell set up, and if you deploy
> the app, say as a WAR, then make sure theJDOMjar is included, e.g.
> at WEB-INF\lib.
>
> regards
> gregor
>
> On May 12, 5:12 pm, salama <thiagosalamatudoju...@gmail.com> wrote:
>
> > No.. I'm using only on the server side....
> > the server side useJDOMand returns a String[].
>
> > On 12 maio, 12:48, gregor <greg.power...@googlemail.com> wrote:
>
> > > Hi Salama,
>
> > > Are you trying to useJDOMon the client side?
>
> > > regards
> > > gregor
>
> > > On May 12, 3:54 pm, salama <thiagosalamatudoju...@gmail.com> wrote:
>
> > > > nobody?
>
> > > > On 9 maio, 13:46, salama <thiagosalamatudoju...@gmail.com> wrote:
>
> > > > > Hello, people!
> > > > > I hava an application that usesJDOMto parsing xml.
> > > > > I need to keepJDOM, because my task is only to do the web interface
> > > > > (and I wana do it using gwt).
> > > > > But when I launch the application, it gives-me an error:
> > > > > java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder
> > > > > I think its because thejdom.jar needs to be in Build Path.

Olivier Monaco

unread,
May 13, 2008, 3:55:42 PM5/13/08
to Google Web Toolkit
Hi,

Sorry for my misundestood...

You can edit the classpath by opening "Application-shell.cmd" with a
text-editor.

If you want to "fully" integrate GWT with Eclipse, take a look at
http://www.cypal.in/studio

Olivier.

gregor

unread,
May 13, 2008, 7:41:32 PM5/13/08
to Google Web Toolkit
Hi Salama,

Yes, as Olivier says, just open your script in a text editor and look
for the -classpath argument. Add the path to your JDOM jar to it and
it should work.

I mean by "dev shell setup" the way you set up and run in hosted mode.
I use Intellij so it works out the command line and runs it for me.
You can do the same with Eclipse I believe.

regards
gregor

On May 13, 8:55 pm, Olivier Monaco <olivier.mon...@free.fr> wrote:
> Hi,
>
> Sorry for my misundestood...
>
> You can edit the classpath by opening "Application-shell.cmd" with a
> text-editor.
>
> If you want to "fully" integrate GWT with Eclipse, take a look athttp://www.cypal.in/studio

salama

unread,
May 14, 2008, 2:23:09 PM5/14/08
to Google Web Toolkit
Yes! Thanks a lot!
In "Application-shell.cmd" doesn't has "-classpath" and when add it,
it returns an error...
But I add in "%~dp0\src;%~dp0\bin;C:/gwt-windows-1.4.62/gwt-
user.jar;C:/gwt-windows-1.4.62/gwt-dev-windows.jar;"
And it works! Yes!
Thanks a lot, Gregor and Oliver. Now I will install the cypal pluguin.
Thanks!
Reply all
Reply to author
Forward
0 new messages