| Summary: | Websocket client on android causes many VFY errors and warnings. | ||
|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | Joakim Erdfelt <joakim.erdfelt> |
| Component: | websocket | Assignee: | Joakim Erdfelt <joakim.erdfelt> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | gregw, jetty-inbox |
| Version: | 7.5.4 | ||
| Target Milestone: | 7.5.x | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Joakim Erdfelt
Using the AndroidLog from i-jetty and some pre-emptive setting of the Log before Jetty initializes helps with all of the Log/Logger related VFY errors/warnings. AndroidLog from i-jetty source (ASL/EPL Licensed) http://code.google.com/p/i-jetty/source/browse/trunk/i-jetty/i-jetty-server/src/main/java/org/mortbay/ijetty/log/AndroidLog.java The following bridging code should be placed in your Activity#onCreate() method // Bridge Jetty Logging to Android Logging System.setProperty("org.eclipse.jetty.util.log.class",AndroidLog.class.getName()); org.eclipse.jetty.util.log.Log.setLog(new AndroidLog()); The warnings from WebSocketConnectionD13#handshake() are still tossing warnings, but are not required from the WebSocket client connection perspective. W/dalvikvm( 589): VFY: unable to find class referenced in signature (Ljavax/servlet/http/HttpServletRequest;) W/dalvikvm( 589): VFY: unable to find class referenced in signature (Ljavax/servlet/http/HttpServletResponse;) I/dalvikvm( 589): Could not find method javax.servlet.http.HttpServletRequest.getHeader, referenced from method org.eclipse.jetty.websocket.WebSocketConnectionD13.handshake W/dalvikvm( 589): VFY: unable to resolve interface method 880: Ljavax/servlet/http/HttpServletRequest;.getHeader (Ljava/lang/String;)Ljava/lang/String; D/dalvikvm( 589): VFY: replacing opcode 0x72 at 0x0002 D/dalvikvm( 589): VFY: dead code 0x0005-0057 in Lorg/eclipse/jetty/websocket/WebSocketConnectionD13;.handshake (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/String;)V Remaining VFY warning on WebSocketConnectionD13#handshake() can be resolved in the following ways. * include servlet-api in your apk (but this is pointless, as it will never be used) * refactor WebSocketConnectionD13#handshake() to be part of the WebSocketServlet specific use cases, removing it from the core websocket processes. Ideally, jetty-websocket should be split into 3 modules. jetty-websocket-core jetty-websocket-servlet jetty-websocket-client This is a bigger task than addressing the VFY errors. New android sdk no longer exhibits these warnings. |