org.apache.jasper.JasperException: An exception occurred processing JSP page /azure.jsp at line 18
15: ;
16: Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
17:
18: Connection connect = DriverManager.getConnection(connectionString);
19: if(connect!=null)
20: out.println("Connected");
21: else
------------------------------------------------------------------------
java.security.AccessControlException: access denied (java.net.SocketPermission sahilpaudel.database.windows.net:1433 connect,resolve)
java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
java.security.AccessController.checkPermission(AccessController.java:546)
java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
com.microsoft.sqlserver.jdbc.SQLServerConnectionSecurityManager.checkConnect(SQLServerConnection.java:3218)
com.microsoft.sqlserver.jdbc.ServerPortPlaceHolder.doSecurityCheck(FailOverInfo.java:144)
com.microsoft.sqlserver.jdbc.ServerPortPlaceHolder.<init>(FailOverInfo.java:135)
com.microsoft.sqlserver.jdbc.SQLServerConnection.primaryPermissionCheck(SQLServerConnection.java:984)
com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:816)
com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:716)
com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:841)
java.sql.DriverManager.getConnection(DriverManager.java:582)
java.sql.DriverManager.getConnection(DriverManager.java:207)
org.apache.jsp.azure_jsp._jspService(azure_jsp.java:82)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
我试图从jsp页面连接到azure数据库,但我收到此错误 我已经添加了防火墙设置,但它仍然存在。 Azure,jsp是我在线服务器中的jsp文件名。
答案 0 :(得分:0)
您能否将其添加到策略文件中,看看是否有帮助?实际上,它是一个非常古老的问题类型,并且应该没有云特定的任何内容。
grant
{
...
permission java.net.SocketPermission "*:1433","connect,resolve";
};