| Subcribe via RSS

XPP3 pull-parser causing an ArrayIndexOutOfBoundsException: Google GWT with Eclipse, Maven and Hibernate

October 17th, 2008 Posted in Software Development

Today I lost almost two hours of productive work because I had problems compiling a simple Google GWT application. For software development I use Eclipse 3.4 (Ganymede) with the Maven Integration plugin. In case of GWT I also use the Cypal Studio.

My GWT application makes RPCs to a server backed by Hibernate. Including Hibernate (org.hibernate:hibernate-core-3.3.1.GA from the JBoss repository) into the classpath via Maven also includes XPP3 and the pull-parser-2 libraries. Then for some reason the Google GWT compiler uses the pull-parser-2 to parse the XML of the inherited modules.

The module com.google.gwt.user.User includes the module com.google.gwt.i18n.I18N which causes an ArrayIndexOutOfBoundsException:

[ERROR] Line 29: Unexpected exception while processing element 'inherits'
java.lang.ArrayIndexOutOfBoundsException: null
    at java.lang.System.arraycopy(Native Method)
    at org.gjt.xpp.impl.tokenizer.Tokenizer.next(Tokenizer.java:1274)
    at org.gjt.xpp.impl.pullparser.PullParser.next(PullParser.java:392)
    at org.gjt.xpp.sax2.Driver.parseSubTree(Driver.java:415)
    at org.gjt.xpp.sax2.Driver.parse(Driver.java:310)
    at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:310)

This seems to be a bug in the pull-parser-2. Excluding the pull-parser from the hibernate-core dependency removes it from the class path, but the GWT compiler continues using it for parsing its XML modules. The solution was to include the pull-parser-2.1.10 in the Java Build Path of Eclipse and put it to the first position in the build class path order in Eclipse.

Leave a Reply