Community
Participate
Working Groups
When using jetty-websocket for its websocket client. There are many VFY warnings and errors produced by the execution of various optional components in the system. Might need to reconsider packaging for websocket-client only use on android. I/Bubblewrap( 494): Connect clicked I/dalvikvm( 494): Could not find method org.slf4j.LoggerFactory.getLogger, referenced from method org.eclipse.jetty.util.log.Slf4jLog.<init> W/dalvikvm( 494): VFY: unable to resolve static method 4330: Lorg/slf4j/LoggerFactory;.getLogger (Ljava/lang/String;)Lorg/slf4j/Logger; D/dalvikvm( 494): VFY: replacing opcode 0x71 at 0x0008 D/dalvikvm( 494): VFY: dead code 0x000b-0019 in Lorg/eclipse/jetty/util/log/Slf4jLog;.<init> (Ljava/lang/String;)V D/dalvikvm( 494): VFY: dead code 0x0023-0025 in Lorg/eclipse/jetty/util/log/Slf4jLog;.<init> (Ljava/lang/String;)V I/dalvikvm( 494): Could not find method org.slf4j.Logger.debug, referenced from method org.eclipse.jetty.util.log.Slf4jLog.debug W/dalvikvm( 494): VFY: unable to resolve interface method 4322: Lorg/slf4j/Logger;.debug (Ljava/lang/String;Ljava/lang/Throwable;)V D/dalvikvm( 494): VFY: replacing opcode 0x72 at 0x0002 D/dalvikvm( 494): VFY: dead code 0x0005-0005 in Lorg/eclipse/jetty/util/log/Slf4jLog;.debug (Ljava/lang/String;Ljava/lang/Throwable;)V I/dalvikvm( 494): Could not find method org.slf4j.Logger.debug, referenced from method org.eclipse.jetty.util.log.Slf4jLog.debug W/dalvikvm( 494): VFY: unable to resolve interface method 4323: Lorg/slf4j/Logger;.debug (Ljava/lang/String;[Ljava/lang/Object;)V D/dalvikvm( 494): VFY: replacing opcode 0x72 at 0x0002 D/dalvikvm( 494): VFY: dead code 0x0005-0005 in Lorg/eclipse/jetty/util/log/Slf4jLog;.debug (Ljava/lang/String;[Ljava/lang/Object;)V I/dalvikvm( 494): Could not find method org.slf4j.Logger.getName, referenced from method org.eclipse.jetty.util.log.Slf4jLog.getName W/dalvikvm( 494): VFY: unable to resolve interface method 4324: Lorg/slf4j/Logger;.getName ()Ljava/lang/String; D/dalvikvm( 494): VFY: replacing opcode 0x72 at 0x0002 D/dalvikvm( 494): VFY: dead code 0x0005-0006 in Lorg/eclipse/jetty/util/log/Slf4jLog;.getName ()Ljava/lang/String; I/dalvikvm( 494): Could not find method org.slf4j.Logger.info, referenced from method org.eclipse.jetty.util.log.Slf4jLog.info W/dalvikvm( 494): VFY: unable to resolve interface method 4325: Lorg/slf4j/Logger;.info (Ljava/lang/String;Ljava/lang/Throwable;)V D/dalvikvm( 494): VFY: replacing opcode 0x72 at 0x0002 D/dalvikvm( 494): VFY: dead code 0x0005-0005 in Lorg/eclipse/jetty/util/log/Slf4jLog;.info (Ljava/lang/String;Ljava/lang/Throwable;)V I/dalvikvm( 494): Could not find method org.slf4j.Logger.info, referenced from method org.eclipse.jetty.util.log.Slf4jLog.info W/dalvikvm( 494): VFY: unable to resolve interface method 4326: Lorg/slf4j/Logger;.info (Ljava/lang/String;[Ljava/lang/Object;)V D/dalvikvm( 494): VFY: replacing opcode 0x72 at 0x0002 D/dalvikvm( 494): VFY: dead code 0x0005-0005 in Lorg/eclipse/jetty/util/log/Slf4jLog;.info (Ljava/lang/String;[Ljava/lang/Object;)V I/dalvikvm( 494): Could not find method org.slf4j.Logger.isDebugEnabled, referenced from method org.eclipse.jetty.util.log.Slf4jLog.isDebugEnabled W/dalvikvm( 494): VFY: unable to resolve interface method 4327: Lorg/slf4j/Logger;.isDebugEnabled ()Z D/dalvikvm( 494): VFY: replacing opcode 0x72 at 0x0002 D/dalvikvm( 494): VFY: dead code 0x0005-0006 in Lorg/eclipse/jetty/util/log/Slf4jLog;.isDebugEnabled ()Z I/dalvikvm( 494): Could not find method org.slf4j.Logger.warn, referenced from method org.eclipse.jetty.util.log.Slf4jLog.warn W/dalvikvm( 494): VFY: unable to resolve interface method 4328: Lorg/slf4j/Logger;.warn (Ljava/lang/String;Ljava/lang/Throwable;)V D/dalvikvm( 494): VFY: replacing opcode 0x72 at 0x0002 D/dalvikvm( 494): VFY: dead code 0x0005-0005 in Lorg/eclipse/jetty/util/log/Slf4jLog;.warn (Ljava/lang/String;Ljava/lang/Throwable;)V I/dalvikvm( 494): Could not find method org.slf4j.Logger.warn, referenced from method org.eclipse.jetty.util.log.Slf4jLog.warn W/dalvikvm( 494): VFY: unable to resolve interface method 4329: Lorg/slf4j/Logger;.warn (Ljava/lang/String;[Ljava/lang/Object;)V D/dalvikvm( 494): VFY: replacing opcode 0x72 at 0x0002 D/dalvikvm( 494): VFY: dead code 0x0005-0005 in Lorg/eclipse/jetty/util/log/Slf4jLog;.warn (Ljava/lang/String;[Ljava/lang/Object;)V W/dalvikvm( 494): VFY: unable to find class referenced in signature (Ljavax/servlet/http/HttpServletRequest;) W/dalvikvm( 494): VFY: unable to find class referenced in signature (Ljavax/servlet/http/HttpServletResponse;) I/dalvikvm( 494): Could not find method javax.servlet.http.HttpServletRequest.getHeader, referenced from method org.eclipse.jetty.websocket.WebSocketConnectionD13.handshake W/dalvikvm( 494): VFY: unable to resolve interface method 875: Ljavax/servlet/http/HttpServletRequest;.getHeader (Ljava/lang/String;)Ljava/lang/String; D/dalvikvm( 494): VFY: replacing opcode 0x72 at 0x0002 D/dalvikvm( 494): VFY: dead code 0x0005-0057 in Lorg/eclipse/jetty/websocket/WebSocketConnectionD13;.handshake (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/String;)V D/dalvikvm( 193): GC_EXPLICIT freed 40K, 51% free 2998K/6023K, external 1625K/2137K, paused 47ms
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.