开发者

Jenkins slave throws "Classloading from system classloader disabled" exception

开发者 https://www.devze.com 2023-03-19 05:14 出处:网络
When running a Maven2 job on a slave instance (Master on AIX 5.3; slave on Windows 2008(R2)), I get the following message (complete stack trace pasted in below): \"java.lang.ClassNotFoundException: Cl

When running a Maven2 job on a slave instance (Master on AIX 5.3; slave on Windows 2008(R2)), I get the following message (complete stack trace pasted in below): "java.lang.ClassNotFoundException: Classloading from system classloader disabled". This happens with the first job after the slave instance is started (it's running as a Windows service). After that, I get a "java.lang.NoClassDefFoundError: Could not initialize class hudson.maven.MavenModuleSetBuild" error.

If I create a freestyle job, and include the maven command as a batch command to run on the slave, it works fine. The Maven2 job appears to locate Maven on the slave machine, but it apparently can't find the maven-plugin (probably due to the classloading error).

I've searched and posted a ticket to the jenkins-ci site, but no luck as of yet. Has anyone run into this problem?

Stacktrace:
Found mavenVersion 2.2.1 from file jar:file:/C:/apache-maven-2.2.1/lib/maven-2.2.1-uber.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
Parsing POMs
ERROR: Failed to parse POMs
hudson.util.IOException2: remote file operation failed: c:\jenkins-slave\workspace\AO_SISO_AT-smoketest-CIT1 at hudson.remoting.Channel@7b827b82:10.40.163.105
    at hudson.FilePath.act(FilePath.java:752)
    at hudson.FilePath.act(FilePath.java:738)
    at hudson.maven.MavenModuleSetBuild$RunnerImpl.parsePoms(MavenModuleSetBuild.java:817)
    at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:617)
    at hudson.model.Ab开发者_StackOverflowstractBuild$AbstractRunner.run(AbstractBuild.java:429)
    at hudson.model.Run.run(Run.java:1374)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:467)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:145)
Caused by: java.io.IOException: Remote call on 10.40.163.105 failed
    at hudson.remoting.Channel.call(Channel.java:652)
    at hudson.FilePath.act(FilePath.java:745)
    ... 8 more
Caused by: java.lang.ExceptionInInitializerError
    at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1236)
    at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1110)
    at hudson.FilePath$FileCallableWrapper.call(FilePath.java:1956)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:270)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at hudson.remoting.Engine$1$1.run(Engine.java:60)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.thoughtworks.xstream.XStream$InitializationException: Could not instantiate converter : com.thoughtworks.xstream.converters.extended.DurationConverter : null
    at com.thoughtworks.xstream.XStream.dynamicallyRegisterConverter(XStream.java:735)
    at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:699)
    at com.thoughtworks.xstream.XStream.<init>(XStream.java:445)
    at com.thoughtworks.xstream.XStream.<init>(XStream.java:385)
    at com.thoughtworks.xstream.XStream.<init>(XStream.java:323)
    at hudson.util.XStream2.<init>(XStream2.java:62)
    at hudson.model.Run.<clinit>(Run.java:1867)
    ... 13 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.thoughtworks.xstream.XStream.dynamicallyRegisterConverter(XStream.java:728)
    ... 19 more
Caused by: javax.xml.datatype.DatatypeConfigurationException: Provider org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl not found
    at javax.xml.datatype.DatatypeFactory.newInstance(Unknown Source)
    at com.thoughtworks.xstream.converters.extended.DurationConverter.<init>(DurationConverter.java:33)
    ... 24 more
Caused by: java.lang.ClassNotFoundException: Classloading from system classloader disabled
    at java.lang.Throwable.<init>(Throwable.java:56)
    at java.lang.Throwable.<init>(Throwable.java:80)
    at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:80)
    at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch2(RemoteClassLoader.java:399)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:615)
    at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:274)
    at hudson.remoting.Request$2.run(Request.java:270)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:284)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
    at java.lang.Thread.run(Thread.java:799)


I had similar issue. Researched internet but did not get any solution. Finally debugged the jenkins/hudson and resolved this issue.

The root cause of this error is that recent versions of jenkin is shipped with xml parser within jenkins.war file. Looks like if your server already has this jar file, it won't let jenkin application to reload its own version of xml parsers. So to resolve this issue I have removed file xercesImpl-2.9.1.jar from WEB-INF/lib directory of jenkins.war file. After that replaced existing war file and restarted server. And it worked as without any problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号