简体   繁体   English

java SocketPermission 只适用于 eclipse 而不适用于 tomcat 服务器

[英]java SocketPermission only works in eclipse not in tomcat server

In our application have to call external web service.We enabled java security manager to our project.在我们的应用程序中必须调用外部 Web 服务。我们为我们的项目启用了 java 安全管理器。 This is how we grant the permission to call the web service,这就是我们如何授予调用 Web 服务的权限,

permission java.net.SocketPermission "servername:80", "connect, resolve";权限 java.net.SocketPermission "servername:80", "connect, resolve";

it's work perfectly on eclipse IDE.but when we deployed it into tomcat server , no responed.它在 Eclipse IDE 上完美运行。但是当我们将它部署到 tomcat 服务器时,没有响应。 Any ideas?有任何想法吗? Please help.请帮忙。

I fixed that problem.我解决了那个问题。 Need to add SocketPermission and other security permissions of the security manager in catalina.policy file(WEB APPLICATION PERMISSIONS)as well in order to run perfectly.还需要在catalina.policy文件(WEB APPLICATION PERMISSIONS)中添加安全管理器的SocketPermission等安全权限,才能完美运行。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM