Glassfish不会从Intellij开始,除非我用sudo运行Intellij

Mik*_*e P 7 sudo glassfish intellij-idea

标题说明了一切......只是试图让玻璃鱼起来走了.这是我得到的错误

Detected server admin port: 4848
[2015-04-06 07:37:56,138] Artifact java_web_app:war exploded: Server is not connected. Deploy is not available.
Detected server http port: 8080
Command start-domain failed.
JVM failed to start: com.sun.enterprise.admin.launcher.GFLauncherException: The server exited prematurely with exit code 1.
Before it died, it produced the following output:

This subcommand requires root privileges: bsexec
Run Code Online (Sandbox Code Playgroud)

当然有办法解决这个问题吗?我真的不想每次都用sudo运行Intellij.

pet*_*rim 9

答案:GlassFish 4.1,IntelliJ IDEA 14.1

我不知道(双关语并不打算)为什么GlassFish需要root用户帐户.

你需要执行这样的事情:

/Library/opt/payara-4.1.151/glassfish/bin/asadmin start-domain --verbose=true  domain1
Run Code Online (Sandbox Code Playgroud)

运行 - >编辑配置 - >选择配置(acme-payara-project) - >启动配置

编辑启动脚本并更改它以添加--verbose-true参数.


Sim*_*n07 6

这是Mac OSX 10.10.3上发生的问题吗?如果是这样,我们可以通过文件的内容更改为解决该问题/usr/libexec/StartupItemContext,以

#!/bin/sh
unset LAUNCHD_SOCKET
$@
Run Code Online (Sandbox Code Playgroud)

我们还报告了相应的glassfish问题的解决方法:https://java.net/jira/browse/GLASSFISH-21343

请注意,这仅适用于glassfish 4.0.在4.1中,他们更改了启动代码,因此StartupItemContext将不再使用此文件.

如果您的glassfish版本是4.1,那么目前唯一已知的解决方法是使用--verbose=true参数启动glassfish .


Pét*_*son 5

通过添加-v到启动脚本,在OS X 10.10.4,IntelliJ 14.1.4上解决了这个问题.

截图