Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365973 - Websocket client on android causes many VFY errors and warnings.
Summary: Websocket client on android causes many VFY errors and warnings.
Status: RESOLVED WONTFIX
Alias: None
Product: Jetty
Classification: RT
Component: websocket (show other bugs)
Version: 7.5.4   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 7.5.x   Edit
Assignee: Joakim Erdfelt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-07 18:19 EST by Joakim Erdfelt CLA
Modified: 2015-08-27 17:01 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Erdfelt CLA 2011-12-07 18:19:37 EST
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
Comment 1 Joakim Erdfelt CLA 2011-12-08 12:36:38 EST
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());
Comment 2 Joakim Erdfelt CLA 2011-12-08 12:38:09 EST
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
Comment 3 Joakim Erdfelt CLA 2011-12-08 13:33:55 EST
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.
Comment 4 Joakim Erdfelt CLA 2015-08-27 17:01:57 EDT
New android sdk no longer exhibits these warnings.