Closed timja closed 6 years ago
We found a workaround - which is not nice.
The workaround is to put the servlet-api jar (containing ServletContextListener.class) on the classpath of a Maven build. We did this by copying the jar (http://search.maven.org/remotecontent?filepath=javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar) into the /lib/ext folder of the JRE.
This is not nice but I wanted to document it here in case somebody else runs into this problem.
Some explanations:
It looks like the exception stems from a remote process and we suspect it comes from Maven builds (Jobs with Maven Project Type). As these run in their own Java Process it looks like the Systemproperties are somewhat loaded in that process but don't have the necessary dependencies.
After looking in the pom.xml on Github, we saw the dependency to the javax.servlet-api in scope "provided".
The Jar itself is contained in the winstone container but not in standard Java libraries.
As cannot figure out when this happens it was worth a try to just provide the class to see if it works or produces a different error.
Builds are stable since two days - but still .. this bugs needs to be fixed.
it's just another issue with Maven interceptors. SystemProperties class in Jenkins requires ServletContextListener, and seems the the missing class causes fatal failure, because the class is not being sent over the channel due to security reasons IIRC.
Code changed in jenkins
User: Nicolas De Loof
Path:
docker-plugin/pom.xml
docker-plugin/src/main/java/com/nirima/jenkins/plugins/docker/utils/JenkinsUtils.java
docker-plugin/src/main/java/io/jenkins/docker/pipeline/DockerNodeStep.java
docker-plugin/src/main/java/io/jenkins/docker/pipeline/DockerNodeStepExecution.java
docker-plugin/src/main/resources/io/jenkins/docker/pipeline/DockerNodeStep/config.jelly
http://jenkins-ci.org/commit/docker-plugin/9bf481aac670959542dcb8f576e1e803b422b895
Log:
upgrade to latest Jenkins and dependencies
workaround for resurrecting JENKINS-39669
I think this case was fixed in JENKINS-46386.
[Duplicates: JENKINS-46386]
We have a similar exception as in
JENKINS-35184but this happens with builds only on master. In the hope that it is fixed we upgraded to 2.19.2 but it didn't help.The exception occurs on a random basis and cannot be pinpointed to a specific build, plugin, time,..
When it happens, all builds after that tend to fail as well. We currently have to do a restart of Jenkins on a daily basis and sometimes multiple times.
Restarting Jenkins is the only workaround we currently have and is growing into a pain especially when we are releasing. This issue is a blocker for us.
Our setup is:
StackTrace from the build logs:
Installed plugins
We added additional loggers: hudson.remoting.RemoteClassLoader and org.jenkinsci.plugins but they did not provide helpful information.
As discussed in
JENKINS-35184this might be caused by a plugin especially the maven plugin thus I set it as component as well.If there is more information needed please state so, we will gladly help to get this fixed
Originally reported by robert, imported from: Builds fail when loading jenkins.util.SystemProperties caused by java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener