java.lang.ClassCastException: com.gargoylesoftware.htmlunit.svg.SvgElement cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlElement

htmlunit | sirstrahd | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    ClassCast exception loading page

    htmlunit | 6 months ago | sirstrahd
    java.lang.ClassCastException: com.gargoylesoftware.htmlunit.svg.SvgElement cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlElement

    Root Cause Analysis

    1. java.lang.ClassCastException

      com.gargoylesoftware.htmlunit.svg.SvgElement cannot be cast to com.gargoylesoftware.htmlunit.html.HtmlElement

      at com.gargoylesoftware.htmlunit.html.HtmlPage.getDocumentElement()
    2. HtmlUnit
      HTMLParser$HtmlUnitDOMBuilder.startElement
      1. com.gargoylesoftware.htmlunit.html.HtmlPage.getDocumentElement(HtmlPage.java:328)
      2. com.gargoylesoftware.htmlunit.html.HtmlPage.getBody(HtmlPage.java:336)
      3. com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.startElement(HTMLParser.java:548)
      3 frames
    3. Xerces2-j
      AbstractSAXParser.startElement
      1. org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
      1 frame
    4. HtmlUnit
      HTMLParser$HtmlUnitDOMBuilder.startElement
      1. com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.startElement(HTMLParser.java:511)
      1 frame
    5. net.sourceforge.htmlunit
      HTMLConfiguration.parse
      1. net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.callStartElement(HTMLTagBalancer.java:1203)
      2. net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.startElement(HTMLTagBalancer.java:783)
      3. net.sourceforge.htmlunit.cyberneko.filters.DefaultFilter.startElement(DefaultFilter.java:137)
      4. net.sourceforge.htmlunit.cyberneko.filters.NamespaceBinder.startElement(NamespaceBinder.java:286)
      5. net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scanStartElement(HTMLScanner.java:2772)
      6. net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2117)
      7. net.sourceforge.htmlunit.cyberneko.HTMLScanner.scanDocument(HTMLScanner.java:927)
      8. net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:506)
      9. net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:459)
      9 frames
    6. Xerces2-j
      XMLParser.parse
      1. org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      1 frame
    7. HtmlUnit
      WebClient.getPage
      1. com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:979)
      2. com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:241)
      3. com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:187)
      4. com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:269)
      5. com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:157)
      6. com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:512)
      7. com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:386)
      8. com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:304)
      9. com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPageIfPossible(BaseFrameElement.java:184)
      10. com.gargoylesoftware.htmlunit.html.BaseFrameElement.loadInnerPage(BaseFrameElement.java:122)
      11. com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames(HtmlPage.java:1818)
      12. com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:226)
      13. com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:519)
      14. com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:386)
      15. com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:304)
      16. com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:468)
      16 frames
    8. com.iccenter.integrationtest
      HtmlUnitRunner.browser_getPage
      1. com.iccenter.integrationtest.tools.HtmlUnitRunner.browser_getPage(HtmlUnitRunner.java:21)
      1 frame
    9. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    10. JUnit
      ParentRunner.run
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      5. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      6. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      8. org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      9. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      10. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      11. org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      12. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      13. org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      13 frames
    11. JUnit4 Runner
      JUnit4TestReference.run
      1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      1 frame
    12. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      5 frames