所以,基本上:
在RHEL 6.2和Java 6上有一个独立的(无群集)Glassfish 3.1.2新安装,没有任何已部署的应用程序(真正的新安装)。
我是第一次在服务器上启动默认域domain1并在启动/停止之间没有任何操作时停止它。
当我再次启动域时,出现以下错误:
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)
答案 0 :(得分:10)
以下内容有帮助:
rm -rf $GF_HOME/glassfish/domains/domain1/osgi-cache/
答案 1 :(得分:0)
偶尔我们也会得到(ubuntu 12.04,glassfish 3.0.1,Java(TM)SE运行时环境(版本1.6.0_26-b03)
[#|2012-06-13T19:17:02.763+0000|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=11;_ThreadName=Thread-1;|ERROR: Error locking file:/opt/glassfish/glassfish/modules/org.eclipse.persistence.jpa.modelgen.jar (java.lang.IllegalStateException: Bundle in unexpected state.)|#]
[#|2012-06-13T19:17:02.764+0000|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=11;_ThreadName=Thread-1;|java.lang.IllegalStateException: Bundle in unexpected state.
at org.apache.felix.framework.Felix.acquireBundleLock(Felix.java:4474)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1049)
at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
at java.lang.Thread.run(Thread.java:662)
|#]
没有找到任何解决方案,除了有时完全删除(mv / installationpath / glassfish / tmp /。)并重新安装glassfish工作。您可能还想从glassfish运行时用户主目录中删除/移动.updatetool。
答案 2 :(得分:0)
删除缓存不是一个好主意。 您遇到的问题来自您的系统时间。 如果您使用的是基于Linux的操作系统,则必须在启动glassfish之前将系统与NTP服务器同步。 运行
service ntpd stop
ntpdate pool.ntp.org
service ntpd start
如果这没有帮助,请创建文件/var/lib/ntp/ntp.drift 并将其粘贴到该文件中:
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org
运行
service ntpd restart
你已经完成了。你现在可以开始使用glassfish了..
答案 3 :(得分:0)
使用管理员运行cmd asadmin start-domain