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












7














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 error when trying to read the xml file. The relevant stack trace is:



org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
org.jdom2.input.sax.XMLReaders.createXMLReader(XMLReaders.java:165)
org.jdom2.input.SAXBuilder.createParser(SAXBuilder.java:871)
org.jdom2.input.SAXBuilder.buildEngine(SAXBuilder.java:854)
org.jdom2.input.SAXBuilder.getEngine(SAXBuilder.java:904)
org.jdom2.input.SAXBuilder.build(SAXBuilder.java:1116)
uk.co.platosys.db.jdbc.DatabaseProperties.loadProperties(DatabaseProperties.java:78)


Researching this problem suggests that the error can arise when incompatible versions of the xerces jars exist on the classpath.



gwt-dev-2.6.1.jar contains the xerces packages and my hunch is that this latest version of gwt-dev has bundled a version that is incompatible. However jdom2.0.5, the current release, is released with the 2.11 version of Xerces which seems to be the latest released by Apache. Putting these jars on my classpath doesn't seem to resolve matters; I have previously been able to rely on the versions in gwt-dev.



I am rather at my wits' end about this and considerably out of my comfort zone.










share|improve this question






















  • Try to remove GWT from your project, and then add it back. Also, make sure you don't have duplicate jars (old and new) in your WEB-INF/lib folder.
    – Andrei Volgin
    Jul 17 '14 at 13:56
















7














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 error when trying to read the xml file. The relevant stack trace is:



org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
org.jdom2.input.sax.XMLReaders.createXMLReader(XMLReaders.java:165)
org.jdom2.input.SAXBuilder.createParser(SAXBuilder.java:871)
org.jdom2.input.SAXBuilder.buildEngine(SAXBuilder.java:854)
org.jdom2.input.SAXBuilder.getEngine(SAXBuilder.java:904)
org.jdom2.input.SAXBuilder.build(SAXBuilder.java:1116)
uk.co.platosys.db.jdbc.DatabaseProperties.loadProperties(DatabaseProperties.java:78)


Researching this problem suggests that the error can arise when incompatible versions of the xerces jars exist on the classpath.



gwt-dev-2.6.1.jar contains the xerces packages and my hunch is that this latest version of gwt-dev has bundled a version that is incompatible. However jdom2.0.5, the current release, is released with the 2.11 version of Xerces which seems to be the latest released by Apache. Putting these jars on my classpath doesn't seem to resolve matters; I have previously been able to rely on the versions in gwt-dev.



I am rather at my wits' end about this and considerably out of my comfort zone.










share|improve this question






















  • Try to remove GWT from your project, and then add it back. Also, make sure you don't have duplicate jars (old and new) in your WEB-INF/lib folder.
    – Andrei Volgin
    Jul 17 '14 at 13:56














7












7








7


2





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 error when trying to read the xml file. The relevant stack trace is:



org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
org.jdom2.input.sax.XMLReaders.createXMLReader(XMLReaders.java:165)
org.jdom2.input.SAXBuilder.createParser(SAXBuilder.java:871)
org.jdom2.input.SAXBuilder.buildEngine(SAXBuilder.java:854)
org.jdom2.input.SAXBuilder.getEngine(SAXBuilder.java:904)
org.jdom2.input.SAXBuilder.build(SAXBuilder.java:1116)
uk.co.platosys.db.jdbc.DatabaseProperties.loadProperties(DatabaseProperties.java:78)


Researching this problem suggests that the error can arise when incompatible versions of the xerces jars exist on the classpath.



gwt-dev-2.6.1.jar contains the xerces packages and my hunch is that this latest version of gwt-dev has bundled a version that is incompatible. However jdom2.0.5, the current release, is released with the 2.11 version of Xerces which seems to be the latest released by Apache. Putting these jars on my classpath doesn't seem to resolve matters; I have previously been able to rely on the versions in gwt-dev.



I am rather at my wits' end about this and considerably out of my comfort zone.










share|improve this question













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 error when trying to read the xml file. The relevant stack trace is:



org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
org.jdom2.input.sax.XMLReaders.createXMLReader(XMLReaders.java:165)
org.jdom2.input.SAXBuilder.createParser(SAXBuilder.java:871)
org.jdom2.input.SAXBuilder.buildEngine(SAXBuilder.java:854)
org.jdom2.input.SAXBuilder.getEngine(SAXBuilder.java:904)
org.jdom2.input.SAXBuilder.build(SAXBuilder.java:1116)
uk.co.platosys.db.jdbc.DatabaseProperties.loadProperties(DatabaseProperties.java:78)


Researching this problem suggests that the error can arise when incompatible versions of the xerces jars exist on the classpath.



gwt-dev-2.6.1.jar contains the xerces packages and my hunch is that this latest version of gwt-dev has bundled a version that is incompatible. However jdom2.0.5, the current release, is released with the 2.11 version of Xerces which seems to be the latest released by Apache. Putting these jars on my classpath doesn't seem to resolve matters; I have previously been able to rely on the versions in gwt-dev.



I am rather at my wits' end about this and considerably out of my comfort zone.







java eclipse gwt xerces jdom






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 17 '14 at 13:45









ejoftheweb

71118




71118












  • Try to remove GWT from your project, and then add it back. Also, make sure you don't have duplicate jars (old and new) in your WEB-INF/lib folder.
    – Andrei Volgin
    Jul 17 '14 at 13:56


















  • Try to remove GWT from your project, and then add it back. Also, make sure you don't have duplicate jars (old and new) in your WEB-INF/lib folder.
    – Andrei Volgin
    Jul 17 '14 at 13:56
















Try to remove GWT from your project, and then add it back. Also, make sure you don't have duplicate jars (old and new) in your WEB-INF/lib folder.
– Andrei Volgin
Jul 17 '14 at 13:56




Try to remove GWT from your project, and then add it back. Also, make sure you don't have duplicate jars (old and new) in your WEB-INF/lib folder.
– Andrei Volgin
Jul 17 '14 at 13:56












7 Answers
7






active

oldest

votes


















4














I had a same exception when I upgraded my project from GWT 2.7 to GWT 2.8. I have no idea why I had not this problem with GWT 2.7 (maybe different position of in .classpath file of Eclipse project could affect it).



The reason for that exception was that before with such code like:



DocumentBuilderFactory newInstance = DocumentBuilderFactory.newInstance();
DocumentBuilder newDocumentBuilder = newInstance.newDocumentBuilder();
baseLayoutXmlDocument = newDocumentBuilder.parse( baseLayoutSvgInputStream );

SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();


the implementations from JDK package com.sun.org.apache.xerces.internal.jaxp was used, but after upgrade to GWT2.8 my app chose the xerces from gwt-dev.jar.
I found the fix for that according to Javadoc and link here
to used system properties



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





share|improve this answer





















  • Thanks, had the exact same problem, and the fix you proposed worked fine.
    – Massi
    Jun 8 at 9:42



















3














In my case I resolved this issue by adding to bootstrap entities (Classpath tab in run configuration) two entries /xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar and /xerces/xercesImpl/2.11.0/xercesImpl-2.11.0.jar from my local maven repository






share|improve this answer





























    0














    The order of the jars on the classpath matters. Did you try adding the Xerces 2.11 jar at the beginning of the classpath so it gets loaded first?






    share|improve this answer





























      0














      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?






      share|improve this answer





























        0














        In my case this was resolved by deleting the xerces directory in my local sbt cache (local maven repository if you use maven), and rebuilding the project.






        share|improve this answer





























          0














          This is a bit late, but after reading through the answers I did find one way to work around this problem. Instead of building your document factory with the normal DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); you could use the parameters in newInstance to specifically choose. This way you don't have to add JVM parameters like Svarog's answer above, and you don't have to add or remove libraries. My solution is as follows:



          DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", this.getClass().getClassLoader());
          DocumentBuilder builder = factory.newDocumentBuilder();
          Document doc = builder.parse(new FileInputStream("path/to/file.xml"));





          share|improve this answer





























            0














            The default JAXB implementation of WebLogic 12c causing the problem and you need to override the jaxb at the weblogic server startup. Add the below classpath to startWebLogic.cmd before echo CLASSPATH=%CLASSPATH%



            SET CLASSPATH=C:OracleMiddlewareOracle_Homewlservermodulesdatabinding.override.jar;%CLASSPATH%



            Tow JARS are added to support weblogic 12c.




            1. jaxb-core.jar

            2. jaxb-impl.jar






            share|improve this answer





















              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f24805360%2fclasscastexception-org-apache-xerces-parsers-xincludeawareparserconfiguration-c%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              7 Answers
              7






              active

              oldest

              votes








              7 Answers
              7






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              4














              I had a same exception when I upgraded my project from GWT 2.7 to GWT 2.8. I have no idea why I had not this problem with GWT 2.7 (maybe different position of in .classpath file of Eclipse project could affect it).



              The reason for that exception was that before with such code like:



              DocumentBuilderFactory newInstance = DocumentBuilderFactory.newInstance();
              DocumentBuilder newDocumentBuilder = newInstance.newDocumentBuilder();
              baseLayoutXmlDocument = newDocumentBuilder.parse( baseLayoutSvgInputStream );

              SAXParserFactory spf = SAXParserFactory.newInstance();
              SAXParser sp = spf.newSAXParser();


              the implementations from JDK package com.sun.org.apache.xerces.internal.jaxp was used, but after upgrade to GWT2.8 my app chose the xerces from gwt-dev.jar.
              I found the fix for that according to Javadoc and link here
              to used system properties



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





              share|improve this answer





















              • Thanks, had the exact same problem, and the fix you proposed worked fine.
                – Massi
                Jun 8 at 9:42
















              4














              I had a same exception when I upgraded my project from GWT 2.7 to GWT 2.8. I have no idea why I had not this problem with GWT 2.7 (maybe different position of in .classpath file of Eclipse project could affect it).



              The reason for that exception was that before with such code like:



              DocumentBuilderFactory newInstance = DocumentBuilderFactory.newInstance();
              DocumentBuilder newDocumentBuilder = newInstance.newDocumentBuilder();
              baseLayoutXmlDocument = newDocumentBuilder.parse( baseLayoutSvgInputStream );

              SAXParserFactory spf = SAXParserFactory.newInstance();
              SAXParser sp = spf.newSAXParser();


              the implementations from JDK package com.sun.org.apache.xerces.internal.jaxp was used, but after upgrade to GWT2.8 my app chose the xerces from gwt-dev.jar.
              I found the fix for that according to Javadoc and link here
              to used system properties



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





              share|improve this answer





















              • Thanks, had the exact same problem, and the fix you proposed worked fine.
                – Massi
                Jun 8 at 9:42














              4












              4








              4






              I had a same exception when I upgraded my project from GWT 2.7 to GWT 2.8. I have no idea why I had not this problem with GWT 2.7 (maybe different position of in .classpath file of Eclipse project could affect it).



              The reason for that exception was that before with such code like:



              DocumentBuilderFactory newInstance = DocumentBuilderFactory.newInstance();
              DocumentBuilder newDocumentBuilder = newInstance.newDocumentBuilder();
              baseLayoutXmlDocument = newDocumentBuilder.parse( baseLayoutSvgInputStream );

              SAXParserFactory spf = SAXParserFactory.newInstance();
              SAXParser sp = spf.newSAXParser();


              the implementations from JDK package com.sun.org.apache.xerces.internal.jaxp was used, but after upgrade to GWT2.8 my app chose the xerces from gwt-dev.jar.
              I found the fix for that according to Javadoc and link here
              to used system properties



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





              share|improve this answer












              I had a same exception when I upgraded my project from GWT 2.7 to GWT 2.8. I have no idea why I had not this problem with GWT 2.7 (maybe different position of in .classpath file of Eclipse project could affect it).



              The reason for that exception was that before with such code like:



              DocumentBuilderFactory newInstance = DocumentBuilderFactory.newInstance();
              DocumentBuilder newDocumentBuilder = newInstance.newDocumentBuilder();
              baseLayoutXmlDocument = newDocumentBuilder.parse( baseLayoutSvgInputStream );

              SAXParserFactory spf = SAXParserFactory.newInstance();
              SAXParser sp = spf.newSAXParser();


              the implementations from JDK package com.sun.org.apache.xerces.internal.jaxp was used, but after upgrade to GWT2.8 my app chose the xerces from gwt-dev.jar.
              I found the fix for that according to Javadoc and link here
              to used system properties



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






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jan 9 '17 at 10:12









              Svarozic

              511




              511












              • Thanks, had the exact same problem, and the fix you proposed worked fine.
                – Massi
                Jun 8 at 9:42


















              • Thanks, had the exact same problem, and the fix you proposed worked fine.
                – Massi
                Jun 8 at 9:42
















              Thanks, had the exact same problem, and the fix you proposed worked fine.
              – Massi
              Jun 8 at 9:42




              Thanks, had the exact same problem, and the fix you proposed worked fine.
              – Massi
              Jun 8 at 9:42













              3














              In my case I resolved this issue by adding to bootstrap entities (Classpath tab in run configuration) two entries /xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar and /xerces/xercesImpl/2.11.0/xercesImpl-2.11.0.jar from my local maven repository






              share|improve this answer


























                3














                In my case I resolved this issue by adding to bootstrap entities (Classpath tab in run configuration) two entries /xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar and /xerces/xercesImpl/2.11.0/xercesImpl-2.11.0.jar from my local maven repository






                share|improve this answer
























                  3












                  3








                  3






                  In my case I resolved this issue by adding to bootstrap entities (Classpath tab in run configuration) two entries /xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar and /xerces/xercesImpl/2.11.0/xercesImpl-2.11.0.jar from my local maven repository






                  share|improve this answer












                  In my case I resolved this issue by adding to bootstrap entities (Classpath tab in run configuration) two entries /xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar and /xerces/xercesImpl/2.11.0/xercesImpl-2.11.0.jar from my local maven repository







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 7 '14 at 9:54









                  foal

                  1676




                  1676























                      0














                      The order of the jars on the classpath matters. Did you try adding the Xerces 2.11 jar at the beginning of the classpath so it gets loaded first?






                      share|improve this answer


























                        0














                        The order of the jars on the classpath matters. Did you try adding the Xerces 2.11 jar at the beginning of the classpath so it gets loaded first?






                        share|improve this answer
























                          0












                          0








                          0






                          The order of the jars on the classpath matters. Did you try adding the Xerces 2.11 jar at the beginning of the classpath so it gets loaded first?






                          share|improve this answer












                          The order of the jars on the classpath matters. Did you try adding the Xerces 2.11 jar at the beginning of the classpath so it gets loaded first?







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jul 17 '14 at 14:33









                          David Levesque

                          17.8k65068




                          17.8k65068























                              0














                              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?






                              share|improve this answer


























                                0














                                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?






                                share|improve this answer
























                                  0












                                  0








                                  0






                                  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?






                                  share|improve this answer












                                  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?







                                  share|improve this answer












                                  share|improve this answer



                                  share|improve this answer










                                  answered Jul 18 '14 at 8:52









                                  Thomas Broyer

                                  62.1k678151




                                  62.1k678151























                                      0














                                      In my case this was resolved by deleting the xerces directory in my local sbt cache (local maven repository if you use maven), and rebuilding the project.






                                      share|improve this answer


























                                        0














                                        In my case this was resolved by deleting the xerces directory in my local sbt cache (local maven repository if you use maven), and rebuilding the project.






                                        share|improve this answer
























                                          0












                                          0








                                          0






                                          In my case this was resolved by deleting the xerces directory in my local sbt cache (local maven repository if you use maven), and rebuilding the project.






                                          share|improve this answer












                                          In my case this was resolved by deleting the xerces directory in my local sbt cache (local maven repository if you use maven), and rebuilding the project.







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Nov 27 '15 at 14:16









                                          Zoltán

                                          13.4k866109




                                          13.4k866109























                                              0














                                              This is a bit late, but after reading through the answers I did find one way to work around this problem. Instead of building your document factory with the normal DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); you could use the parameters in newInstance to specifically choose. This way you don't have to add JVM parameters like Svarog's answer above, and you don't have to add or remove libraries. My solution is as follows:



                                              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", this.getClass().getClassLoader());
                                              DocumentBuilder builder = factory.newDocumentBuilder();
                                              Document doc = builder.parse(new FileInputStream("path/to/file.xml"));





                                              share|improve this answer


























                                                0














                                                This is a bit late, but after reading through the answers I did find one way to work around this problem. Instead of building your document factory with the normal DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); you could use the parameters in newInstance to specifically choose. This way you don't have to add JVM parameters like Svarog's answer above, and you don't have to add or remove libraries. My solution is as follows:



                                                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", this.getClass().getClassLoader());
                                                DocumentBuilder builder = factory.newDocumentBuilder();
                                                Document doc = builder.parse(new FileInputStream("path/to/file.xml"));





                                                share|improve this answer
























                                                  0












                                                  0








                                                  0






                                                  This is a bit late, but after reading through the answers I did find one way to work around this problem. Instead of building your document factory with the normal DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); you could use the parameters in newInstance to specifically choose. This way you don't have to add JVM parameters like Svarog's answer above, and you don't have to add or remove libraries. My solution is as follows:



                                                  DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", this.getClass().getClassLoader());
                                                  DocumentBuilder builder = factory.newDocumentBuilder();
                                                  Document doc = builder.parse(new FileInputStream("path/to/file.xml"));





                                                  share|improve this answer












                                                  This is a bit late, but after reading through the answers I did find one way to work around this problem. Instead of building your document factory with the normal DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); you could use the parameters in newInstance to specifically choose. This way you don't have to add JVM parameters like Svarog's answer above, and you don't have to add or remove libraries. My solution is as follows:



                                                  DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", this.getClass().getClassLoader());
                                                  DocumentBuilder builder = factory.newDocumentBuilder();
                                                  Document doc = builder.parse(new FileInputStream("path/to/file.xml"));






                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered Jun 20 '17 at 9:18









                                                  JRSofty

                                                  65911635




                                                  65911635























                                                      0














                                                      The default JAXB implementation of WebLogic 12c causing the problem and you need to override the jaxb at the weblogic server startup. Add the below classpath to startWebLogic.cmd before echo CLASSPATH=%CLASSPATH%



                                                      SET CLASSPATH=C:OracleMiddlewareOracle_Homewlservermodulesdatabinding.override.jar;%CLASSPATH%



                                                      Tow JARS are added to support weblogic 12c.




                                                      1. jaxb-core.jar

                                                      2. jaxb-impl.jar






                                                      share|improve this answer


























                                                        0














                                                        The default JAXB implementation of WebLogic 12c causing the problem and you need to override the jaxb at the weblogic server startup. Add the below classpath to startWebLogic.cmd before echo CLASSPATH=%CLASSPATH%



                                                        SET CLASSPATH=C:OracleMiddlewareOracle_Homewlservermodulesdatabinding.override.jar;%CLASSPATH%



                                                        Tow JARS are added to support weblogic 12c.




                                                        1. jaxb-core.jar

                                                        2. jaxb-impl.jar






                                                        share|improve this answer
























                                                          0












                                                          0








                                                          0






                                                          The default JAXB implementation of WebLogic 12c causing the problem and you need to override the jaxb at the weblogic server startup. Add the below classpath to startWebLogic.cmd before echo CLASSPATH=%CLASSPATH%



                                                          SET CLASSPATH=C:OracleMiddlewareOracle_Homewlservermodulesdatabinding.override.jar;%CLASSPATH%



                                                          Tow JARS are added to support weblogic 12c.




                                                          1. jaxb-core.jar

                                                          2. jaxb-impl.jar






                                                          share|improve this answer












                                                          The default JAXB implementation of WebLogic 12c causing the problem and you need to override the jaxb at the weblogic server startup. Add the below classpath to startWebLogic.cmd before echo CLASSPATH=%CLASSPATH%



                                                          SET CLASSPATH=C:OracleMiddlewareOracle_Homewlservermodulesdatabinding.override.jar;%CLASSPATH%



                                                          Tow JARS are added to support weblogic 12c.




                                                          1. jaxb-core.jar

                                                          2. jaxb-impl.jar







                                                          share|improve this answer












                                                          share|improve this answer



                                                          share|improve this answer










                                                          answered Nov 20 at 7:24









                                                          nachit shah

                                                          11




                                                          11






























                                                              draft saved

                                                              draft discarded




















































                                                              Thanks for contributing an answer to Stack Overflow!


                                                              • Please be sure to answer the question. Provide details and share your research!

                                                              But avoid



                                                              • Asking for help, clarification, or responding to other answers.

                                                              • Making statements based on opinion; back them up with references or personal experience.


                                                              To learn more, see our tips on writing great answers.





                                                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                                              Please pay close attention to the following guidance:


                                                              • Please be sure to answer the question. Provide details and share your research!

                                                              But avoid



                                                              • Asking for help, clarification, or responding to other answers.

                                                              • Making statements based on opinion; back them up with references or personal experience.


                                                              To learn more, see our tips on writing great answers.




                                                              draft saved


                                                              draft discarded














                                                              StackExchange.ready(
                                                              function () {
                                                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f24805360%2fclasscastexception-org-apache-xerces-parsers-xincludeawareparserconfiguration-c%23new-answer', 'question_page');
                                                              }
                                                              );

                                                              Post as a guest















                                                              Required, but never shown





















































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown

































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown







                                                              Popular posts from this blog

                                                              "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                                                              Alcedinidae

                                                              RAC Tourist Trophy