现在3天,我一直试图在eclipse Luna版本4.4.1上安装glassfish 4.1。我首先从eclipse marketplace安装了插件,然后使用jdk 8在我的运行时添加了它。我也将jdk设为默认值,因为eclipse默认使用jre。我必须指出,我一直在使用netfish上的glassfish和日食中的tomcat,但我决定在日食时玩玻璃鱼。我在互联网上获得的每一条信息都没有解决我的问题。 以下是我在控制台中遇到的错误。现在,这让我疯了,所以我决定来找你指点。 感谢
Launching GlassFish on Felix platform
ERROR: Unable to create cache directory: C:\Program Files\glassfish-4.1\glassfish\domains\domain1\osgi-cache\felix
ERROR: Error creating bundle cache. (java.lang.RuntimeException: Unable to create cache directory.)
java.lang.RuntimeException: Unable to create cache directory.
at org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:131)
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.RuntimeException: Unable to create cache directory.
at org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:131)
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:483)
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
Caused by: java.lang.NullPointerException
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.newFramework(OSGiGlassFishRuntimeBuilder.java:241)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:135)
... 9 more
Error stopping framework: java.lang.NullPointerException
java.lang.NullPointerException
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher$1.run(GlassFishMain.java:203)
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=192m; support was removed in 8.0
答案 0 :(得分:1)
运行Eclipse或在管理员模式下使用的任何其他IDE。 适合我。
答案 1 :(得分:0)
我认为您的评论应该作为主要答案发布,但我一直在努力将您的评论标记为答案,但我能够做到。所以我决定在这里发表您的评论,然后根据自己的经验进行备份。
unwichtich的回答:
我想这是一个类似的问题。原因可能是您已在c:\Program Files
中安装了Glassfish。您可以尝试将Glassfish安装移动到普通用户帐户具有完全访问权限的目录,但是您必须在Eclipse中更改Glassfish安装的路径。
我自己的经历: 事实证明,我使用glassfish服务器时遇到的所有问题(包括退出代码1错误)都是因为glassfish无法处理带有空格的文件夹名称。所以我将glassfish-4.1文件夹从C:\ Program File \ glassfish-4.1 ..路径移动到C:\ glassfish-4.1 ..它擦掉了我所有的眼泪。这在eclipse和netbeans IDE中非常重要(如果你要安装没有附带glassfish捆绑zip的netbeans)。
答案 2 :(得分:0)
我遇到了同样的问题并通过在C:\而不是C:\ Program Files下安装Glassfish来修复它。试试吧。
答案 3 :(得分:0)
使用JDk 7而不是JDK 8 am也遇到了同样的问题我刚才改为jdk7现在正在工作。