Jenkins: Maven can run "clean install", but not "--version" - maven

I have a Maven job in Jenkins. It can run "clean install", but not a simple "--version". It actually does output all the info from "mvn --version", but then fails with a "java.lang.reflect.InvocationTargetException".
Anyone knows why this is failing ??
Log output:
[workspace] $ java -cp /home/gerrit/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.2.jar:/home/gerrit/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.4/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /home/gerrit/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.4 /home/gerrit/.jenkins/war/WEB-INF/lib/remoting-2.23.jar /home/gerrit/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.2.jar 56672
<===[JENKINS REMOTING CAPACITY]===>channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f /home/gerrit/.jenkins/jobs/<project>/workspace/pom.xml --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /home/gerrit/.jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.4
Java version: 1.7.0, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.7.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-5-xen-amd64", arch: "amd64", family: "unix"
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.maven.cli.MavenExecutionRequestsBuilderException
at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:148)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.getMavenExecutionRequest(Maven3Launcher.java:94)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:77)
... 18 more
Caused by: org.apache.maven.cli.MavenCli$ExitException
at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.cli(DefaultMavenExecutionRequestBuilder.java:238)
at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:120)
... 20 more
channel stopped
ERROR: Failed to parse POMs
hudson.util.IOException2: java.lang.reflect.InvocationTargetException
at hudson.maven.Maven3Builder.call(Maven3Builder.java:162)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.Exception: java.lang.reflect.InvocationTargetException
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:161)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
... 10 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
... 11 more
Caused by: org.apache.maven.cli.MavenExecutionRequestsBuilderException
at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:148)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.getMavenExecutionRequest(Maven3Launcher.java:94)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:77)
... 18 more
Caused by: org.apache.maven.cli.MavenCli$ExitException
at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.cli(DefaultMavenExecutionRequestBuilder.java:238)
at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:120)
... 20 more
Build does not meet criteria for workspace archiving - result is not at least SUCCESS.
An attempt to send an e-mail to empty list of recipients, ignored.
Finished: FAILURE

This appears to be a bug in jenkins and I've raised a ticket in their bug tracker:
https://issues.jenkins-ci.org/browse/JENKINS-21753
In the mean time, the only viable workaround that I've found is to use Maven 2 instead.

I was having this error. I use git. I specified Git repository into root of project (http://user#github.com/project.git/PROJECT) and get a good build.
Before I use http://user#github.com/project.git
And Build is good when I use maven 3.0.4

Related

Hudson 3.3.3 compatibility with maven 3.2.5 issue

recently we have upgraded our Oracle Server Bus to 12.2.1 with Maven 3.2.5 and also upgraded Hudson from 3.2.2 to 3.3.3.
When executing mvn clean install build of type Build a Maven 2/3 project (Legacy)
we are seeing errors.The same job runs with no errors in hudson 3.2.2 with maven 3.0.5.
Also tried with Build a free-style software job and that picking default maven home and running osb plug in issues.
Error:-
[CommonResources] $ /oraapp/java/jdk1.8.0_121/bin/java -cp /oraapp/hudson122_1/plugins/maven-plugin/WEB-INF/lib/maven3-agent-3.0.2.jar:/oraapp/1221/product/fmw/oracle_common/modules/org.apache.maven_3.2.5/boot/plexus-classworlds-2.5.2.jar org.jvnet.hudson.maven3.agent.Maven3Main /oraapp/1221/product/fmw/oracle_common/modules/org.apache.maven_3.2.5 /oraapp/config/domains/soadevt/servers/soa_server1/tmp/_WL_user/hudson1221/vwczzi/war/WEB-INF/lib/hudson-remoting-3.0.3.jar /oraapp/hudson122_1/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-3.0.2.jar 41686
<===[HUDSON REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /oraapp/hudson122_1/jobs/CommonResources_S-TFSIHUB_1221/workspace/CommonResources/pom.xml clean install -Dgroupid=CSSIntegrationhub_CUSTSVC -Dversion=RL1.0_110717 -DoracleServerUrl=http://hostname:7001 -DoracleUsername=x2krkanu -DoraclePassword=******** -Dcustomization=CommonResources_DEV_CF.xml -DoracleHome=/oraapp/product/fmw
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:146)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:124)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
at hudson.remoting.UserRequest.perform(UserRequest.java:107)
at hudson.remoting.UserRequest.perform(UserRequest.java:41)
at hudson.remoting.Request$2.run(Request.java:276)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/apache/maven/cli/MavenLoggerManager
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:73)
... 17 more
Caused by: java.lang.ClassNotFoundException: org.apache.maven.cli.MavenLoggerManager
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 18 more
channel stopped
ERROR: Failed to parse POMs
hudson.util.IOException2: java.lang.reflect.InvocationTargetException
at hudson.maven.Maven3Builder.call(Maven3Builder.java:189)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
at hudson.remoting.UserRequest.perform(UserRequest.java:107)
at hudson.remoting.UserRequest.perform(UserRequest.java:41)
at hudson.remoting.Request$2.run(Request.java:276)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.Exception: java.lang.reflect.InvocationTargetException
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:150)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:124)
... 9 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:146)
... 10 more
Caused by: java.lang.NoClassDefFoundError: org/apache/maven/cli/MavenLoggerManager
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:73)
... 17 more
Caused by: java.lang.ClassNotFoundException: org.apache.maven.cli.MavenLoggerManager
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 18 more
An attempt to send an e-mail to empty list of recipients, ignored.
[DEBUG] Skipping watched dependency update for build: CommonResources_S-TFSIHUB_1221 #19 due to result: FAILURE
Notifying upstream projects of job completion`enter code here`
Finished: FAILURE

Jenkins Project Maven

I'm having a problem with compiling a simple maven project in Jenkins, I don't understand what happened.
This project compiles perfectly out for Jenkins server.
I am using JDK 8, Maven 3.3.9, operation system Ubuntu Server.
Error Log:
Established TCP socket on 37158<===[JENKINS REMOTING CAPACITY]===>channel started Executing Maven: -N -B -f /var/lib/jenkins/workspace/AArcoOneProject/AArco-One-Pojo/pom.xml compile
java.lang.NullPointerException
at jenkins.maven3.agent.Maven32Main.launch(Maven32Main.java:186)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:133)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:68)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:332)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Lanzada por el usuario Diego Fernando Hidalgo Cornejo
Finished: ABORTED
FATAL: java.lang.reflect.InvocationTargetException
java.io.IOException: java.lang.reflect.InvocationTargetException
at hudson.maven.Maven3Builder.call(Maven3Builder.java:173)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:68)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:332)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at ......remote call to Channel to Maven [/usr/lib/jvm/java-8-oracle/bin/java, -cp, /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven33-agent-1.8.1.jar:/opt/apache-maven-3.3.3/boot/plexus-classworlds-2.5.2.jar:/opt/apache-maven-3.3.3/conf/logging, jenkins.maven3.agent.Maven33Main, /opt/apache-maven-3.3.3, /var/cache/jenkins/war/WEB-INF/lib/remoting-2.62.3.jar, /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven33-interceptor-1.8.1.jar, /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.8.1.jar, 37158](Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1433)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
at hudson.remoting.Channel.call(Channel.java:797)
at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:161)
at hudson.maven.MavenBuild$MavenBuildExecution.doRun(MavenBuild.java:880)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1720)
at hudson.maven.MavenBuild.run(MavenBuild.java:270)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:133)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:68)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:332)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.Exception: java.lang.NullPointerException
at jenkins.maven3.agent.Maven32Main.launch(Maven32Main.java:189)
... 14 more
Caused by: java.lang.NullPointerException
at jenkins.maven3.agent.Maven32Main.launch(Maven32Main.java:186)
... 14 more
Finished: FAILURE
Check which settings.xml file is in used, run mvn with -X , you will see in the start of the output which file is used.
I had the same issue, when mvn used the default file and we used another file on our local env.
BTW, did you install MVN on the slave or Jenkins did it for you?

Xcode: Cannot load JDBC driver class 'org.h2.Driver'

I'm using sonar-runner 2.4 with JDK 1.8 to build a sonar report on OSX.
It fails with the error Cannot load JDBC driver class 'org.h2.Driver'
Here's the full stack trace:
SonarQube Runner 2.4
Java 1.8.0_60 Oracle Corporation (64-bit)
Mac OS X 10.10.5 x86_64
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: /...../External/Sonar/sonar-runner/conf/sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Work directory: /...../External/Sonar/sonar-runner/bin/./.sonar
INFO: SonarQube Server 5.1
21:43:38.350 INFO - Load global repositories
21:43:39.809 INFO - Load global repositories (done) | time=1459ms
21:43:39.810 INFO - Server id: 20150902220143
21:43:39.811 INFO - User cache: /Users/...../.sonar/cache
21:43:39.818 INFO - Install plugins
21:43:40.541 INFO - Install JDBC driver
21:43:41.034 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 5.062s
Final Memory: 11M/245M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.IllegalStateException: Fail to connect to database
at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1015)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:91)
at org.sonar.batch.bootstrapper.Batch.start(Batch.java:81)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.h2.Driver'
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
at org.apache.commons.dbcp.BasicDataSource.getLogWriter(BasicDataSource.java:1098)
at org.apache.commons.dbcp.BasicDataSourceFactory.createDataSource(BasicDataSourceFactory.java:350)
at org.sonar.core.persistence.DefaultDatabase.initDatasource(DefaultDatabase.java:103)
at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:72)
... 31 more
Caused by: java.lang.ClassNotFoundException: org.h2.Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420)
... 36 more
It somehow looks like I need to install H2, but I have not been able to find out how and trial and error did not succeed.

jenkins maven setPerCoreThreadCount

Jenkins ver. 1.538
With Maven 3.1.0 works just fine
With Maven 3.2.1 it get the following error
Jenkins installed Maven 3.2.1 itself (downloaded from Apache and extracted)
What is wrong?
Parsing POMs
maven31-agent.jar already up to date
maven31-interceptor.jar already up to date
maven3-interceptor-commons.jar already up to date
[project] $ /opt/jenkins/tools/hudson.model.JDK/java-1.7.0/bin/java -Xmx512m -Xms512m -Dfile.encoding=UTF-8 -XX:PermSize=128M -cp /opt/jenkins/maven31-agent.jar:/opt/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven-3.2.1/boot/plexus-classworlds-2.5.1.jar:\opt\jenkins\tools\hudson.tasks.Maven_MavenInstallation\maven-3.2.1/conf/logging jenkins.maven3.agent.Maven31Main /opt/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven-3.2.1 /opt/jenkins/slave.jar /opt/jenkins/maven31-interceptor.jar /opt/jenkins/maven3-interceptor-commons.jar 41476
&lt===[JENKINS REMOTING CAPACITY]===&gtchannel started
...
ERROR: Failed to parse POMs
hudson.util.IOException2
at hudson.maven.Maven3Builder.call(Maven3Builder.java:178)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
... 9 more
Caused by: java.lang.Exception: java.lang.reflect.InvocationTargetException
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:184)
... 14 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
... 14 more
Caused by: java.lang.NoSuchMethodError: org.apache.maven.execution.MavenExecutionRequest.setPerCoreThreadCount(Z)V
at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.populateRequest(DefaultMavenExecutionRequestBuilder.java:978)
at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:172)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.getMavenExecutionRequest(Maven31Launcher.java:153)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:130)
... 21 more
JENKINS-22486 was fixed with Maven plugin 2.8.
Works when I remove -T 1C Maven argument (one thread per core).

UnsatisfiedLinkError Building Maven Project in Hudson

I set up a "Maven2/3 project" in Hudson 2.0.1 deployed in Glassfish 3.0.1 and when I try to build, I get this error:
Started by user anonymous
[workspace] $ /usr/bin/hg incoming --quiet --bundle hg.bundle --template "<changeset node='{node}' author='{author|xmlescape}' rev='{rev}' date='{date}'><msg>{desc|xmlescape}</msg><added>{file_adds|stringify|xmlescape}</added><deleted>{file_dels|stringify|xmlescape}</deleted><files>{files|stringify|xmlescape}</files><parents>{parents}</parents></changeset>\n" --rev default
[workspace] $ /usr/bin/hg log --rev . --template {node}
Found mavenVersion 3.0.2 from file jar:file:/usr/local/maven/lib/maven-core-3.0.2.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
Parsing POMs
[workspace] $ /usr/java/jdk1.6.0_21/bin/java -cp /home/hudson/.hudson/plugins/maven-plugin/WEB-INF/lib/maven3-agent-2.0.1.jar:/usr/local/maven/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /usr/local/maven /opt/glassfish/glassfish/domains/domain1/applications/hudson-2.0.1/WEB-INF/lib/hudson-remoting-2.0.1.jar /home/hudson/.hudson/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-2.0.1.jar 35157
<===[HUDSON REMOTING CAPACITY]===>���channel started
channel stopped
ERROR: Failed to parse POMs
java.io.IOException: Remote call on Channel to Maven [/usr/java/jdk1.6.0_21/bin/java, -cp, /home/hudson/.hudson/plugins/maven-plugin/WEB-INF/lib/maven3-agent-2.0.1.jar:/usr/local/maven/boot/plexus-classworlds-2.4.jar, org.jvnet.hudson.maven3.agent.Maven3Main, /usr/local/maven, /opt/glassfish/glassfish/domains/domain1/applications/hudson-2.0.1/WEB-INF/lib/hudson-remoting-2.0.1.jar, /home/hudson/.hudson/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-2.0.1.jar, 35157] failed
at hudson.remoting.Channel.call(Channel.java:640)
at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:156)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:630)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:429)
at hudson.model.Run.run(Run.java:1363)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145)
Caused by: java.lang.UnsatisfiedLinkError: /usr/java/jdk1.6.0_21/jre/lib/i386/xawt/libmawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1003)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1720)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1592)
at java.awt.Toolkit.<clinit>(Toolkit.java:1614)
at java.awt.Color.<clinit>(Color.java:263)
at hudson.util.ColorPalette.<clinit>(ColorPalette.java:39)
at hudson.model.BallColor.<clinit>(BallColor.java:55)
at hudson.model.Result.<clinit>(Result.java:52)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at $Proxy2.<clinit>(Unknown Source)
at sun.reflect.GeneratedSerializationConstructorAccessor37.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.io.ObjectStreamClass.newInstance(ObjectStreamClass.java:924)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1737)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at java.util.HashMap.readObject(HashMap.java:1030)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at hudson.remoting.UserRequest.deserialize(UserRequest.java:178)
at hudson.remoting.UserRequest.perform(UserRequest.java:98)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:270)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Sending e-mails to: email#address.com
Finished: FAILURE
Any suggestions as to why??
The error appeared to be a result of a 32 bit JDK installed on a 64 bit OS (Linux/CentOS). Installing a 64 bit JDK got rid of this issue.
Missing file? File permission problems? Check those things first on the library it's complaining about. Check which user Hudson is running as, and try running the same command as the same user to see what happens.

Resources