Glassfish bundle in unexpected state exception
glassfish-3, java-6, redhat
Solution
Take a look at this bugreport: http://java.net/jira/browse/WSIT-1642?page=com.atlassian.streams.streams-jira-plugin%3Aactivity-stream-issue-tab
The following does help:
rm -rf $GF_HOME/glassfish/domains/domain1/osgi-cache/
Problem
So, basicly: there is a standalone (no cluster) new installation of Glassfish 3.1.2 on RHEL 6.2 and Java 6 without any deployed applications (really new installation). I started default domain domain1 on the server for the first time and stopped it without anything done between start/stop. When i start the domain again, t get following error: ``` Waiting for domain1 to start ...Error starting domain domain1. The server exited prematurely with exit code 1. Before it died, it produced the following output: Launching GlassFish on Felix platform 04.06.2011 18:27:47 BundleProvisioner update INFO: Updated bundle 1 from /home/glassfisfusr/glassfish3/glassfish/modules/endorsed/jaxb-api-osgi.jar 04.06.2011 18:27:47 BundleProvisioner update INFO: Updated bundle 2 from /home/glassfisfusr/glassfish3/glassfish/modules/endorsed/javax.annotation.jar 04.06.2011 18:27:47 BundleProvisioner update INFO: Updated bundle 3 from /home/glassfisfusr/glassfish3/glassfish/modules/endorsed/webservices-api-osgi.jar 04.06.2011 18:27:47 BundleProvisioner update skipped 04.06.2011 18:27:49 BundleProvisioner update INFO: Updated bundle 319 from /home/glassfisfusr/glassfish3/glassfish/modules/autostart/osgi-ee-resources.jar 04.06.2011 18:27:49 OSGiFrameworkLauncher launchOSGiFrameWork INFO: Updating system bundle Exception in thread "main" java.lang.reflect.InvocationTargetException 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 com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97) at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55) Caused by: org.glassfish.embeddable.GlassFishException: java.lang.IllegalStateException: Bundle in unexpected state. at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:164) at org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime.java:157) at org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.java:110) at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:112) ... 6 more Caused by: java.lang.IllegalStateException: Bundle in unexpected state. at org.apache.felix.framework.Felix.acquireBundleLock(Felix.java:4856) at org.apache.felix.framework.Felix.start(Felix.java:809) at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:157) ... 9 more Error stopping framework: java.lang.NullPointerException java.lang.NullPointerException at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher$1.run(GlassFishMain.java:203) ```