当我在终端/opt/glassfish4/glassfish/bin/asadmin start
上输入此内容时,我得到以下结果:
Remote server does not listen for requests on [localhost:4848]. Is the server up?
Unable to get remote commands.
Closest matching local command(s):
restart-domain
restart-local-instance
start-database
start-domain
start-local-instance
Command start failed.
同样,当我输入/opt/glassfish4/glassfish/bin/asadmin --port 5656 start-domain
时,我得到了
java.io.IOException: Couldn't get lock for /opt/glassfish4/glassfish/domains/domain1/logs/server.log
at java.util.logging.FileHandler.openFiles(FileHandler.java:389)
at java.util.logging.FileHandler.<init>(FileHandler.java:287)
at com.sun.enterprise.admin.launcher.GFLauncherLogger.addLogFileHandler(GFLauncherLogger.java:98)
at com.sun.enterprise.admin.launcher.GFLauncher.setup(GFLauncher.java:191)
at com.sun.enterprise.admin.servermgmt.cli.StartDomainCommand.createLauncher(StartDomainCommand.java:220)
at com.sun.enterprise.admin.servermgmt.cli.StartDomainCommand.executeCommand(StartDomainCommand.java:117)
at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:321)
at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:360)
at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:298)
at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:56)
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
Exception in thread "main" java.lang.RuntimeException: the domain directory is not writable.
at com.sun.enterprise.glassfish.bootstrap.MainHelper.verifyDomainRoot(MainHelper.java:244)
at com.sun.enterprise.glassfish.bootstrap.MainHelper.findInstanceRoot(MainHelper.java:347)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:78)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
Command start-domain failed.
我觉得路径/opt/glassfish4/glassfish/bin/asadmin
中存在问题。我正在研究我的第一个JSF Web应用程序,无法运行glassfish服务器。我正在使用Netbeans和ubuntu 13.10。
有谁能告诉我的方式?
谢谢!
答案 0 :(得分:2)
错误消息
java.io.IOException:无法锁定 /opt/glassfish4/glassfish/domains/domain1/logs/server.log
和
线程中的异常&#34; main&#34; java.lang.RuntimeException:域 目录不可写。
表示用于启动服务器的用户帐户在Glassfish域文件夹中没有写入权限。
要解决此问题,请更改权限或使用具有足够权限的用户启动asadmin
命令。
如果这还没有解决问题,可能会有另一个进程锁定server.log
文件,但我想您会注意到这一点。确保您可以运行
lsof /opt/glassfish4/glassfish/domains/domain1/logs/server.log
查看是否有任何进程正在使用该文件。
另见: