java - IDEA 启动本地 glassfish 服务器失败

标签 java ubuntu intellij-idea glassfish

我正在尝试在 Intellij IDEA 13.1.4 中启动 Glassfish 4.1。我在运行/调试配置窗口中设置了基本设置 - 选择了应用程序服务器、jvm、放置 2 个要部署的工件,默认启动/连接配置。当我尝试启动它时,抛出了异常。这是完整的堆栈跟踪:

 /home/glassfish/glassfish/bin/asadmin start-domain domain1

   Detected server admin port: 4848
   Detected server http port: 8080
[2014-11-14 03:09:49,839] Artifact ss-ear:ear: Server is no connected.Deploy     is not available.
[2014-11-14 03:09:49,839] Artifact ss-ear:ear exploded: Server is not connected.  Deploy is not available.

java.nio.file.AccessDeniedException: /home/glassfish/glassfish/domains/domain1/logs/server.log.lck
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:177)
at java.nio.channels.FileChannel.open(FileChannel.java:287)
at java.nio.channels.FileChannel.open(FileChannel.java:335)
at java.util.logging.FileHandler.openFiles(FileHandler.java:438)
at java.util.logging.FileHandler.<init>(FileHandler.java:318)
at com.sun.enterprise.admin.launcher.GFLauncherLogger.addLogFileHandler(GFLauncherLogger.java:99)
at com.sun.enterprise.admin.launcher.GFLauncher.setup(GFLauncher.java:192)
at com.sun.enterprise.admin.servermgmt.cli.StartDomainCommand.createLauncher(StartDomainCommand.java:228)
at com.sun.enterprise.admin.servermgmt.cli.StartDomainCommand.executeCommand(StartDomainCommand.java:124)
at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:322)
at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:366)
at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:300)
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.
 Command start-domain failed.
 Before it died, it produced the following output:

 Listening for transport dt_socket at address: 9009
 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:246)
at   com.sun.enterprise.glassfish.bootstrap.MainHelper.findInstanceRoot(MainHelper.java:349)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:78)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)

我使用的是 Ubuntu OS 14.04 LTS,java-1.7.0-openjdk-amd64。 Glassfish 安装在/home/glassfish,asadmin 脚本有 777 权限。 当我从终端而不是 IDE 运行它时,服务器启动。

请帮忙,这让我很生气!

最佳答案

看到这个“java.nio.file.AccessDeniedException”就说明了一切。授予 gassfish 文件夹权限。

sudo chmod -R 777 /wherever-the-folder-is/glassfish-folder

关于java - IDEA 启动本地 glassfish 服务器失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26931211/

相关文章:

java - 将 "shorthand"写入对象 : The hows and whys? 内的字段的引用

java - 如何重构一个以未知类作为参数的方法?

java - 使用 IntelliJ REST 客户端测试 Spring MVC POST 会导致 415

ubuntu - 主节点的硬件是否应该与 Kubernetes 设置的工作节点的硬件相同?

java - Android - 代码覆盖率测试错误

java - 为什么我会看到 Springboot starter 2.1.2 pom 不可解析问题?

java - Android Studio 中不存在主要 Activity

java - jetty 升级 8 至 9 个缺失的类(class)

python - 用于更新远程服务器的 FABRIC 功能

firefox - 如何卸载 Firefox OS 的桌面应用程序?