0

我从托管在 tomcat (RHEL) 上的 Spring Hibernate Application 连接到 SQL Server 2008 时遇到问题

我的豆子:

<beans:bean id="sDataSource"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <beans:property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
        <beans:property name="url" value="jdbc:sqlserver://abc.com:1433;databaseName=ABC;" />
        <beans:property name="username" value="AAAAAAA" />
        <beans:property name="password" value="XXXXXXXX" />
    </beans:bean>

最初我收到此错误:

[04-18-2016 17:45:01,837-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Entering Method getSession()]
[04-18-2016 17:45:01,882-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Exiting Method getSession()]
[04-18-2016 17:45:01,901-0400] [Line:   ?] ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] [The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SSLv3 SSLContext not available".]
[04-18-2016 17:45:01,902-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Entering Method returnSession()]
[04-18-2016 17:45:01,903-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Exiting Method returnSession()]

然后我遇到了这个问题,并进行了更改-Dcom.ibm.jsse2.disableSSLv3=false

然后我得到了这个错误:

[04-18-2016 17:47:45,728-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Entering Method getSession()]
[04-18-2016 17:47:45,815-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Exiting Method getSession()]
[04-18-2016 17:47:45,845-0400] [Line:   ?] ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] [The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "No appropriate protocol (protocol is disabled or cipher suites are inappropriate)".]
[04-18-2016 17:47:45,847-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Entering Method returnSession()]
[04-18-2016 17:47:45,848-0400] [Line:   ?] DEBUG [com.services.hibernate.SessionHandler] [Exiting Method returnSession()]

该代码完全正常运行,因为它在我的本地环境中返回结果,但是当我将它部署在云(RHEL V6)中时,我收到了这些错误。

请帮帮我。我完全被困在这一点上。

我需要在 Linux 服务器上安装一些东西吗?

4

1 回答 1

0

比较 Java 的版本。我在 Java8 build 50 中遇到了一个问题,其中某些密码已被弃用和删除,因此我们的应用程序突然无法建立 SSL 连接,因为双方无法就要使用的密码达成一致。对我来说,这看起来很相似。

还可能值得检查一下是否在您的桌面上安装了无限强度加密,而不是在服务器上。

出于绝望,您可以尝试使用 -Djavax.net.debug=ALL 或其他方式运行应用程序(取决于您需要多少细节),是一个开始工作的起点。您必须将它添加到 tomcat.conf (或环境变量在您的版本中的任何位置)。

于 2016-04-19T02:03:31.583 回答