Discussion:
GWT2.8 : org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
Darren Smith
2016-10-06 06:41:09 UTC
Permalink
Hi,

I am developing a <web-app> that contains within it
- a vanilla HttpServlet
- a GWT RPC Service implementation (RemoteServiceServlet)

I am currently using [GWT2.8rc1].

Both servlets manipulate XML documents, and hence make calls to the
following code
DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
docfactory.setNamespaceAware(true);

DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *

When I launch the application in Eclipse, using the embedded
Jetty container, the vanilla HttpServlet will fail at the line
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *

The error message is
java.lang.ClassCastException:
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration

Having done some research, this exception is typically raised when there
are several Xerces implementations found on the classpath.
(I can only see Xerces implementations in gwt-dev and in Eclipse as a
plugin).


For the GWT RPC Service implementation, launched as part of the same
<web-app>, the XML document processing works fine - i.e. no exception
raised.

If I comment out in the web.xml file the GWT-RPC servlet defintion, then
the vanilla HttpServlet will perform the XML document processing without an
exception.


Has anyone encountered similar problems?

Darren Smith.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Ian Whyman
2016-10-10 15:04:27 UTC
Permalink
Hi Darren,

We are seeing the same issue, did you find any resolution?

Regards,

Ian
Post by Darren Smith
Hi,
I am developing a <web-app> that contains within it
- a vanilla HttpServlet
- a GWT RPC Service implementation (RemoteServiceServlet)
I am currently using [GWT2.8rc1].
Both servlets manipulate XML documents, and hence make calls to the
following code
DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
docfactory.setNamespaceAware(true);
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
When I launch the application in Eclipse, using the embedded
Jetty container, the vanilla HttpServlet will fail at the line
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
The error message is
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration
Having done some research, this exception is typically raised when there
are several Xerces implementations found on the classpath.
(I can only see Xerces implementations in gwt-dev and in Eclipse as a
plugin).
For the GWT RPC Service implementation, launched as part of the same
<web-app>, the XML document processing works fine - i.e. no exception
raised.
If I comment out in the web.xml file the GWT-RPC servlet defintion, then
the vanilla HttpServlet will perform the XML document processing without an
exception.
Has anyone encountered similar problems?
Darren Smith.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Drew Spencer
2016-10-10 15:16:18 UTC
Permalink
Hey guys, this might help you. I had an issue with an old Xerces on the
path
before: http://stackoverflow.com/questions/38457973/cant-compile-gwt-app-using-2-8-0-snapshot-and-java-8-with-gwt-maven-plugin

Happy coding!

Drew
Post by Ian Whyman
Hi Darren,
We are seeing the same issue, did you find any resolution?
Regards,
Ian
Post by Darren Smith
Hi,
I am developing a <web-app> that contains within it
- a vanilla HttpServlet
- a GWT RPC Service implementation (RemoteServiceServlet)
I am currently using [GWT2.8rc1].
Both servlets manipulate XML documents, and hence make calls to the
following code
DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
docfactory.setNamespaceAware(true);
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
When I launch the application in Eclipse, using the embedded
Jetty container, the vanilla HttpServlet will fail at the line
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
The error message is
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration
Having done some research, this exception is typically raised when there
are several Xerces implementations found on the classpath.
(I can only see Xerces implementations in gwt-dev and in Eclipse as a
plugin).
For the GWT RPC Service implementation, launched as part of the same
<web-app>, the XML document processing works fine - i.e. no exception
raised.
If I comment out in the web.xml file the GWT-RPC servlet defintion, then
the vanilla HttpServlet will perform the XML document processing without an
exception.
Has anyone encountered similar problems?
Darren Smith.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Darren Smith
2016-10-18 09:37:08 UTC
Permalink
Hi Ian,

Yes, we are still seeing the problem. I've put it aside for the moment,
hoping to revisit once we upgrade to a new GWT Release Candidate.
Glad to know I'm not the only one suffering from this :)

Cheers
Darren
Post by Ian Whyman
Hi Darren,
We are seeing the same issue, did you find any resolution?
Regards,
Ian
Post by Darren Smith
Hi,
I am developing a <web-app> that contains within it
- a vanilla HttpServlet
- a GWT RPC Service implementation (RemoteServiceServlet)
I am currently using [GWT2.8rc1].
Both servlets manipulate XML documents, and hence make calls to the
following code
DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
docfactory.setNamespaceAware(true);
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
When I launch the application in Eclipse, using the embedded
Jetty container, the vanilla HttpServlet will fail at the line
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
The error message is
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration
Having done some research, this exception is typically raised when there
are several Xerces implementations found on the classpath.
(I can only see Xerces implementations in gwt-dev and in Eclipse as a
plugin).
For the GWT RPC Service implementation, launched as part of the same
<web-app>, the XML document processing works fine - i.e. no exception
raised.
If I comment out in the web.xml file the GWT-RPC servlet defintion, then
the vanilla HttpServlet will perform the XML document processing without an
exception.
Has anyone encountered similar problems?
Darren Smith.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Ian Whyman
2016-10-25 12:09:37 UTC
Permalink
It seems still to be an issue with the final 2.8.0 release

Ian
Post by Darren Smith
Hi Ian,
Yes, we are still seeing the problem. I've put it aside for the moment,
hoping to revisit once we upgrade to a new GWT Release Candidate.
Glad to know I'm not the only one suffering from this :)
Cheers
Darren
Post by Ian Whyman
Hi Darren,
We are seeing the same issue, did you find any resolution?
Regards,
Ian
Post by Darren Smith
Hi,
I am developing a <web-app> that contains within it
- a vanilla HttpServlet
- a GWT RPC Service implementation (RemoteServiceServlet)
I am currently using [GWT2.8rc1].
Both servlets manipulate XML documents, and hence make calls to the
following code
DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
docfactory.setNamespaceAware(true);
DocumentBuilder builder = docfactory.newDocumentBuilder(); // *
problem here *
When I launch the application in Eclipse, using the embedded
Jetty container, the vanilla HttpServlet will fail at the line
DocumentBuilder builder = docfactory.newDocumentBuilder(); // *
problem here *
The error message is
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration
Having done some research, this exception is typically raised when there
are several Xerces implementations found on the classpath.
(I can only see Xerces implementations in gwt-dev and in Eclipse as a
plugin).
For the GWT RPC Service implementation, launched as part of the same
<web-app>, the XML document processing works fine - i.e. no exception
raised.
If I comment out in the web.xml file the GWT-RPC servlet defintion, then
the vanilla HttpServlet will perform the XML document processing without an
exception.
Has anyone encountered similar problems?
Darren Smith.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Leto
2018-06-29 12:14:42 UTC
Permalink
Post by Ian Whyman
It seems still to be an issue with the final 2.8.0 release
Ian
I recently upgraded to GWT 2.8.2 (from the old version 2.6.0) I ran into
the same problem
("org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration").

What I would like to understand is, is the Xerces version packaged with GWT
2.8.2 (gwt-dev.jar) incompatible? The fix with

-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.
internal.jaxp.DocumentBuilderFactoryImpl
-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp
.SAXParserFactoryImpl

seems to work.

So are we talking about a kind of dependency-problem with GWT (2.8.0+)?
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Thomas Broyer
2018-06-30 12:35:16 UTC
Permalink
What's in your classpath? There might probably be ways to avoid those situations, in GWT, but so few people have run into this that no one investigated further.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Leto
2018-07-01 07:13:43 UTC
Permalink
Post by Thomas Broyer
What's in your classpath? There might probably be ways to avoid those
situations, in GWT, but so few people have run into this that no one
investigated further.
I stripped down my dependencies to just only a few, and if I omit the
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl

arguments, the problem still occurs.

I use the simple Ant script, no Eclipse, no Maven in this setup. And within
Post by Thomas Broyer
D:\[...]\gwt-2.8.2\gwt-user.jar
D:\[...]\gwt-2.8.2\gwt-dev.jar
D:\[...]\Eclipse\MyGwtApp\src
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\classes
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib\aopalliance-1.0.jar
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib\gin-2.1.2.jar
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib\guice-3.0.jar
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib\guice-assistedinject-3.0.jar
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib\gwt-visualization-1.1.2.jar
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib\javax.inject-1.jar
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Slava Pankov
2018-07-04 02:57:54 UTC
Permalink
For me the following helps in my project's pom.xml:

<!-- for unknown reason GWT 2.8 debugging under Eclipse fails without
xerces dependency -->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>
Post by Leto
Post by Thomas Broyer
What's in your classpath? There might probably be ways to avoid those
situations, in GWT, but so few people have run into this that no one
investigated further.
I stripped down my dependencies to just only a few, and if I omit the
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
arguments, the problem still occurs.
I use the simple Ant script, no Eclipse, no Maven in this setup. And
Post by Thomas Broyer
D:\[...]\gwt-2.8.2\gwt-user.jar
D:\[...]\gwt-2.8.2\gwt-dev.jar
D:\[...]\Eclipse\MyGwtApp\src
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\classes
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib\aopalliance-1.0.jar
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib\gin-2.1.2.jar
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib\guice-3.0.jar
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib\guice-assistedinject-3.0.jar
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib\gwt-visualization-1.1.2.jar
D:\[...]\Eclipse\MyGwtApp\war\WEB-INF\lib\javax.inject-1.jar
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Peter Petranik
2016-12-02 09:36:43 UTC
Permalink
Hi, I have a same problem after I updated my application from GWT 2.7 to 2.8

That is the code that raises the exception:
DocumentBuilderFactory.newInstance().newDocumentBuilder()

And that is the exception:
java.lang.ClassCastException:
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
at
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown
Source)
...

Has somebody already found some solution how to fix that ?
Post by Darren Smith
Hi,
I am developing a <web-app> that contains within it
- a vanilla HttpServlet
- a GWT RPC Service implementation (RemoteServiceServlet)
I am currently using [GWT2.8rc1].
Both servlets manipulate XML documents, and hence make calls to the
following code
DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
docfactory.setNamespaceAware(true);
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
When I launch the application in Eclipse, using the embedded
Jetty container, the vanilla HttpServlet will fail at the line
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
The error message is
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration
Having done some research, this exception is typically raised when there
are several Xerces implementations found on the classpath.
(I can only see Xerces implementations in gwt-dev and in Eclipse as a
plugin).
For the GWT RPC Service implementation, launched as part of the same
<web-app>, the XML document processing works fine - i.e. no exception
raised.
If I comment out in the web.xml file the GWT-RPC servlet defintion, then
the vanilla HttpServlet will perform the XML document processing without an
exception.
Has anyone encountered similar problems?
Darren Smith.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Juan Pablo Gardella
2016-12-02 13:59:08 UTC
Permalink
Try by removing/exluding (if you have it in you r dependencies) xerces.
Post by Peter Petranik
Hi, I have a same problem after I updated my application from GWT 2.7 to 2.8
DocumentBuilderFactory.newInstance().newDocumentBuilder()
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
at
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown
Source)
...
Has somebody already found some solution how to fix that ?
Hi,
I am developing a <web-app> that contains within it
- a vanilla HttpServlet
- a GWT RPC Service implementation (RemoteServiceServlet)
I am currently using [GWT2.8rc1].
Both servlets manipulate XML documents, and hence make calls to the
following code
DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
docfactory.setNamespaceAware(true);
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
When I launch the application in Eclipse, using the embedded
Jetty container, the vanilla HttpServlet will fail at the line
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
The error message is
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration
Having done some research, this exception is typically raised when there
are several Xerces implementations found on the classpath.
(I can only see Xerces implementations in gwt-dev and in Eclipse as a
plugin).
For the GWT RPC Service implementation, launched as part of the same
<web-app>, the XML document processing works fine - i.e. no exception
raised.
If I comment out in the web.xml file the GWT-RPC servlet defintion, then
the vanilla HttpServlet will perform the XML document processing without an
exception.
Has anyone encountered similar problems?
Darren Smith.
--
You received this message because you are subscribed to the Google Groups
"GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Ian Whyman
2016-12-02 15:12:47 UTC
Permalink
In the end we fixed that by shipping our own version of xerces & co in our war.
Post by Peter Petranik
Hi, I have a same problem after I updated my application from GWT 2.7 to 2.8
DocumentBuilderFactory.newInstance().newDocumentBuilder()
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to
org.apache.xerces.xni.parser.XMLParserConfiguration
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
at
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown
Source)
...
Has somebody already found some solution how to fix that ?
Post by Darren Smith
Hi,
I am developing a <web-app> that contains within it
- a vanilla HttpServlet
- a GWT RPC Service implementation (RemoteServiceServlet)
I am currently using [GWT2.8rc1].
Both servlets manipulate XML documents, and hence make calls to the
following code
DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
docfactory.setNamespaceAware(true);
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
When I launch the application in Eclipse, using the embedded Jetty
container, the vanilla HttpServlet will fail at the line
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
The error message is
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to
org.apache.xerces.xni.parser.XMLParserConfiguration
Having done some research, this exception is typically raised when there
are several Xerces implementations found on the classpath.
(I can only see Xerces implementations in gwt-dev and in Eclipse as a
plugin).
For the GWT RPC Service implementation, launched as part of the same
<web-app>, the XML document processing works fine - i.e. no exception
raised.
If I comment out in the web.xml file the GWT-RPC servlet defintion, then
the vanilla HttpServlet will perform the XML document processing without an
exception.
Has anyone encountered similar problems?
Darren Smith.
--
You received this message because you are subscribed to a topic in the
Google Groups "GWT Users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/google-web-toolkit/jZEikD1GbYk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
--
Ian Whyman
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Peter Petranik
2017-01-09 10:06:32 UTC
Permalink
I found the solution for my problem with this exception, according to
Javadoc and databasesandlife.com
<https://www.databasesandlife.com/java-always-explicitly-specify-which-xml-parser-to-use/> I
have used two system properties and problem was gone, because our code was
written to use JDK xerces

-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
Post by Peter Petranik
Hi, I have a same problem after I updated my application from GWT 2.7 to 2.8
DocumentBuilderFactory.newInstance().newDocumentBuilder()
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
at
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown
Source)
...
Has somebody already found some solution how to fix that ?
Post by Darren Smith
Hi,
I am developing a <web-app> that contains within it
- a vanilla HttpServlet
- a GWT RPC Service implementation (RemoteServiceServlet)
I am currently using [GWT2.8rc1].
Both servlets manipulate XML documents, and hence make calls to the
following code
DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
docfactory.setNamespaceAware(true);
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
When I launch the application in Eclipse, using the embedded
Jetty container, the vanilla HttpServlet will fail at the line
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
The error message is
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration
Having done some research, this exception is typically raised when there
are several Xerces implementations found on the classpath.
(I can only see Xerces implementations in gwt-dev and in Eclipse as a
plugin).
For the GWT RPC Service implementation, launched as part of the same
<web-app>, the XML document processing works fine - i.e. no exception
raised.
If I comment out in the web.xml file the GWT-RPC servlet defintion, then
the vanilla HttpServlet will perform the XML document processing without an
exception.
Has anyone encountered similar problems?
Darren Smith.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Peter Petranik
2016-12-02 14:55:37 UTC
Permalink
I have the Xerces library as dependency as part of gwt-dev.jar that is set
by GWT SDK. I am not using the maven for a project. My dependencies are
defined just by Eclipse in Project Settings (check the screenshot)

<Loading Image...>
Post by Darren Smith
Hi,
I am developing a <web-app> that contains within it
- a vanilla HttpServlet
- a GWT RPC Service implementation (RemoteServiceServlet)
I am currently using [GWT2.8rc1].
Both servlets manipulate XML documents, and hence make calls to the
following code
DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
docfactory.setNamespaceAware(true);
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
When I launch the application in Eclipse, using the embedded
Jetty container, the vanilla HttpServlet will fail at the line
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
The error message is
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration
Having done some research, this exception is typically raised when there
are several Xerces implementations found on the classpath.
(I can only see Xerces implementations in gwt-dev and in Eclipse as a
plugin).
For the GWT RPC Service implementation, launched as part of the same
<web-app>, the XML document processing works fine - i.e. no exception
raised.
If I comment out in the web.xml file the GWT-RPC servlet defintion, then
the vanilla HttpServlet will perform the XML document processing without an
exception.
Has anyone encountered similar problems?
Darren Smith.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Juan Pablo Gardella
2016-12-02 15:01:27 UTC
Permalink
Check
http://stackoverflow.com/questions/24805360/classcastexception-org-apache-xerces-parsers-xincludeawareparserconfiguration-c
Post by Peter Petranik
I have the Xerces library as dependency as part of gwt-dev.jar that is set
by GWT SDK. I am not using the maven for a project. My dependencies are
defined just by Eclipse in Project Settings (check the screenshot)
<https://lh3.googleusercontent.com/-sgJe_VgmTLI/WEGLKDtxKKI/AAAAAAAAA1U/rfv7MvrvP1ETfgqD7OROZLymh0YIE2lJwCEw/s1600/as.PNG>
Hi,
I am developing a <web-app> that contains within it
- a vanilla HttpServlet
- a GWT RPC Service implementation (RemoteServiceServlet)
I am currently using [GWT2.8rc1].
Both servlets manipulate XML documents, and hence make calls to the
following code
DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
docfactory.setNamespaceAware(true);
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
When I launch the application in Eclipse, using the embedded
Jetty container, the vanilla HttpServlet will fail at the line
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
The error message is
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration
Having done some research, this exception is typically raised when there
are several Xerces implementations found on the classpath.
(I can only see Xerces implementations in gwt-dev and in Eclipse as a
plugin).
For the GWT RPC Service implementation, launched as part of the same
<web-app>, the XML document processing works fine - i.e. no exception
raised.
If I comment out in the web.xml file the GWT-RPC servlet defintion, then
the vanilla HttpServlet will perform the XML document processing without an
exception.
Has anyone encountered similar problems?
Darren Smith.
--
You received this message because you are subscribed to the Google Groups
"GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Peter Petranik
2016-12-05 13:16:07 UTC
Permalink
Thx guys for quick response, but my problem was only in some Eclipse
related file. I am using Eclipse SDK 4.6.1 with GWT Eclipse Plugin
<https://github.com/gwt-plugins/gwt-eclipse-plugin>. After I have switched
from GWT 2.7 to GWT 2.8 I missed in $PROJECT_DIR/.settings /
com.gwtplugins.gwt.eclipse.core.prefs the additional line

*filesCopiedToWebInfLib=gwt-servlet.jar*

.. this should be added by GWT Eclipse Plugin, I have just removed it by
mistake. With this line everything works without any problem in EclipseIDE.
For production build, we use mojo gwt-maven-plugin and there we also do not
have a problem.
Post by Darren Smith
Hi,
I am developing a <web-app> that contains within it
- a vanilla HttpServlet
- a GWT RPC Service implementation (RemoteServiceServlet)
I am currently using [GWT2.8rc1].
Both servlets manipulate XML documents, and hence make calls to the
following code
DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
docfactory.setNamespaceAware(true);
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
When I launch the application in Eclipse, using the embedded
Jetty container, the vanilla HttpServlet will fail at the line
DocumentBuilder builder = docfactory.newDocumentBuilder(); // * problem
here *
The error message is
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast
to org.apache.xerces.xni.parser.XMLParserConfiguration
Having done some research, this exception is typically raised when there
are several Xerces implementations found on the classpath.
(I can only see Xerces implementations in gwt-dev and in Eclipse as a
plugin).
For the GWT RPC Service implementation, launched as part of the same
<web-app>, the XML document processing works fine - i.e. no exception
raised.
If I comment out in the web.xml file the GWT-RPC servlet defintion, then
the vanilla HttpServlet will perform the XML document processing without an
exception.
Has anyone encountered similar problems?
Darren Smith.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Adam Gerbert
2016-12-15 16:56:44 UTC
Permalink
Ran into the same issue after upgrading to 2.8 from 2.7. Only happened in
super dev mode, as the xerces dependency was coming from gwt-dev.jar. I
fixed it in the same manner as Ian Whyman (thanks!), by including the
dependency explicitly.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Loading...