Own Cloud Plugin: "ClassNotFoundException: javax.servlet.ServletException" when running job for the first time

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Own Cloud Plugin: "ClassNotFoundException: javax.servlet.ServletException" when running job for the first time

Johannes Schneider
Hi guys,

I have a strange problem:
I have created a new plugin that provides a cloud implementation.

I create new nodes/computers and connect them using JNLP.

The first time a job runs on the newly created computer it fails with that log output:

```
FATAL: Remote call on JNLP4-connect connection from localhost/127.0.0.1:47026 failed
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection to localhost/127.0.0.1:44145
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
		at hudson.remoting.Request.call(Request.java:202)
		at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:286)
		at com.sun.proxy.$Proxy6.fetch(Unknown Source)
		at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:315)
		at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
		at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
		at hudson.util.ProcessTree.get(ProcessTree.java:399)
		at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1090)
		at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1081)
		at hudson.remoting.UserRequest.perform(UserRequest.java:212)
		at hudson.remoting.UserRequest.perform(UserRequest.java:54)
		at hudson.remoting.Request$2.run(Request.java:369)
		at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
		at java.util.concurrent.FutureTask.run(FutureTask.java:266)
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
		at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
java.lang.ClassNotFoundException: javax.servlet.ServletException
	at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch(RemoteClassLoader.java:808)
	at sun.reflect.GeneratedMethodAccessor209.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:929)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at org.jenkinsci.remoting.CallableDecorator.call(CallableDecorator.java:19)
	at hudson.remoting.CallableDecoratorList$1.call(CallableDecoratorList.java:21)
	at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
	at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from localhost/127.0.0.1:47026
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
		at hudson.remoting.Channel.call(Channel.java:955)
		at hudson.Launcher$RemoteLauncher.kill(Launcher.java:1078)
		at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
		at hudson.model.Run.execute(Run.java:1798)
		at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
		at hudson.model.ResourceController.execute(ResourceController.java:97)
		at hudson.model.Executor.run(Executor.java:429)
Caused: java.lang.NoClassDefFoundError: javax/servlet/ServletException
	at hudson.util.ProcessTree.get(ProcessTree.java:399)
	at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1090)
	at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1081)
	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
	at java.lang.Thread.run(Thread.java:748)
Caused: java.io.IOException: Remote call on JNLP4-connect connection from localhost/127.0.0.1:47026 failed
	at hudson.remoting.Channel.call(Channel.java:961)
	at hudson.Launcher$RemoteLauncher.kill(Launcher.java:1078)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
	at hudson.model.Run.execute(Run.java:1798)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
FATAL: Remote call on JNLP4-connect connection from localhost/127.0.0.1:47026 failed
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection to localhost/127.0.0.1:44145
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
		at hudson.remoting.Request.call(Request.java:202)
		at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:286)
		at com.sun.proxy.$Proxy6.fetch(Unknown Source)
		at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:315)
		at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
		at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
		at hudson.util.ProcessTree.get(ProcessTree.java:399)
		at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1090)
		at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1081)
		at hudson.remoting.UserRequest.perform(UserRequest.java:212)
		at hudson.remoting.UserRequest.perform(UserRequest.java:54)
		at hudson.remoting.Request$2.run(Request.java:369)
		at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
		at java.util.concurrent.FutureTask.run(FutureTask.java:266)
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
		at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
java.lang.ClassNotFoundException: javax.servlet.ServletException
	at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch(RemoteClassLoader.java:808)
	at sun.reflect.GeneratedMethodAccessor209.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:929)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at org.jenkinsci.remoting.CallableDecorator.call(CallableDecorator.java:19)
	at hudson.remoting.CallableDecoratorList$1.call(CallableDecoratorList.java:21)
	at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
	at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from localhost/127.0.0.1:47026
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
		at hudson.remoting.Channel.call(Channel.java:955)
		at hudson.Launcher$RemoteLauncher.kill(Launcher.java:1078)
		at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
		at hudson.model.Run.execute(Run.java:1798)
		at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
		at hudson.model.ResourceController.execute(ResourceController.java:97)
		at hudson.model.Executor.run(Executor.java:429)
Caused: java.lang.NoClassDefFoundError: javax/servlet/ServletException
	at hudson.util.ProcessTree.get(ProcessTree.java:399)
	at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1090)
	at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1081)
	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
	at java.lang.Thread.run(Thread.java:748)
Caused: java.io.IOException: Remote call on JNLP4-connect connection from localhost/127.0.0.1:47026 failed
	at hudson.remoting.Channel.call(Channel.java:961)
	at hudson.Launcher$RemoteLauncher.kill(Launcher.java:1078)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
	at hudson.model.Run.execute(Run.java:1798)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
```

I tried to debug it further and could narrow it down.

I think the exception is thrown the first time in the Method
hudson.util.ProcessTree#get() (Line 399).

Probably calling "SlaveComputer.getChannelToMaster()" fails.
SlaveComputer references javax.servlet.ServletException which seems to be unavailable there.


The agent.jar that is downloaded from Jenkins does *not* contain the javax.servlet.ServletException class.


Running the job a second time on the same computer works just fine.
The exception occurs after the job has finished.


Any idea how to solve that?


Regards,

Johannes


--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/8feed20e-2416-4c05-b58d-15b4c3f7d56d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Own Cloud Plugin: "ClassNotFoundException: javax.servlet.ServletException" when running job for the first time

Jesse Glick-4
This is a longstanding JENKINS-26677 that has never been
satisfactorily resolved, though there have been workarounds. You can
see it without any custom plugin, just using `CommandLauncher` with
`jenkinsci/docker-agent`, depending on how Jenkins is being run and
what build steps you use. The problem relates to how the Servlet API
is loaded from the servlet container hosting the Jenkins master.

Anyway, if you are able to reproduce, please give feedback on
https://github.com/jenkinsci/jenkins/pull/3778. Assuming the build is
successful, it should deploy an incremental version
2.154-rc27545.0e85c9fb206a which you can use as `jenkins.version` in
your POM (or passing via `-D` to `hpi:run`).

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2GQ%3DKpwMi6tTrkkTno%2BpuTYwhD9%3Dt8Hkm_Ggjh47fr%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Own Cloud Plugin: "ClassNotFoundException: javax.servlet.ServletException" when running job for the first time

Johannes Schneider
I will try
 
2.154-rc27545.0e85c9fb206a

as soon as it is build.

One question: What are the workarounds? What can be done?

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/3fce43eb-c21f-4adb-814e-c2b315cbc6e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Own Cloud Plugin: "ClassNotFoundException: javax.servlet.ServletException" when running job for the first time

Jesse Glick-4
On Tue, Nov 27, 2018 at 11:40 AM Johannes Schneider
<[hidden email]> wrote:
> What are the workarounds?

I am not aware of any.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0NqRHxzytuyZcD5w_kEu1%2BzrtFr6ABrkBNzABBWcR4pQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Own Cloud Plugin: "ClassNotFoundException: javax.servlet.ServletException" when running job for the first time

Johannes Schneider
In reply to this post by Jesse Glick-4
Hi Jesse,

could you give me a hint how to try it out?
I tried

mvn hpi:run -Djenkins.version=2.154-rc27545.0e85c9fb206a

which does not work (of course) because I don't have a snapshot repository configured. A quick search didn't give me
the the URL for the snapshot repository. Could you help me out?


Am Dienstag, 27. November 2018 16:58:26 UTC+1 schrieb Jesse Glick:
it should deploy an incremental version
2.154-rc27545.0e85c9fb206a which you can use as `jenkins.version` in
your POM (or passing via `-D` to `hpi:run`).

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/e2ac800c-0ae7-4edb-9cfd-423c655ba605%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Own Cloud Plugin: "ClassNotFoundException: javax.servlet.ServletException" when running job for the first time

Daniel Beck


> On 5. Dec 2018, at 18:01, Johannes Schneider <[hidden email]> wrote:
>
> which does not work (of course) because I don't have a snapshot repository configured. A quick search didn't give me
> the the URL for the snapshot repository. Could you help me out?
>

Incrementals are deployed to https://repo.jenkins-ci.org/incrementals/

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/A3911619-D4B1-4672-9974-151BC497538F%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Own Cloud Plugin: "ClassNotFoundException: javax.servlet.ServletException" when running job for the first time

Baptiste MATHUS
Note that the Incrementals repo is *not* configured behind http://repo.jenkins-ci.org/public/ group repo on purpose.
So to enable automatic addition of that repository, you must add -Pconsume-incrementals to your command line call, and hence use a recent parent pom. See https://github.com/jenkinsci/plugin-pom

I think some ~3.18+ should be enough, but I'd recommend updating to latest 3.28 or 3.29 to avoid issues.

Le mer. 5 déc. 2018 à 21:23, Daniel Beck <[hidden email]> a écrit :


> On 5. Dec 2018, at 18:01, Johannes Schneider <[hidden email]> wrote:
>
> which does not work (of course) because I don't have a snapshot repository configured. A quick search didn't give me
> the the URL for the snapshot repository. Could you help me out?
>

Incrementals are deployed to https://repo.jenkins-ci.org/incrementals/

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/A3911619-D4B1-4672-9974-151BC497538F%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANWgJS5dtBwShE22sVnE3dhJO3DUTebBrZehw5xm82%3DZX1FJxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Own Cloud Plugin: "ClassNotFoundException: javax.servlet.ServletException" when running job for the first time

Johannes Schneider
But where are the snapshots published to? I can't find the version 2.154-rc27545.0e85c9fb206a
on https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/main/jenkins-core/

I am running:
mvn hpi:run -Djenkins.version=2.154-rc27545.0e85c9fb206a -Pconsume-incrementals

Which does not work since https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/main/jenkins-core/ doesn't contain that version.


Am Donnerstag, 6. Dezember 2018 07:23:16 UTC+1 schrieb Baptiste Mathus:
Note that the Incrementals repo is *not* configured behind <a href="http://repo.jenkins-ci.org/public/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frepo.jenkins-ci.org%2Fpublic%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHib66Q82vjFOrEsbWgmwQvlvCK5w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frepo.jenkins-ci.org%2Fpublic%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHib66Q82vjFOrEsbWgmwQvlvCK5w&#39;;return true;">http://repo.jenkins-ci.org/public/ group repo on purpose.
So to enable automatic addition of that repository, you must add -Pconsume-incrementals to your command line call, and hence use a recent parent pom. See <a href="https://github.com/jenkinsci/plugin-pom" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fplugin-pom\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG1BpmosyUu9SsMm4AppfFqlN8gFw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fplugin-pom\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG1BpmosyUu9SsMm4AppfFqlN8gFw&#39;;return true;">https://github.com/jenkinsci/plugin-pom

I think some ~3.18+ should be enough, but I'd recommend updating to latest 3.28 or 3.29 to avoid issues.

Le mer. 5 déc. 2018 à 21:23, Daniel Beck <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="Pwcix17XBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">m...@...> a écrit :

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/bfaf26b7-6787-462d-8fd1-6e3567024938%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Own Cloud Plugin: "ClassNotFoundException: javax.servlet.ServletException" when running job for the first time

Jesse Glick-4
On Mon, Dec 10, 2018 at 5:07 AM Johannes Schneider
<[hidden email]> wrote:
> But where are the snapshots published to? I can't find the version 2.154-rc27545.0e85c9fb206a

Because that build was unstable, and there has not been a stable build
in this PR. Incrementals only get deployed when a build is stable
_and_ the PR is up to date with the base branch. I filed

https://github.com/jenkinsci/jenkins/pull/3799

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2%3DEvHY6VQdAT%2Bf6x6YLgZOPx0NrbDV5%3DgBMt9EhGs3tA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.