jersey
  1. jersey
  2. JERSEY-2101

inadvertent printStackTrace indicating 'Connection Refused' coming from Jersey on JES

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3.1
    • Component/s: connectors
    • Labels:
      None

      Description

      the stack trace is seen when connecting to a server that is not running.
      Here is a reproducible test case:

      import javax.ws.rs.client.*;
      import javax.ws.rs.core.*;
      
      public class JerseyConnectTest {
      	public static void main(String [] args) {
      	   try {
      		WebTarget target = ClientBuilder.newClient().target("https://localhost:8443");
      		target.path("/system/bundles").request("text/plain").put(Entity.text("4"));
      	   } catch (Throwable t) {
      	        //t.printStackTrace();
      		System.out.println("Exception caught: " + t.getMessage());
      	   }
      	}
      }
      

      Here is how to run it:

      #!/bin/bash -x
      
      #JDK_HOME=/opt/jdk1.6.0_30
      JDK_HOME=/opt/jdk1.7.0_17
      
      JERSEY_HOME=/.../jes7.1/bundles/jersey
      JERSEY_CLIENT_CLASSPATH=$JERSEY_HOME/javax.ws.rs-api.jar:$JERSEY_HOME/jersey-common.jar:$JERSEY_HOME/jersey-client.jar:$JERSEY_HOME/hk2-api.jar:$JERSEY_HOME/hk2-locator.jar:$JERSEY_HOME/hk2-utils.jar:$JERSEY_HOME/guava.jar:$JERSEY_HOME/cglib.jar:$JERSEY_HOME/javax.inject.jar:$JERSEY_HOME/javax.annotation-api.jar:$JERSEY_HOME/osgi-resource-locator.jar
      
      $JDK_HOME/bin/javac -cp $JERSEY_CLIENT_CLASSPATH:. JerseyConnectTest.java
      $JDK_HOME/bin/java  -cp $JERSEY_CLIENT_CLASSPATH:. JerseyConnectTest
      

        Activity

        Hide
        Adam Lindenthal added a comment -

        If failure occurred on write, the attempt to close and commit stream is skipped, so the exception is not logged in that case.

        Show
        Adam Lindenthal added a comment - If failure occurred on write, the attempt to close and commit stream is skipped, so the exception is not logged in that case.

          People

          • Assignee:
            Adam Lindenthal
            Reporter:
            Jakub Podlesak
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Time Spent - 12 hours Remaining Estimate - 3 hours
              3h
              Logged:
              Time Spent - 12 hours Remaining Estimate - 3 hours
              12h