Menu

#1917 Class cast exception

2.27
closed
None
1
2017-08-30
2017-08-30
ChristopheD
No

Hi,

FYI, I got the following class cast exception:

Caused by: java.lang.RuntimeException: Exception invoking getClientHeight
at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:182)
at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject$GetterSlot.getValue(ScriptableObject.java:334)
at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject$RelinkedSlot.getValue(ScriptableObject.java:387)
at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.get(ScriptableObject.java:500)
at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:83)
at com.gargoylesoftware.htmlunit.javascript.host.Element.get(Element.java:520)
at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.getProperty(ScriptableObject.java:2387)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1500)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1494)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1253)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:800)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:118)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:765)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:879)
... 51 more
Caused by: java.lang.ClassCastException: com.gargoylesoftware.htmlunit.javascript.host.svg.SVGSVGElement cannot be cast to com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1389)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getTop(ComputedCSSStyleDeclaration.java:1408)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getContentHeight(ComputedCSSStyleDeclaration.java:1331)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1185)
at com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.getCalculatedHeight(ComputedCSSStyleDeclaration.java:1153)
at com.gargoylesoftware.htmlunit.javascript.host.Element.getClientHeight(Element.java:599)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153)

Regards,
Christophe

Discussion

  • Ahmed Ashour

    Ahmed Ashour - 2017-08-30
    • status: open --> closed
    • assigned_to: Ahmed Ashour
     
  • ChristopheD

    ChristopheD - 2017-08-30

    Perfect. Thank you.

    Regards

     

Log in to post a comment.