HtmlUnit / htmlunit-android

HtmlUnit packaged for Android
Apache License 2.0
35 stars 7 forks source link

ClassNotFoundException for java.awt.color #4

Closed sengsational closed 1 year ago

sengsational commented 2 years ago

I have specified webClient.getOptions().setThrowExceptionOnScriptError(false); thus these exceptions are not preventing the application from running. But I thought I would report what I'm seeing, in case it would be beneficial to address.

Similar to https://github.com/HtmlUnit/htmlunit-android/issues/3

2022-03-14 17:11:30.235 29458-29590/com.sengsational.myapplication E/JavaScriptErrorListener: Error during JavaScript execution
    ======= EXCEPTION START ========
    Exception class=[java.lang.RuntimeException]
    com.gargoylesoftware.htmlunit.ScriptException: Exception invoking setFillStyle
        at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:980)
        ...
     Caused by: java.lang.RuntimeException: Exception invoking setFillStyle
        at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:238)
        ...
     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/Color;
        at com.gargoylesoftware.htmlunit.javascript.host.canvas.rendering.AwtRenderingBackend.<clinit>(AwtRenderingBackend.java:82)

Here is the classpath:

 releaseRuntimeClasspath - Resolved configuration for runtime for variant: release                        
 +--- net.sourceforge.htmlunit:htmlunit-android:2.60.0-SNAPSHOT                        
 |    +--- xalan:xalan:2.7.2                        
 |    |    \--- xalan:serializer:2.7.2                        
 |    +--- org.apache.commons:commons-lang3:3.12.0                        
 |    +--- org.apache.commons:commons-text:1.9                        
 |    +--- commons-io:commons-io:2.10.0                        
 |    +--- commons-logging:commons-logging:1.2                        
 |    +--- commons-net:commons-net:3.8.0                        
 |    +--- commons-codec:commons-codec:1.15                        
 |    +--- org.brotli:dec:0.1.2                        
 |    +--- com.shapesecurity:salvation2:3.0.0                        
 |    \--- org.eclipse.jetty.websocket:websocket-client:9.4.45.v20220203                        
 |         +--- org.eclipse.jetty:jetty-client:9.4.45.v20220203                        
 |         |    +--- org.eclipse.jetty:jetty-http:9.4.45.v20220203                        
 |         |    |    +--- org.eclipse.jetty:jetty-util:9.4.45.v20220203                        
 |         |    |    \--- org.eclipse.jetty:jetty-io:9.4.45.v20220203                        
 |         |    |         \--- org.eclipse.jetty:jetty-util:9.4.45.v20220203                        
 |         |    \--- org.eclipse.jetty:jetty-io:9.4.45.v20220203 (*)                        
 |         +--- org.eclipse.jetty:jetty-util:9.4.45.v20220203                        
 |         +--- org.eclipse.jetty:jetty-io:9.4.45.v20220203 (*)                        
 |         \--- org.eclipse.jetty.websocket:websocket-common:9.4.45.v20220203                        
 |              +--- org.eclipse.jetty.websocket:websocket-api:9.4.45.v20220203                        
 |              +--- org.eclipse.jetty:jetty-util:9.4.45.v20220203                        
 |              \--- org.eclipse.jetty:jetty-io:9.4.45.v20220203 (*)                        

RuntimeException_ClassNotFound_Color.txt Classpath.txt

rbri commented 2 years ago

OK, more or less expected, new snapshot build will be available later on

rbri commented 1 year ago

3.1.0 is out including this fix and many more. Thanks for reporting this issue.