0

I have set up a continuous integration environment for PHP using Jenkins on Ubuntu 12.04. I have most of the PHP tools bedded down and being successfully invoked,

However, all my builds are resulting in a Java error.

My searching on the 'Net is not yielding an positive results. The error seems to point to some library perhaps that is not loaded, but I cannot say which one.

Has anyone managed to setup with Jenkins and gone past this error? Any advise will be appreciated.

EDIT: I'm getting closer. I now understand that I could either using Maven or Phing (or Ant). My installation uses Phing, so I suppose I don't need Maven. My question is now how to not use Maven, and use Phing instead.

    FATAL: com/google/inject/Module
java.lang.NoClassDefFoundError: com/google/inject/Module
    at org.jenkinsci.plugins.xunit.XUnitProcessor.getXUnitLogObject(XUnitProcessor.java:94)
    at org.jenkinsci.plugins.xunit.XUnitProcessor.performXUnit(XUnitProcessor.java:50)
    at org.jenkinsci.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:88)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:692)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:667)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:645)
    at hudson.model.Build$RunnerImpl.post2(Build.java:161)
    at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:614)
    at hudson.model.Run.run(Run.java:1400)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:175)
Caused by: java.lang.ClassNotFoundException: com.google.inject.Module
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 13 more

UPDATE: I located the jenkins log file, and saw this message at startup.

INFO: Started initialization
Mar 07, 2014 6:10:11 AM jenkins.model.Jenkins$6 onAttained
INFO: Listed all plugins
Mar 07, 2014 6:10:23 AM jenkins.model.Jenkins$6 onTaskFailed
SEVERE: Failed Loading plugin violations
java.io.IOException: Dependency maven-plugin (1.399) doesn't exist
        at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:424)
        at hudson.PluginManager$2$1$1.run(PluginManager.java:284)
        at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
        at jenkins.model.Jenkins$5.runTask(Jenkins.java:797)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
        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:744)

Solved: I have resolved this issue, with Simon's help.

The error was due to the fact that the Phing plugin was not installed. I assumed that installing Phing was sufficient.

To resolve this, I re-installed, this time following the instructions here: http://systemsarchitect.net/continuous-integration-for-php-with-jenkins/

Cœur
  • 37,241
  • 25
  • 195
  • 267
crafter
  • 6,246
  • 1
  • 34
  • 46

1 Answers1

1

The error message looks like you chose maven for your build in the project configuration. First of all you need to install the jenkins phing plugin. After that you can replace the maven build step with the phin one ("invoke phing target").

Simon H
  • 2,495
  • 4
  • 30
  • 38
  • Thanks Simon. I have subsequently installed phing, but the error persists. I will try the 'invoke' command you suggested. – crafter Mar 17 '14 at 04:46
  • You were right @Simon H, because the Phing plugin was not installed, it seemed. I had to go into Jenkins->Manage Plugins and manually select and install the Phing plugin. This however has broken Jenkins and it is now not starting, so I'm a few steps backward, but determined to get this working. – crafter Apr 06 '14 at 20:23
  • The phing version in the jenkins Manage Plugin screen is for 1.5, and Ubuntu 12.04 is supplied with 1.4, hence the issues with jenkins. I have purged and am installing from scratch. – crafter Apr 06 '14 at 22:15
  • Nice to hear you are making progress now. – Simon H Apr 07 '14 at 07:02
  • Your analysis was spot on. I updated the question with my findings. – crafter Apr 17 '14 at 20:44