简体   繁体   English

无法运行tomcat java:权限被拒绝

[英]can't run tomcat java: Permission denied

When I type sh startup.sh in terminal ubuntu I find below log and my tomcat server doesn't start. 当我在终端ubuntu键入sh startup.sh ,我在下面的日志中找到了我的tomcat服务器未启动。 I can run server from eclipse ide but I can't run it from terminal.sudo sh startup.sh worked. 我可以从eclipse ide运行server ,但不能从terminal.sudo运行start.sh。 Thanks to all of you to provide me answer previously It is worked fine. 感谢大家以前向我提供的答复一切正常。 Now another problem is that mvn clean install is not worked previously it is also worked now it told The program 'mvn' can be found in the following packages: * maven * maven2 This also work fine in eclipse ? 现在,另一个问题是mvn clean install以前无法运行,现在它也可以正常运行,它告诉程序“ mvn”程序可以在以下软件包中找到:* maven * maven2在eclipse中也可以正常工作吗?

 INFO: Server startup in 5732 ms
 20 Jan, 2014 7:39:54 PM org.apache.coyote.http11.AbstractHttp11Protocol pause
 INFO: Pausing Coyote HTTP/1.1 on http-8080
 20 Jan, 2014 7:39:54 PM org.apache.coyote.ajp.AjpProtocol pause
 INFO: Pausing Coyote AJP/1.3 on ajp-8009
 20 Jan, 2014 7:39:55 PM org.apache.catalina.core.StandardService stopInternal
 INFO: Stopping service Catalina
         ./catalina.sh: 1: eval: /opt/jdk1.6.0_23/bin/java: Permission denied
         ./catalina.sh: 1: eval: /opt/jdk1.6.0_23/bin/java: Permission denied

The catalina.sh script starts the tomcat instance by running something like this: catalina.sh脚本通过运行以下命令来启动tomcat实例:

eval "\"$_RUNJAVA\"" <lots of options> ...
  org.apache.catalina.startup.Bootstrap "$@" start \
  >> "$CATALINA_OUT" 2>&1 "&"

where $_RUNJAVA has previously been set to the pathname to a Java executable. 其中$_RUNJAVA先前已设置为Java可执行文件的路径名。

Now this is apparently failing, saying "/opt/jdk1.6.0_23/bin/java: Permission denied" 现在,这显然失败了,并说“ /opt/jdk1.6.0_23/bin/java:权限被拒绝”

This can mean a few things: 这可能意味着几件事:

  • The /opt/jdk1.6.0_23/bin/java file does not exist with that pathname. 该路径名不存在/opt/jdk1.6.0_23/bin/java文件。 (This could possibly be due to a broken symlink ...) (这可能是由于符号链接损坏了。)
  • The /opt/jdk1.6.0_23/bin/java file does exist, but it is not executable by the current (effective) user. /opt/jdk1.6.0_23/bin/java文件确实存在,但是当前(有效)用户无法执行。
  • The /opt/jdk1.6.0_23/bin/java file does exist, but the current user is barred from accessing it because of permissions on some directory in the pathname. /opt/jdk1.6.0_23/bin/java文件确实存在,但是由于路径名中某些目录的权限,当前用户被禁止访问它。
  • (If you are using SELinux/enforcing ... or equivalent), the policy is configured to not allow that executable to be executed in that context. (如果使用的是SELinux / enforcing ...或同等功能),则该策略配置为不允许在该上下文中执行该可执行文件。

So ...: 所以...:

  • Check what effective user you are actually using to launch Tomcat. 检查您实际用来启动Tomcat的有效用户。
  • Check that the file exists at that location. 检查该文件在该位置是否存在。 (Perhaps you installed a newer Java at a different location.) (也许您在其他位置安装了较新的Java。)
  • Check that it is executable by that user. 检查该用户可执行文件。
  • Check the path to the file. 检查文件的路径。
  • If you are using SELinux (or equivalent), check the security logs for events corresponding to this. 如果您使用的是SELinux(或等效版本),请检查安全日志中与此事件对应的事件。

If the problem is that you are using the wrong Java installation, then the "fix" will depend on how you are running catalina.sh . 如果问题是您使用了错误的Java安装,则“修复”将取决于您如何运行catalina.sh If you are running it by hand from a shell, make sure that JAVA_HOME is set and exported correctly in your shell. 如果从外壳手动运行它,请确保已设置JAVA_HOME并将其正确导出到外壳中。 If you are running catalina.sh from an "init" script, check what the script is doing ... 如果您通过“ init”脚本运行catalina.sh ,请检查该脚本在做什么...


(It is unlikely that this is anything to do with permissions on catalina.sh itself.) (这不太可能与catalina.sh本身的权限有关。)

sudo sh startup.sh worked. 须藤sh startup.sh工作。 Thanks to all of you to provide me answer previously It is worked fine with only sh startup.sh. 谢谢大家以前给我的答复只有sh startup.sh可以正常工作。 It is java permision problem i find now i set full permission on java it is work with sh startup.sh as well. 我发现这是java渗透问题,现在我对java设置了完全权限,它也可以与sh startup.sh一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用Java 8运行Spring 4和Tomcat 8 - Can't run Spring 4 and Tomcat 8 with Java 8 在使用tomcat for Java Web应用程序的linux机器上,当我从tomcat运行应用程序时,文件/文件夹创建/修改权限被拒绝的问题 - On linux machine using tomcat for java web application, when i run application from tomcat, file/folder creation/modify permission denied issue 嵌入的tomcat权限被拒绝 - Permission denied with embeded tomcat Jenkins将不会运行PHPUunit-权限被拒绝 - Jenkins won't run PHPUunit - Permission denied Java.net.SockerException 连接失败 - TOMCAT 7.0.76 权限被拒绝 - Java.net.SockerException Connect Failed - Permission Denied TOMCAT 7.0.76 java.net.SocketException:权限被拒绝:连接启动Tomcat 7 - java.net.SocketException: Permission denied: connect Starting Tomcat 7 在 Java/Springboot 中创建文件时权限被拒绝错误 - Tomcat - Permission Denied Error when Creating file in Java/Springboot - Tomcat 在 Tomcat7 上部署后,Java Spring 应用程序无法运行 - Java Spring app can't run after deploy on Tomcat7 从Java程序运行时ADB权限被拒绝 - Adb permission denied when run from Java program 尝试在 Mac 上通过 Java 运行应用程序时权限被拒绝 - Permission denied when trying to run app through Java on Mac
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM