Hi all,

I have just started to implement the plugin so I grab the Audit2DB plugin 
and modify on my need but when I add dependency in the pom.xml then the 
unit test throw a lot of errors, mostly are 2 errors:

java.lang.NoClassDefFoundError: jenkins/model/RunAction2
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.jvnet.hudson.annotation_indexer.Index$2$1.fetch(Index.java:101)
at org.jvnet.hudson.annotation_indexer.Index$2$1.hasNext(Index.java:71)
at 
org.jvnet.hudson.annotation_indexer.FilterIterator.fetch(FilterIterator.java:23)
at 
org.jvnet.hudson.annotation_indexer.FilterIterator.hasNext(FilterIterator.java:42)
at hudson.init.InitializerFinder.discoverTasks(InitializerFinder.java:70)
at hudson.init.InitializerFinder.discoverTasks(InitializerFinder.java:55)
at org.jvnet.hudson.reactor.TaskBuilder$2.discoverTasks(TaskBuilder.java:40)
at org.jvnet.hudson.reactor.Reactor.<init>(Reactor.java:128)
at org.jvnet.hudson.reactor.Reactor.<init>(Reactor.java:133)
at jenkins.model.Jenkins$6.<init>(Jenkins.java:821)
at jenkins.model.Jenkins.executeReactor(Jenkins.java:821)
at jenkins.model.Jenkins.<init>(Jenkins.java:761)
at hudson.model.Hudson.<init>(Hudson.java:81)
at org.jvnet.hudson.test.HudsonTestCase.newHudson(HudsonTestCase.java:441)
at org.jvnet.hudson.test.HudsonTestCase.setUp(HudsonTestCase.java:300)
at 
org.jenkins.plugins.audit2db.test.integration.WhenRunningJobsByDateReport.setUp(WhenRunningJobsByDateReport.java:66)
at junit.framework.TestCase.runBare(TestCase.java:132)
at org.jvnet.hudson.test.HudsonTestCase.runBare(HudsonTestCase.java:285)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at 
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
at 
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at 
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at 
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172)
at 
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)
Caused by: java.lang.ClassNotFoundException: jenkins.model.RunAction2
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 64 more


and:
java.lang.IllegalStateException: second instance
at jenkins.model.Jenkins.<init>(Jenkins.java:711)
at hudson.model.Hudson.<init>(Hudson.java:81)
at org.jvnet.hudson.test.HudsonTestCase.newHudson(HudsonTestCase.java:441)
at org.jvnet.hudson.test.HudsonTestCase.setUp(HudsonTestCase.java:300)
at 
org.jenkins.plugins.audit2db.test.integration.WhenRunningJobsByDateReport.setUp(WhenRunningJobsByDateReport.java:66)
at junit.framework.TestCase.runBare(TestCase.java:132)
at org.jvnet.hudson.test.HudsonTestCase.runBare(HudsonTestCase.java:285)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at 
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
at 
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at 
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at 
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172)
at 
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)

I have added to the pom:
in the dependency

<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>parameterized-trigger</artifactId>
<version>${version.parameterizedtrigger}</version>
</dependency>

in the plugin
<plugin>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>parameterized-trigger</artifactId>
<version>${version.parameterizedtrigger}</version>
</plugin>

Anyone know how to fix these issues?

Thanks,
Quang

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/a949ce61-c4e2-4fa2-8c44-893bffadabe6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to