Spring Tool Suite(STS)中的Liferay服务器提供权限被拒绝错误

时间:2016-12-09 07:15:27

标签: eclipse macos liferay tomcat8 spring-tool-suite

在我的Mac系统El Capitan 10.11上使用liferay-ce-portal-7.0-ga3,我在Spring Tool Suite中设置了Liferay 7.x服务器。它包含了8个服务器。我已经在我的STS中包含了Liferay IDE并生成了Liferay插件项目,但是当我尝试运行应用程序时,我将获得Permission denied异常,如下所示。我有我的Mac系统的sudo凭据。在尝试运行我的应用程序时,如何摆脱此Permission denied异常?我也附上了错误的屏幕截图。

java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: /Users/remo/Projects/xnet/Development/tools/liferay-ce-portal-7.0-ga3/tomcat-8.0.32/logs/catalina.2016-12-08.log (Permission denied)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at org.apache.juli.FileHandler.openWriter(FileHandler.java:384)
    at org.apache.juli.FileHandler.<init>(FileHandler.java:96)
    at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:71)
    at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:67)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:562)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:505)
    at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:309)
    at java.util.logging.LogManager$3.run(LogManager.java:399)
    at java.util.logging.LogManager$3.run(LogManager.java:396)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:396)
    at java.util.logging.LogManager.access$800(LogManager.java:145)
    at java.util.logging.LogManager$2.run(LogManager.java:345)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:338)
    at java.util.logging.LogManager.getLogManager(LogManager.java:378)
    at java.util.logging.Logger.demandLogger(Logger.java:448)
    at java.util.logging.Logger.getLogger(Logger.java:502)
    at com.sun.jmx.remote.util.ClassLogger.<init>(ClassLogger.java:55)
    at sun.management.jmxremote.ConnectorBootstrap.<clinit>(ConnectorBootstrap.java:846)
    at sun.management.Agent.startAgent(Agent.java:257)
    at sun.management.Agent.startAgent(Agent.java:447)
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: /Users/remo/Projects/xnet/Development/tools/liferay-ce-portal-7.0-ga3/tomcat-8.0.32/logs/localhost.2016-12-08.log (Permission denied)
    at java.io.FileOutputStream.open0(Native Method)

Liferay Server Permissino Denied error

1 个答案:

答案 0 :(得分:0)

我最好的猜测是你已经使用sudo power以root身份启动STS / Liferay / Tomcat。现在,您的日志文件和OSGi状态文件由root拥有,当您以非特权用户身份启动服务器时,不能覆盖它们。

由于以root身份运行面向Internet的服务器是非常糟糕的做法,我建议sudo chown -r remo /Users/remo/Projects/xnet/Development/tools/liferay-ce-portal-7.0-ga3/(假设这是MacOS上的chown语法)。此命令以递归方式将/Users/remo/Projects/xnet/Development/tools/liferay-ce-portal-7.0-ga3/中文件的所有权更改为用户(remo)(-r)

从eclipse启动服务器通常是使用您自己的用户帐户完成的,然后应该可以使用。