【问题标题】:IDEA failed to start a local glassfish serverIDEA 无法启动本地 glassfish 服务器
【发布时间】:2014-11-14 13:34:52
【问题描述】:

我正在尝试在 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 ubuntu intellij-idea glassfish


    【解决方案1】:

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

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

    【讨论】:

    • 谢谢。我的 GlassFish 安装位于 /opt 中,在更新 chmod 权限为 777 后,一切正常。
    【解决方案2】:

    您是否尝试过使用 sudo 权限启动 IntelliJ 并在 ide 中启动服务器?

    【讨论】:

    • 感谢您回复我的问题,您的建议特别解决了我的问题。但现在我有另一个,它与内存分配有关,下次运行给我这个:“OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000bff80000, 716177408, 0) failed; error='Cannot allocate memory' (错误号=12)。”我应该更改服务器上的 jdk 设置吗?
    【解决方案3】:

    以管理员身份打开 CMD,然后启动 glassfish 域。以便域启动。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-07
      • 1970-01-01
      相关资源
      最近更新 更多