hudson.util.HudsonFailedToLoad: java.lang.IllegalStateException: second instance

Java.net JIRA | kazssym | 2 years ago
  1. 0

    Today I updated my installation of GlassFish 4.0 to 4.1 with the Update Tool. After that Jenkins (I redeployed the latest version 1.583) has not been starting at all. The GlassFish server.log contains the following error: {quote} [2014-10-08T15:44:03.852+0900] [glassfish 4.1] [SEVERE] [] [hudson.util.BootFailure] [tid: _ThreadID=223 _ThreadName=Jenkins initialization thread] [timeMillis: 1412750643852] [levelValue: 1000] [[ Failed to initialize Jenkins hudson.util.HudsonFailedToLoad: java.lang.NullPointerException at hudson.WebAppMain$3.run(WebAppMain.java:234) Caused by: java.lang.NullPointerException at org.glassfish.web.loader.WebappClassLoader.findResourceInternalFromJars(WebappClassLoader.java:2976) at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2846) at org.glassfish.web.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2736) at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1194) at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1750) at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1633) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2570) at java.lang.Class.getDeclaredMethods(Class.java:1855) at org.jvnet.hudson.annotation_indexer.Index$2$1.fetch(Index.java:102) at org.jvnet.hudson.annotation_indexer.Index$2$1.hasNext(Index.java:72) at org.jenkinsci.bytecode.TransformationSpec.loadRule(TransformationSpec.java:63) at org.jenkinsci.bytecode.Transformer.loadRules(Transformer.java:40) at org.jenkinsci.bytecode.Transformer.loadRules(Transformer.java:24) at hudson.PluginManager.<init>(PluginManager.java:190) at hudson.LocalPluginManager.<init>(LocalPluginManager.java:47) at jenkins.model.Jenkins.<init>(Jenkins.java:787) at hudson.model.Hudson.<init>(Hudson.java:82) at hudson.model.Hudson.<init>(Hudson.java:78) at hudson.WebAppMain$3.run(WebAppMain.java:222) ]] {quote} It could be an indication of a potential bug in Jenkins but the NPE happens in org.glassfish.web.loader.WebappClassLoader.findResourceInternalFromJa rs and it has not been a problem with GlassFish 4.0, it may be possibly a regression bug in GlassFish 4.1.

    Java.net JIRA | 2 years ago | kazssym
    hudson.util.HudsonFailedToLoad: java.lang.IllegalStateException: second instance
  2. 0

    Today I updated my installation of GlassFish 4.0 to 4.1 with the Update Tool. After that Jenkins (I redeployed the latest version 1.583) has not been starting at all. The GlassFish server.log contains the following error: {quote} [2014-10-08T15:44:03.852+0900] [glassfish 4.1] [SEVERE] [] [hudson.util.BootFailure] [tid: _ThreadID=223 _ThreadName=Jenkins initialization thread] [timeMillis: 1412750643852] [levelValue: 1000] [[ Failed to initialize Jenkins hudson.util.HudsonFailedToLoad: java.lang.NullPointerException at hudson.WebAppMain$3.run(WebAppMain.java:234) Caused by: java.lang.NullPointerException at org.glassfish.web.loader.WebappClassLoader.findResourceInternalFromJars(WebappClassLoader.java:2976) at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2846) at org.glassfish.web.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2736) at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1194) at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1750) at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1633) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2570) at java.lang.Class.getDeclaredMethods(Class.java:1855) at org.jvnet.hudson.annotation_indexer.Index$2$1.fetch(Index.java:102) at org.jvnet.hudson.annotation_indexer.Index$2$1.hasNext(Index.java:72) at org.jenkinsci.bytecode.TransformationSpec.loadRule(TransformationSpec.java:63) at org.jenkinsci.bytecode.Transformer.loadRules(Transformer.java:40) at org.jenkinsci.bytecode.Transformer.loadRules(Transformer.java:24) at hudson.PluginManager.<init>(PluginManager.java:190) at hudson.LocalPluginManager.<init>(LocalPluginManager.java:47) at jenkins.model.Jenkins.<init>(Jenkins.java:787) at hudson.model.Hudson.<init>(Hudson.java:82) at hudson.model.Hudson.<init>(Hudson.java:78) at hudson.WebAppMain$3.run(WebAppMain.java:222) ]] {quote} It could be an indication of a potential bug in Jenkins but the NPE happens in org.glassfish.web.loader.WebappClassLoader.findResourceInternalFromJa rs and it has not been a problem with GlassFish 4.0, it may be possibly a regression bug in GlassFish 4.1.

    Java.net JIRA | 2 years ago | kazssym
    hudson.util.HudsonFailedToLoad: java.lang.IllegalStateException: second instance
  3. 0

    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 JIRA | 3 years ago | Douglas Rosser
    java.lang.IllegalStateException: second instance
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    We cannot perform a plugin release, because two injected tests fail in the Jenkins job[0]. The code can be found on github here[1]. *Steps to reproduce:* You can reproduce the problem, by cloning the repository and after running mvn clean install. For the first test ( org.jvnet.hudson.test.junit.FailedTest.org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite): We understand that there is a problem with Guava, but we have no idea how to fix it. Our plugin is indirectly dependent on it. For the second test (org.jvnet.hudson.test.PluginAutomaticTestBuilder$CliSanityTest.testCliSanity): We understand that there was a compatibility problem with Java 7 vs. 8. and it was resolved (see [2]), but even though we are using Jenkins 1.609.1, we are still seeing the problem, both locally with Java 7 and 8 and on the oficial Jenkins job. Can we get some guidance for these problems? Thank you, Andrei Tuicu [0] https://jenkins.ci.cloudbees.com/job/plugins/job/JiraTestResultReporter-plugin/ [1] https://github.com/jenkinsci/JiraTestResultReporter-plugin [2] https://issues.jenkins-ci.org/browse/JENKINS-23239 *Full stack trace:* Running InjectedTest Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 5.139 sec <<< FAILURE! - in InjectedTest org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite(org.jvnet.hudson.test.junit.FailedTest) Time elapsed: 0.007 sec <<< ERROR! java.lang.NoSuchMethodError: com.google.common.cache.CacheBuilder.build()Lcom/google/common/cache/Cache; at hudson.model.Queue.<init>(Queue.java:216) at jenkins.model.Jenkins.<init>(Jenkins.java:772) at hudson.model.Hudson.<init>(Hudson.java:83) at org.jvnet.hudson.test.HudsonTestCase.newHudson(HudsonTestCase.java:500) at org.jvnet.hudson.test.HudsonTestCase.setUp(HudsonTestCase.java:330) at org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite.setUp(JellyTestSuiteBuilder.java:133) at org.jvnet.hudson.test.junit.GroupedTest.run(GroupedTest.java:49) 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.JUnit4Provider.execute(JUnit4Provider.java:264) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) testCliSanity(org.jvnet.hudson.test.PluginAutomaticTestBuilder$CliSanityTest) Time elapsed: 0.238 sec <<< ERROR! java.lang.IllegalStateException: second instance at jenkins.model.Jenkins.<init>(Jenkins.java:760) at hudson.model.Hudson.<init>(Hudson.java:83) at org.jvnet.hudson.test.HudsonTestCase.newHudson(HudsonTestCase.java:500) at org.jvnet.hudson.test.HudsonTestCase.setUp(HudsonTestCase.java:330) 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.JUnit4Provider.execute(JUnit4Provider.java:264) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

    Jenkins JIRA | 8 months ago | Andrei Tuicu
    java.lang.IllegalStateException: second instance

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      second instance

      at jenkins.model.Jenkins.<init>()
    2. jenkins.model
      Jenkins.<init>
      1. jenkins.model.Jenkins.<init>(Jenkins.java:741)
      1 frame
    3. Hudson
      WebAppMain$3.run
      1. hudson.model.Hudson.<init>(Hudson.java:82)
      2. hudson.model.Hudson.<init>(Hudson.java:78)
      3. hudson.WebAppMain$3.run(WebAppMain.java:222)
      3 frames