在Eclipse(Linux)中启动GlassFish 4时创建捆绑缓存时出错

时间:2016-09-11 10:28:52

标签: linux eclipse glassfish glassfish-4 permission-denied

当我尝试从Eclipse Mars中的Servers选项卡启动GlassFish 4服务器时,出现以下错误:

Problem Occurred

  

'在localhost [domain1]'启动GlassFish 4遇到了问题。

     

由于以下问题无法启动服务器:
  启动过程失败,退出代码为1

在控制台选项卡中,我看到以下输出:

Launching GlassFish on Felix platform
ERROR: Error creating bundle cache. (java.lang.Exception: Unable to create bundle cache lock file: java.io.FileNotFoundException: /home/user/glassfish4/glassfish/domains/domain1/osgi-cache/felix/cache.lock (Permission denied))
java.lang.Exception: Unable to create bundle cache lock file: java.io.FileNotFoundException: /home/user/glassfish4/glassfish/domains/domain1/osgi-cache/felix/cache.lock (Permission denied)
    at org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:168)
    at org.apache.felix.framework.Felix.init(Felix.java:640)
    at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:88)
Exception in thread "Thread-1" java.lang.RuntimeException: org.osgi.framework.BundleException: Error creating bundle cache.
    at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:90)
Caused by: org.osgi.framework.BundleException: Error creating bundle cache.
    at org.apache.felix.framework.Felix.init(Felix.java:645)
    at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:88)
Caused by: java.lang.Exception: Unable to create bundle cache lock file: java.io.FileNotFoundException: /home/user/glassfish4/glassfish/domains/domain1/osgi-cache/felix/cache.lock (Permission denied)
    at org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:168)
    at org.apache.felix.framework.Felix.init(Felix.java:640)
    ... 1 more
Exception in thread "main" java.lang.reflect.InvocationTargetException
    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:498)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
    at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
Caused by: org.glassfish.embeddable.GlassFishException: java.lang.NullPointerException
    at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:170)
    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
...

1 个答案:

答案 0 :(得分:0)

转到控制台中提到的osgi-cache文件夹:

cd /home/user/glassfish4/glassfish/domains/domain1/osgi-cache

并更改felix文件夹的权限:

chmod 755 felix

现在转到Eclipse并再次尝试从Servers选项卡启动GlassFish服务器。