背景:Tomcat启动时,从外部启动是正常的,但从eclipse启动就会有下面的异常
2009/11/02 10:52:25 org.apache.struts.action.ActionServlet initModuleDataSources
SEVERE: Initializing application data source org.apache.struts.action.DATA_SOURCE
Something unusual has occured to cause the driver to fail. Please report this exception:
Exception: java.security.AccessControlException: access denied
(java.net.SocketPermission 172.28.139.113:5432 connect,resolve)
Stack Trace:
java.security.AccessControlException: access denied (java.net.SocketPermission 172.28.139.113:5432 connect,resolve)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
at java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
......
为了这个
java.security.AccessControlException摆弄半天也没解决。
秉承"知之为知之,不知google之"的原则,从网上找原因,还是eclipse的Tomcat参数设置不对。
进入:Window ->Preference ->Tomcat,在设置Tomcat路径的下面有个复选框"使用security manager启动Tomcat",把他设置成未选中状态。原来是安全权限不够。
以上。