我已使用Tomcat 7在NetBeans中实现了一个Web应用程序。此应用程序在localhost中正常运行。我试图在网站托管网站上传这个应用程序,它似乎正确上传。问题是,在某些时候,它抛出以下异常,我无法弄清楚是什么问题。我已经阅读了一些有相同问题的帖子,但问题仍然存在。
根本原因
java.security.AccessControlException: access denied ("java.util.PropertyPermission" "ssl.TrustManagerFactory.algorithm" "read")
java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)
java.security.AccessController.checkPermission(AccessController.java:555)
java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302)
java.lang.System.getProperty(System.java:706)
org.apache.http.conn.ssl.SSLSocketFactory.createSystemSSLContext(SSLSocketFactory.java:255)
org.apache.http.conn.ssl.SSLSocketFactory.createSystemSSLContext(SSLSocketFactory.java:366)
org.apache.http.conn.ssl.SSLSocketFactory.getSystemSocketFactory(SSLSocketFactory.java:204)
org.apache.http.impl.conn.SchemeRegistryFactory.createSystemDefault(SchemeRegistryFactory.java:82)
org.apache.http.impl.client.SystemDefaultHttpClient.createClientConnectionManager(SystemDefaultHttpClient.java:118)
org.apache.http.impl.client.AbstractHttpClient.getConnectionManager(AbstractHttpClient.java:466)
org.apache.http.impl.client.AbstractHttpClient.createHttpContext(AbstractHttpClient.java:286)
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:851)
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
org.apache.jena.riot.web.HttpOp.execHttpGet(HttpOp.java:148)
org.apache.jena.riot.stream.LocatorURL.open(LocatorURL.java:47)
org.apache.jena.riot.stream.StreamManager.openNoMapOrNull(StreamManager.java:124)
org.apache.jena.riot.stream.StreamManager.open(StreamManager.java:81)
org.apache.jena.riot.RDFDataMgr.open(RDFDataMgr.java:725)
org.apache.jena.riot.RDFDataMgr.open(RDFDataMgr.java:714)
org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:649)
org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:211)
org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:184)
org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:122)
org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:113)
org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:77)
com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:247)
com.hp.hpl.jena.util.FileManager.readModelWorker(FileManager.java:378)
com.hp.hpl.jena.util.FileManager.loadModelWorker(FileManager.java:309)
com.hp.hpl.jena.util.FileManager.loadModel(FileManager.java:261)
MyServlet.doPost(MyServlet.java:127)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:271)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:536)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:166)
只是提到在我的类中显示的堆栈跟踪(MyServlet.doPost(MyServlet.java:127))中只有一个页面的URL。
任何想法都会受到赞赏!
答案 0 :(得分:0)
您要上传到的Tomcat服务器正在安全管理器下运行,该管理器不允许Tomcat读取ssl.TrustManagerFactory.algorithm
系统属性。您需要请求您的托管服务提供商调整安全策略以允许Tomcat读取此属性。