3

所以,基本上:

在 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)
4

4 回答 4

11

看看这个错误报告:http://java.net/jira/browse/WSIT-1642?page=com.atlassian.streams.streams-jira-plugin%3Aactivity-stream-issue- tab

以下确实有帮助:

rm -rf $GF_HOME/glassfish/domains/domain1/osgi-cache/
于 2012-08-14T23:07:36.650 回答
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..

于 2014-02-13T13:15:44.017 回答
0

偶尔我们也会得到 (ubuntu 12.04, glassfish 3.0.1, Java(TM) SE Runtime Environment (build 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。

于 2012-06-13T19:43:22.173 回答
0

使用管理员 asadmin start-domain 运行 cmd

于 2016-09-18T02:41:41.240 回答