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

stapler implements Servlet API 2.5 yet Jenkins requires 3.1

    XMLWordPrintable

Details

    Description

      Stapler implements only the servlet 2.5 API - yet Jenkins uses 3.1

      If you attempt to use parts of the 3.1 API on a StaplerRequest or StaplerResponse then wierd/bad things could happen depending on what you get underneath..

      I have not observed any issues yet - but if you get a org.kohsuke.stapler.StaplerResponseWrapper rather than a org.kohsuke.stapler.ResponseImpl then things are liable to blow up. the same probably applies to StaplerRequest sub classes.

      Attachments

        Issue Links

          Activity

            oleg_nenashev Oleg Nenashev added a comment -

            teilo Please create a bug in https://github.com/stapler/stapler/issues
            Stapler is being governed outside the Jenkins org

            oleg_nenashev Oleg Nenashev added a comment - teilo Please create a bug in https://github.com/stapler/stapler/issues Stapler is being governed outside the Jenkins org
            oleg_nenashev Oleg Nenashev added a comment -

             BTW it seems we have seen it in the wild

            oleg_nenashev Oleg Nenashev added a comment -  BTW it seems we have seen it in the wild
            teilo James Nord added a comment -

            Added link to newly created stapler issue

            teilo James Nord added a comment - Added link to newly created stapler issue
            oleg_nenashev Oleg Nenashev added a comment - - edited

            Below you can find the log, which I see in the wild. Likely it happens, because Remoting classloaded  Servlet API 2.x on the agent side and then cached it. Not 100% sure

            {noformat}

            06:56:57 FATAL: Remote call on JNLP4-connect connection from AGENT failed
            06:56:57 java.util.MissingResourceException: Can't find bundle for base name javax.servlet.LocalStrings, locale en_US
            06:56:57 at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499)
            06:56:57 at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322)
            06:56:57 at java.util.ResourceBundle.getBundle(ResourceBundle.java:721)
            06:56:57 at javax.servlet.GenericServlet.<clinit>(GenericServlet.java:95)
            06:56:57 at hudson.model.Node$Mode.<clinit>(Node.java:592)
            06:56:57 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            06:56:57 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            06:56:57 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            06:56:57 at java.lang.reflect.Method.invoke(Method.java:606)
            06:56:57 at java.lang.Class.getEnumConstantsShared(Class.java:3046)
            06:56:57 at java.lang.Class.getEnumConstants(Class.java:3024)
            06:56:57 at jenkins.model.Jenkins.<clinit>(Jenkins.java:5077)
            06:56:57 at hudson.model.Computer.<clinit>(Computer.java:1719)
            06:56:57 at hudson.util.ProcessTree.getKillers(ProcessTree.java:156)
            06:56:57 at hudson.util.ProcessTree$OSProcess.killByKiller(ProcessTree.java:217)
            06:56:57 at hudson.util.ProcessTree$Windows$1.killRecursively(ProcessTree.java:430)
            06:56:57 at hudson.util.ProcessTree$Windows.killAll(ProcessTree.java:490)
            06:56:57 at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:996)
            06:56:57 at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:987)
            06:56:57 at hudson.remoting.UserRequest.perform(UserRequest.java:153)
            06:56:57 at hudson.remoting.UserRequest.perform(UserRequest.java:50)
            06:56:57 at hudson.remoting.Request$2.run(Request.java:336)
            06:56:57 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
            06:56:57 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
            06:56:57 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
            06:56:57 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
            06:56:57 at hudson.remoting.Engine$1$1.run(Engine.java:94)
            06:56:57 at java.lang.Thread.run(Thread.java:744)
            06:56:57 Caused: java.lang.ExceptionInInitializerError
            06:56:57 at hudson.model.Node$Mode.<clinit>(Node.java:592)
            06:56:57 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            06:56:57 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            06:56:57 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            06:56:57 at java.lang.reflect.Method.invoke(Method.java:606)
            06:56:57 at java.lang.Class.getEnumConstantsShared(Class.java:3046)
            06:56:57 at java.lang.Class.getEnumConstants(Class.java:3024)
            06:56:57 at jenkins.model.Jenkins.<clinit>(Jenkins.java:5077)
            06:56:57 at hudson.model.Computer.<clinit>(Computer.java:1719)
            06:56:57 at hudson.util.ProcessTree.getKillers(ProcessTree.java:156)
            06:56:57 at hudson.util.ProcessTree$OSProcess.killByKiller(ProcessTree.java:217)
            06:56:57 at hudson.util.ProcessTree$Windows$1.killRecursively(ProcessTree.java:430)
            06:56:57 at hudson.util.ProcessTree$Windows.killAll(ProcessTree.java:490)
            06:56:57 at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:996)
            06:56:57 at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:987)
            06:56:57 at hudson.remoting.UserRequest.perform(UserRequest.java:153)
            06:56:57 at hudson.remoting.UserRequest.perform(UserRequest.java:50)
            06:56:57 at hudson.remoting.Request$2.run(Request.java:336)
            06:56:57 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
            06:56:57 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
            06:56:57 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
            06:56:57 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
            06:56:57 at hudson.remoting.Engine$1$1.run(Engine.java:94)
            06:56:57 at java.lang.Thread.run(Thread.java:744)
            06:56:57 at ......remote call to JNLP4-connect connection from splw764bt301p.caecorp.cae.com/142.39.32.44:60229(Native Method)
            06:56:57 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
            06:56:57 at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
            06:56:57 at hudson.remoting.Channel.call(Channel.java:830)
            06:56:57 Caused: java.io.IOException: Remote call on JNLP4-connect connection from splw764bt301p.caecorp.cae.com/142.39.32.44:60229 failed
            06:56:57 at hudson.remoting.Channel.call(Channel.java:838)
            06:56:57 at hudson.Launcher$RemoteLauncher.kill(Launcher.java:984)
            06:56:57 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:540)
            06:56:57 at hudson.model.Run.execute(Run.java:1728)
            06:56:57 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
            06:56:57 at hudson.model.ResourceController.execute(ResourceController.java:98)
            06:56:57 at hudson.model.Executor.run(Executor.java:405)

            {noformat}

            oleg_nenashev Oleg Nenashev added a comment - - edited Below you can find the log, which I see in the wild. Likely it happens, because Remoting classloaded  Servlet API 2.x on the agent side and then cached it. Not 100% sure {noformat} 06:56:57 FATAL: Remote call on JNLP4-connect connection from AGENT failed 06:56:57 java.util.MissingResourceException: Can't find bundle for base name javax.servlet.LocalStrings, locale en_US 06:56:57 at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499) 06:56:57 at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322) 06:56:57 at java.util.ResourceBundle.getBundle(ResourceBundle.java:721) 06:56:57 at javax.servlet.GenericServlet.<clinit>(GenericServlet.java:95) 06:56:57 at hudson.model.Node$Mode.<clinit>(Node.java:592) 06:56:57 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 06:56:57 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 06:56:57 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 06:56:57 at java.lang.reflect.Method.invoke(Method.java:606) 06:56:57 at java.lang.Class.getEnumConstantsShared(Class.java:3046) 06:56:57 at java.lang.Class.getEnumConstants(Class.java:3024) 06:56:57 at jenkins.model.Jenkins.<clinit>(Jenkins.java:5077) 06:56:57 at hudson.model.Computer.<clinit>(Computer.java:1719) 06:56:57 at hudson.util.ProcessTree.getKillers(ProcessTree.java:156) 06:56:57 at hudson.util.ProcessTree$OSProcess.killByKiller(ProcessTree.java:217) 06:56:57 at hudson.util.ProcessTree$Windows$1.killRecursively(ProcessTree.java:430) 06:56:57 at hudson.util.ProcessTree$Windows.killAll(ProcessTree.java:490) 06:56:57 at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:996) 06:56:57 at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:987) 06:56:57 at hudson.remoting.UserRequest.perform(UserRequest.java:153) 06:56:57 at hudson.remoting.UserRequest.perform(UserRequest.java:50) 06:56:57 at hudson.remoting.Request$2.run(Request.java:336) 06:56:57 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) 06:56:57 at java.util.concurrent.FutureTask.run(FutureTask.java:262) 06:56:57 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 06:56:57 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 06:56:57 at hudson.remoting.Engine$1$1.run(Engine.java:94) 06:56:57 at java.lang.Thread.run(Thread.java:744) 06:56:57 Caused: java.lang.ExceptionInInitializerError 06:56:57 at hudson.model.Node$Mode.<clinit>(Node.java:592) 06:56:57 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 06:56:57 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 06:56:57 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 06:56:57 at java.lang.reflect.Method.invoke(Method.java:606) 06:56:57 at java.lang.Class.getEnumConstantsShared(Class.java:3046) 06:56:57 at java.lang.Class.getEnumConstants(Class.java:3024) 06:56:57 at jenkins.model.Jenkins.<clinit>(Jenkins.java:5077) 06:56:57 at hudson.model.Computer.<clinit>(Computer.java:1719) 06:56:57 at hudson.util.ProcessTree.getKillers(ProcessTree.java:156) 06:56:57 at hudson.util.ProcessTree$OSProcess.killByKiller(ProcessTree.java:217) 06:56:57 at hudson.util.ProcessTree$Windows$1.killRecursively(ProcessTree.java:430) 06:56:57 at hudson.util.ProcessTree$Windows.killAll(ProcessTree.java:490) 06:56:57 at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:996) 06:56:57 at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:987) 06:56:57 at hudson.remoting.UserRequest.perform(UserRequest.java:153) 06:56:57 at hudson.remoting.UserRequest.perform(UserRequest.java:50) 06:56:57 at hudson.remoting.Request$2.run(Request.java:336) 06:56:57 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) 06:56:57 at java.util.concurrent.FutureTask.run(FutureTask.java:262) 06:56:57 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 06:56:57 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 06:56:57 at hudson.remoting.Engine$1$1.run(Engine.java:94) 06:56:57 at java.lang.Thread.run(Thread.java:744) 06:56:57 at ......remote call to JNLP4-connect connection from splw764bt301p.caecorp.cae.com/142.39.32.44:60229(Native Method) 06:56:57 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545) 06:56:57 at hudson.remoting.UserResponse.retrieve(UserRequest.java:253) 06:56:57 at hudson.remoting.Channel.call(Channel.java:830) 06:56:57 Caused: java.io.IOException: Remote call on JNLP4-connect connection from splw764bt301p.caecorp.cae.com/142.39.32.44:60229 failed 06:56:57 at hudson.remoting.Channel.call(Channel.java:838) 06:56:57 at hudson.Launcher$RemoteLauncher.kill(Launcher.java:984) 06:56:57 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:540) 06:56:57 at hudson.model.Run.execute(Run.java:1728) 06:56:57 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 06:56:57 at hudson.model.ResourceController.execute(ResourceController.java:98) 06:56:57 at hudson.model.Executor.run(Executor.java:405) {noformat}
            teilo James Nord added a comment -

            working on the upstream stapler issue.

            teilo James Nord added a comment - working on the upstream stapler issue.
            jglick Jesse Glick added a comment -

            I guess this is now considered resolved.

            jglick Jesse Glick added a comment - I guess this is now considered resolved.

            People

              Unassigned Unassigned
              teilo James Nord
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: