我正在尝试通过OpenText socks Client通过防火墙从本地计算机中的Spring应用程序中的Spring应用程序连接MS Azure中的SQL Server数据库,但是,我在下面遇到了错误,
与主机的TCP / IP连接(端口1433)失败。错误:“地址错误:连接。请验证连接属性。请确保主机上正在运行SQL Server实例并在端口上接受TCP / IP连接。请确保防火墙未阻止与端口的TCP连接”。
我可以通过SQL Server Management Studio连接到同一数据库,而通过OpenText袜子客户端则没有任何问题。但是,当我尝试在tomcat服务器中部署spring mvc应用程序时遇到了问题。部署失败,提示下面的堆栈跟踪,
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host <host name here>, port 1433 has failed. Error: "Bad address: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:206)
at com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException(SQLServerException.java:257)
at com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2385)
at com.microsoft.sqlserver.jdbc.TDSChannel.open(IOBuffer.java:567)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1955)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1616)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1447)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:788)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1187)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:153)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:144)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:196)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:159)
at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:386)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:84)
... 31 more
我曾尝试在Azure中将我的IP地址列入白名单,但这没有用。 我还尝试过将STS添加到袜子应用程序列表中,但是没有运气。
有人可以指导我通过防火墙从Spring MVC应用程序通过OpenText袜子客户端通过MS在Microsoft Azure中连接SQLServer吗?还是您可以建议其他方法来实现此目的,而不是OpenText Socks Client?