2014-11-14 25 views
3

我試圖在Intellij IDEA 13.1.4中啓動Glassfish 4.1。我在「運行/調試配置」窗口中設置了基本設置 - 選定的應用程序服務器jvm將2個工件部署,左側啓動/連接配置默認。當我嘗試啓動它時拋出異常。這裏是完整的堆棧跟蹤:IDEA未能啓動本地glassfish服務器

/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。 安裝在/ home/glassfish,asadmin腳本中的Glassfish擁有777個權限。 服務器啓動時,我從終端,而不是從IDE運行它。

請幫忙,它讓我發瘋!

回答

0

您是否嘗試過使用sudo權限啓動IntelliJ並在ide內啓動服務器?

+0

感謝您回覆我的問題,您的建議特別解決了我的問題。但現在我有另一個,它涉及內存分配,下次運行給我這個: 「OpenJDK 64位服務器VM警告:信息:os :: commit_memory(0x00000000bff80000,716177408,0)失敗;錯誤='無法分配內存' (錯誤= 12)「。 我應該更改服務器上的jdk設置嗎? – Matvey 2014-11-14 14:21:51

0

服務器啓動時,我從終端,而不是從IDE運行它。

檢查在哪個版本的JVM上運行IntelliJ IDEA。看起來你的GlassFish服務器帶有不同版本(較新版本)編譯的類。

+0

我的項目SDK是java 1.7.0_65,你在說什麼? – Matvey 2014-11-14 15:08:37

1

打開CMD,以管理員身份運行,然後啓動glassfish域。以便域名開始。

0

看到這個「java.nio.file.AccessDeniedException」它說的都是。授予gassfish文件夾的權限。

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