Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-57383

Issue when testing proxy

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hello,

       

      When I try to test the proxy (in Manage Plugins page), after having configured a corporate proxy (which works because I manage to pull all plugins), for every website I test I get a "Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer" error.

       

      Thank you much in advance for the fixing.

       

      Excellent end of week to all of you.

        Attachments

          Activity

          Hide
          _ediri E D added a comment -

          I can confirm the error too!

          Jenkins Version: Jenkins ver. 2.176.1

          java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
          	at org.apache.commons.httpclient.HttpMethodDirector.applyConnectionParams(HttpMethodDirector.java:360)
          	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:404)
          	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:178)
          	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:404)
          	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:330)
          	at hudson.ProxyConfiguration$DescriptorImpl.doValidateProxy(ProxyConfiguration.java:409)
          	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
          	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
          	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
          	at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:77)
          	at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
          	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
          	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
          	at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:535)
          	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
          	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
          
          Show
          _ediri E D added a comment - I can confirm the error too! Jenkins Version:  Jenkins ver. 2.176.1 java.lang.ClassCastException: java.lang. Long cannot be cast to java.lang. Integer at org.apache.commons.httpclient.HttpMethodDirector.applyConnectionParams(HttpMethodDirector.java:360) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:404) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:178) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:404) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:330) at hudson.ProxyConfiguration$DescriptorImpl.doValidateProxy(ProxyConfiguration.java:409) at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408) at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:77) at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145) at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:535) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
          Hide
          brianeray Brian Ray added a comment - - edited

          Same here. This may be a shot in the dark but on Github I diffed 2.164.3 and 2.176.1 with special focus on ProxyConfiguration.

          Note the new int cast here.

           private static final int DEFAULT_CONNECT_TIMEOUT_MILLIS = SystemProperties.getInteger("hudson.ProxyConfiguration.DEFAULT_CONNECT_TIMEOUT_MILLIS", (int)TimeUnit.SECONDS.toMillis(20));
          

          That constant is used in doValidateProxy(String,String,etc.) a few lines above 409. Since that's before the LOC from the stack trace I wonder if it is the proximate cause. Even though it does not quite seem to line up with the LOC and location at which the exception is being thrown.

          Show
          brianeray Brian Ray added a comment - - edited Same here. This may be a shot in the dark but on Github I diffed 2.164.3 and 2.176.1 with special focus on ProxyConfiguration . Note the new int cast here . private static final int DEFAULT_CONNECT_TIMEOUT_MILLIS = SystemProperties.getInteger( "hudson.ProxyConfiguration.DEFAULT_CONNECT_TIMEOUT_MILLIS" , ( int )TimeUnit.SECONDS.toMillis(20)); That constant is used in doValidateProxy(String,String,etc.) a few lines above 409 . Since that's before the LOC from the stack trace I wonder if it is the proximate cause. Even though it does not quite seem to line up with the LOC and location at which the exception is being thrown.
          Hide
          brianeray Brian Ray added a comment -

          Adding core Component owing to possible culprit noted in previous comment.

          Show
          brianeray Brian Ray added a comment - Adding core Component owing to possible culprit noted in previous comment.

            People

            • Assignee:
              Unassigned
              Reporter:
              illan_ruldacunha Illan RUL-DA CUNHA
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: