Parser xml on server

205 views
Skip to first unread message

Xavier

unread,
Aug 18, 2010, 6:45:57 AM8/18/10
to Google Web Toolkit
Hello,

I have a problem. I parser a xml from the server, but the following
error occurs:

"Caused by: java.lang.NoClassDefFoundError: Could not initialize class
com.google.gwt.xml.client.XMLParser"

I understand that this package can not be used on the server.

Could someone tell me how I colud parser an XML on the server side.

Thanks in advance.

Sincerely,

Xavier

lazi...@gmail.com

unread,
Aug 18, 2010, 8:49:44 AM8/18/10
to Google Web Toolkit
Hi Xavier, I think you need jdom or dom4j (the latter I have never
used but jdom works fine)

regards

Magallo

unread,
Apr 30, 2012, 11:38:30 AM4/30/12
to google-we...@googlegroups.com
Hi all, I have a similar problem.

If I wanted to share a class that has a method 'loadXmlString(String xml)'  and I wanted to use it sometims client side, sometimwes server side, how could I do? I see that client side this works using com.google.gwt.xml.client.* classes, but when I try to execute it server side, a "java.lang.NoClassDefFoundError: Could not initialize class com.google.gwt.xml.client.XMLParser"  error occurs. How can I solve this problem? Do I have to implement the same parsing algorithm twice? One client side and one server side? I can't believe that!

Please help.

Thad

unread,
May 2, 2012, 3:56:31 PM5/2/12
to google-we...@googlegroups.com
To use XML on the client side, you need to add

<inherits name='com.google.gwt.xml.XML' />

to your project's --.gwt.xml file.
Reply all
Reply to author
Forward
0 new messages