• Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • core
    • None

      Running:

      [lockable-resources-plugin (master)]$ mvn install
      ...
      Tests run: 2, Failures: 0, Errors: 2, Skipped: 0

      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 8.191 s
      [INFO] Finished at: 2014-05-29T14:02:45-08:00
      [INFO] Final Memory: 19M/187M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.9:test (default-test) on project lockable-resources: There are test failures.
      [ERROR]
      [ERROR] Please refer to /Users/drosser/workstuff/lockable-resources-plugin/target/surefire-reports for the individual test results.
      [ERROR] -> [Help 1]
      [ERROR]
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR]
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

      From /Users/drosser/workstuff/lockable-resources-plugin/target/surefire-reports/InjectedTest.txt
      -------------------------------------------------------------------------------
      Test set: InjectedTest
      -------------------------------------------------------------------------------
      Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 4.651 sec <<< FAILURE!
      org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite(org.jvnet.hudson.test.junit.FailedTest) Time elapsed: 0.007 sec <<< ERROR!
      java.lang.ArrayIndexOutOfBoundsException: -1
      at com.thoughtworks.xstream.core.util.OrderRetainingMap.entrySet(OrderRetainingMap.java:77)
      at java.util.HashMap.putMapEntries(HashMap.java:511)
      at java.util.HashMap.putAll(HashMap.java:784)
      at com.thoughtworks.xstream.core.util.OrderRetainingMap.<init>(OrderRetainingMap.java:36)
      at com.thoughtworks.xstream.converters.reflection.FieldDictionary.buildMap(FieldDictionary.java:135)
      at com.thoughtworks.xstream.converters.reflection.FieldDictionary.fieldsFor(FieldDictionary.java:76)
      at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:127)
      at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:143)
      at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:102)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
      at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
      at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
      at com.thoughtworks.xstream.XStream.marshal(XStream.java:898)
      at com.thoughtworks.xstream.XStream.marshal(XStream.java:887)
      at com.thoughtworks.xstream.XStream.toXML(XStream.java:860)
      at hudson.XmlFile.write(XmlFile.java:183)
      at jenkins.model.Jenkins.save(Jenkins.java:2642)
      at jenkins.model.Jenkins.setNoUsageStatistics(Jenkins.java:979)
      at org.jvnet.hudson.test.HudsonTestCase.setUp(HudsonTestCase.java:326)
      at org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite.setUp(JellyTestSuiteBuilder.java:133)
      at org.jvnet.hudson.test.junit.GroupedTest.run(GroupedTest.java:46)
      at junit.framework.TestSuite.runTest(TestSuite.java:255)
      at junit.framework.TestSuite.run(TestSuite.java:250)
      at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
      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:483)
      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)
      testCliSanity(org.jvnet.hudson.test.PluginAutomaticTestBuilder$CliSanityTest) Time elapsed: 0.011 sec <<< ERROR!
      java.lang.IllegalStateException: second instance
      at jenkins.model.Jenkins.<init>(Jenkins.java:748)
      at hudson.model.Hudson.<init>(Hudson.java:81)
      at org.jvnet.hudson.test.HudsonTestCase.newHudson(HudsonTestCase.java:481)
      at org.jvnet.hudson.test.HudsonTestCase.setUp(HudsonTestCase.java:318)
      at junit.framework.TestCase.runBare(TestCase.java:139)
      at org.jvnet.hudson.test.HudsonTestCase.runBare(HudsonTestCase.java:296)
      at junit.framework.TestResult$1.protect(TestResult.java:122)
      at junit.framework.TestResult.runProtected(TestResult.java:142)
      at junit.framework.TestResult.run(TestResult.java:125)
      at junit.framework.TestCase.run(TestCase.java:129)
      at junit.framework.TestSuite.runTest(TestSuite.java:255)
      at junit.framework.TestSuite.run(TestSuite.java:250)
      at junit.framework.TestSuite.runTest(TestSuite.java:255)
      at junit.framework.TestSuite.run(TestSuite.java:250)
      at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
      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:483)
      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)

          [JENKINS-23239] Test failures running "mvn install" on source

          Okay, this may be Not A Bug. Running "mvn install" with $JAVA_HOME pointing at an older version of Java results in zero errors.

          [lockable-resources-plugin (master)]$ mvn --version
          Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T09:37:52-08:00)
          Maven home: /usr/local/Cellar/maven/3.2.1/libexec
          Java version: 1.6.0_65, vendor: Apple Inc.
          Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
          Default locale: en_US, platform encoding: MacRoman
          OS name: "mac os x", version: "10.9.3", arch: "x86_64", family: "mac"
          

          Douglas Rosser added a comment - Okay, this may be Not A Bug. Running "mvn install" with $JAVA_HOME pointing at an older version of Java results in zero errors. [lockable-resources-plugin (master)]$ mvn --version Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T09:37:52-08:00) Maven home: /usr/local/Cellar/maven/3.2.1/libexec Java version: 1.6.0_65, vendor: Apple Inc. Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Default locale: en_US, platform encoding: MacRoman OS name: "mac os x", version: "10.9.3", arch: "x86_64", family: "mac"

          Bill Agee added a comment -

          I also ran into this problem while trying to 'mvn install' a new plugin on an OS X 10.9 system running jdk1.8.0_05.

          Switching to JDK 1.7 seems to work for me:

          export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
          mvn package
          mvn install
          

          Bill Agee added a comment - I also ran into this problem while trying to 'mvn install' a new plugin on an OS X 10.9 system running jdk1.8.0_05. Switching to JDK 1.7 seems to work for me: export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home mvn package mvn install

          Ulli Hafner added a comment - - edited

          This happens to all plug-ins that use JUnit rule in Java 8 environment:

          @Rule
          public JenkinsRule jenkins = new JenkinsRule();
          

          Ulli Hafner added a comment - - edited This happens to all plug-ins that use JUnit rule in Java 8 environment: @Rule public JenkinsRule jenkins = new JenkinsRule();

          Jesse Glick added a comment -

          To fix in this case it suffices to update:

          diff --git a/pom.xml b/pom.xml
          index 0f577be..4d7c73d 100644
          --- a/pom.xml
          +++ b/pom.xml
          @@ -13,7 +13,7 @@
           	<parent>
           		<groupId>org.jenkins-ci.plugins</groupId>
           		<artifactId>plugin</artifactId>
          -		<version>1.509.4</version>
          +		<version>1.554.1</version>
           	</parent>
           
           	<groupId>org.6wind.jenkins</groupId>
          

          Jesse Glick added a comment - To fix in this case it suffices to update: diff --git a/pom.xml b/pom.xml index 0f577be..4d7c73d 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ <parent> <groupId> org.jenkins-ci.plugins </groupId> <artifactId> plugin </artifactId> - <version> 1.509.4 </version> + <version> 1.554.1 </version> </parent> <groupId> org.6wind.jenkins </groupId>

          Code changed in jenkins
          User: Gareth Western
          Path:
          pom.xml
          http://jenkins-ci.org/commit/mqtt-notification-plugin/b9c1e6adae0dd20d62630e28b6cba28b2bc2e8a8
          Log:
          Bump parent verison for Java 8 compatibility (JENKINS-23239)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gareth Western Path: pom.xml http://jenkins-ci.org/commit/mqtt-notification-plugin/b9c1e6adae0dd20d62630e28b6cba28b2bc2e8a8 Log: Bump parent verison for Java 8 compatibility ( JENKINS-23239 )

          Code changed in jenkins
          User: Wilder Rodrigues
          Path:
          pom.xml
          http://jenkins-ci.org/commit/reverse-proxy-auth-plugin/3bd69858cb944e61f592e65c883389119f703b30
          Log:
          Upgrade plugin version in order to avoid JUnit problems with Java 8

          See -> https://issues.jenkins-ci.org/browse/JENKINS-23239

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Wilder Rodrigues Path: pom.xml http://jenkins-ci.org/commit/reverse-proxy-auth-plugin/3bd69858cb944e61f592e65c883389119f703b30 Log: Upgrade plugin version in order to avoid JUnit problems with Java 8 See -> https://issues.jenkins-ci.org/browse/JENKINS-23239

            Unassigned Unassigned
            drosser9 Douglas Rosser
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: