Xerces and gwt

47 views
Skip to first unread message

dukha

unread,
Apr 19, 2007, 8:18:44 PM4/19/07
to Google Web Toolkit
Hi Everyone,
This post amounts to a complaint and hopefully a help for others.

I'm relatively new to gwt and trying to get it to work with server
side java persistence using Toplink essentials. I discovered that my
persistence.xml won't parse in the project, even though I can get the
same file to parse in other projects. After 3 long days I discovered
that the problem is that gwt 1.3.3 (and earlier versions) use a
version of xerces from 2002 .(In gwt-dev-linux.jar). The only work
around was to expand the gwt jar, expand the latest xerces jar and
manually copy the xerces files to the gwt directory. Class path
variations, -Djava.endorsed.dirs or -javaagent: didn't seem to help.

So if you are getting an unlikely StackOverFlowError when you run your
jpa app with gwt, this is why.

Please, gwt developers: staying with the latest technology is
important. (Think about java 1.5 and 1.6 while you're upgrading to
xerces 2.9)

regards

dukha

Scott

unread,
Apr 20, 2007, 5:52:01 PM4/20/07
to Google Web Toolkit
Thanks for posting this, I think I might be hitting the same problem.
I upgraded from jre 1.5 to 1.6 and all of sudden
javax.xml.transformer.Transform broke.

Sure enough peeling back to jre 1.5 fixed the problem.

Here's the stack trace I got:
[WARN] StandardContext[]Exception while dispatching incoming RPC call
java.lang.AbstractMethodError:
org.apache.xerces.dom.DocumentImpl.getXmlStandalone()Z
at
com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(DOM2TO.java:
373)
at
com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:
127)
at
com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:
94)
at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:
663)
at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:
709)
at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:
313)
at nz.co.conceptdigital.server.Serializer.docToString(Serializer.java:
39)
at
nz.co.conceptdigital.server.FileListingSerializer.serializeFileListing(FileListingSerializer.java:
56)
at
nz.co.conceptdigital.server.FileListingSerializer.serialize(FileListingSerializer.java:
25)
at
nz.co.conceptdigital.server.FileSystemServiceImpl.getDirectoryListing(FileSystemServiceImpl.java:
31)

I'm using gwt-dev-windows.jar, and you outline exactly what files you
replaced in the JAR?

Cheers - Scott

Matt Andruff

unread,
Apr 21, 2007, 12:27:50 AM4/21/07
to Google Web Toolkit
ok I tried but can't figure out how to do this....

any help on some specifics would be great

Juha

unread,
Apr 22, 2007, 8:39:41 PM4/22/07
to Google Web Toolkit
I don't know about the first problem, but the second one:
java.lang.AbstractMethodError:
> org.apache.xerces.dom.DocumentImpl.getXmlStandalone()Z

is a problem with Java 6 on Linux. You can see a work-arounc for that
in this forum, at this thread.
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/d3bad5784902b725/#

It may also have been fixed in March 10, but not yet made it into any
release. See bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6396599

-- Juha

charlie...@gmail.com

unread,
Apr 22, 2007, 8:54:52 PM4/22/07
to Google Web Toolkit
I use Xerces 2.9 with GWT - with Toplink in hosted mode - by using the
endosed dirs and javaagent system properties (I don't think you have
to crack the jar open and stitch your own together, instead you can
use the endorsed mechanism and override).

I am setting these sys props as follows:

-Djava.endorsed.dirs=/opt/xerces-2_9_0 -Djavaagent=${env.USER}/.maven/
repository/toplink.essentials/jars/toplink-essentials-agent-2.0-43.jar

Using this I can work with Toplink in hosted mode fine. Without it, I
get the same StackOverflowError. (And the fact that I use Maven has
nothing to do with it, just point those props to where your jars are -
if you are interested in Maven and GWT check out the gwt-maven
plugin.)

And for the record - though I am not cracking the dev jar right now to
look - I would *guess* this is a Tomcat 5.0.x thing, which GWT
inherits, and not the GWT developers overlooking something, or
handling this poorly. I have used Toplink with GWT in the past,
outside of hosted mode, with no override and had no problems (use
noserver). The embedded Tomcat that ships with GWT for hosted mode
use is not really intended to do lots of heavy lifting (like, running
Toplink).

You might want to look at using noserver too. (If you are doing a
bunch of server side stuff, DataSources, filters, JNDI, JPA, etc, the
noserver can come in handy.)

Reply all
Reply to author
Forward
0 new messages