0

我用 Netbeans 7.1.2 下载了 glassfish 3.1.2。Glassfish 工作了很多次。但现在它不想开始。这是我在 netbeans 中的内容:

启动 GlassFish Server 3.1.2 启动 GlassFish Server 3.1.2 C:\Users\أبو داود\Documents\NetBeansProjects\HelloWeb\nbproject\build-impl.xml:721:部署错误:服务器 GlassFish Server 3.1.2 的启动已计时 - out 查看服务器日志以获取详细信息。BUILD FAILED(总时间:20 分 0 秒)

我注意到域 1 中的日志不包含任何文件。我尝试从 cmd 启动服务器,我做了以下操作: cd C:\Program Files\glassfish-3.1.2\glassfish\bin C:\Program Files\glassfish-3.1.2\glassfish\bin>asadmin start-域域1

这是我收到的:

java.io.IOException: Couldn't get lock for C:\Program Files\glassfish-3.1.2\glas
sfish\domains\domain1\logs\server.log
        at java.util.logging.FileHandler.openFiles(Unknown Source)
        at java.util.logging.FileHandler.<init>(Unknown Source)
        at com.sun.enterprise.admin.launcher.GFLauncherLogger.addLogFileHandler(
GFLauncherLogger.java:100)
        at com.sun.enterprise.admin.launcher.GFLauncher.setup(GFLauncher.java:18
9)
        at com.sun.enterprise.admin.cli.StartDomainCommand.createLauncher(StartD
omainCommand.java:209)
        at com.sun.enterprise.admin.cli.StartDomainCommand.executeCommand(StartD
omainCommand.java:107)
        at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:264)
        at com.sun.enterprise.admin.cli.AsadminMain.executeCommand(AsadminMain.j
ava:306)
        at com.sun.enterprise.admin.cli.AsadminMain.main(AsadminMain.java:238)
Attente du dلmarrage de domain1 ..Erreur lors du dلmarrage de domain domain1.
Le serveur a quittل le processus prلmaturلment avec le code de sortie 1.
Avant son arrمt, il a gلnلrل la sortie suivante :

Launching GlassFish on Felix platform
ERROR: Unable to create cache directory: C:\Program Files\glassfish-3.1.2\glassf
ish\domains\domain1\osgi-cache\felix
ERROR: Error creating bundle cache. (java.lang.RuntimeException: Unable to creat
e 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:629)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.r
un(OSGiFrameworkLauncher.java:88)
Exception in thread "Thread-1" java.lang.RuntimeException: org.osgi.framework.Bu
ndleException: Error creating bundle cache.
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.r
un(OSGiFrameworkLauncher.java:90)
Caused by: org.osgi.framework.BundleException: Error creating bundle cache.
        at org.apache.felix.framework.Felix.init(Felix.java:634)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.r
un(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:629)
        ... 1 more
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMa
in.java:97)
        at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: org.glassfish.embeddable.GlassFishException: java.lang.NullPointerExc
eption
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.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.NullPointerException
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.newFramework(OSGiGlassFishRuntimeBuilder.java:230)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.build(OSGiGlassFishRuntimeBuilder.java:133)
        ... 9 more
Error stopping framework: java.lang.NullPointerException
java.lang.NullPointerException
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher$1.run(G
lassFishMain.java:203)

我应该怎么做才能在 netbeans 上运行 glassfish。先感谢您

4

1 回答 1

2

我在 Windows 7 平台上使用 Glassfish 3.1.2 和 Netbeans 7.2beta 时遇到了同样的问题。

我已在 glassfish 安装目录和子目录的属性设置的安全选项卡中将用户权限更改为完全控制

我还更改了Netbeans 安装的兼容性“以管理员身份运行此程序”设置,正如 Netbeans 在遇到 glassfish 错误时所建议的那样。

我不完全(或根本)不了解 Windows 7 中的安全性,因此不确定这可能对我的系统产生什么其他影响。似乎即使您是管理员,Windows 也将您视为用户,除非您明确告诉它不这样做。

于 2012-06-10T14:16:13.360 回答