开发者

How to beat JSoup access denied java.net.SocketPermission in tomcat 6?

开发者 https://www.devze.com 2023-02-04 23:21 出处:网络
I gotexception java.security.AccessControlException: access denied (java.net.SocketPermission www.somepage.net:80 conne开发者_如何学Goct,resolve) when I try

I got exception java.security.AccessControlException: access denied (java.net.SocketPermission www.somepage.net:80 conne开发者_如何学Goct,resolve) when I try

doc = Jsoup.connect("http://www.somepage.net/").get();

in web app in Tomcat 6. However if I do this in mvn test outside of tomcat 6 or in another web app in tc server all is going great.


You need to edit the /conf/catalina.policy file to grant java.net.SocketPermission on the code in question.

See also Tomcat 6.0 Security Manager HOW-TO.

0

精彩评论

暂无评论...
验证码 换一张
取 消