ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration

前端 未结 7 899
我寻月下人不归
我寻月下人不归 2020-12-10 15:02

I am developing a GWT application in Eclipse and use jdom2 to read some custom xml property files.

Following a recent update my application now fails with the above

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 15:06

    Don't fight with Maven: if things aren't used together, they should go in separate maven modules. In your case, JDom is (probably) used on the server-side, which doesn't need gwt-dev. So the solution is to split your project into several Maven modules: one for the client-side that depends on GWT, and one for the server-side that doesn't (or possibly on gwt-servlet if you use GWT-RPC, or on requestfactory-server if you use RequestFactory).

    That said, even with a single project, if you do have gwt-dev in your classpath at runtime, then you got something wrong in your POM.

    …unless you're reading your XML files at build-time?

提交回复
热议问题