如何通过SSL连接字符串调试JBoss / Oracle JDBC?

时间:2016-10-14 03:10:33

标签: java oracle ssl jdbc jboss

我正在尝试配置一个JBoss数据源,它通过Oracle瘦客户端连接到Oracle数据库

JBoss版本:6.4.5.GA Oracle版本:12.1.0.2.0 瘦客户机JDBC版本:11.2.0.3.0

以下未加密的数据源无问题

<datasource jta="true" jndi-name="java:/IDP_DS" pool-name="IDP_DS" enabled="true" use-java-context="true">
    <connection-url>jdbc:oracle:thin:@(DESCRIPTION=(CONNECT_TIMEOUT=3)(TRANSPORT_CONNECT_TIMEOUT=3)(ADDRESS_LIST= (LOAD_BALANCE=on) (ADDRESS=(PROTOCOL=TCP)(HOST=[HOSTNAME])(PORT=1521)) ) (CONNECT_DATA=(SERVICE_NAME= [SERVICENAME]))))</connection-url>
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <driver>oracle</driver>
    <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
    <pool>
        <min-pool-size>1</min-pool-size>
        <max-pool-size>100</max-pool-size>
    </pool>
    <security>
        <user-name>[DB user]</user-name>
        <password>[DB password]</password>
    </security>
    <validation>
        <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
    </validation>
    <timeout>
        <blocking-timeout-millis>20000</blocking-timeout-millis>
        <idle-timeout-minutes>2</idle-timeout-minutes>
    </timeout>
    <statement>
        <prepared-statement-cache-size>20</prepared-statement-cache-size>
    </statement>
</datasource>

以下引发SSL握手失败异常(见下文)

<datasource jta="true" jndi-name="java:/IDP_DS" pool-name="IDP_DS" enabled="true" use-java-context="true">
    <connection-url>jdbc:oracle:thin:@(DESCRIPTION=(CONNECT_TIMEOUT=3)(TRANSPORT_CONNECT_TIMEOUT=3)(ADDRESS_LIST= (LOAD_BALANCE=on) (ADDRESS=(PROTOCOL=TCPS)(HOST=[HOSTNAME])(PORT=2484  )) ) (CONNECT_DATA=(SERVICE_NAME= [SERVICE NAME]))))</connection-url>
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <driver>oracle</driver>
    <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
    <pool>
        <min-pool-size>1</min-pool-size>
        <max-pool-size>100</max-pool-size>
    </pool>
    <security>
        <user-name>[DB user]</user-name>
        <password>[DB password]</password>
    </security>
    <validation>
        <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
    </validation>
    <timeout>
        <blocking-timeout-millis>20000</blocking-timeout-millis>
        <idle-timeout-minutes>2</idle-timeout-minutes>
    </timeout>
    <statement>
        <prepared-statement-cache-size>20</prepared-statement-cache-size>
    </statement>
</datasource>

抛出异常:

14:01:45,680 ERROR [org.jboss.as.ejb3.invocation] (http-/0.0.0.0:8443-1) JBAS014134: EJB Invocation failed on component PreferencesBean for method public abstract java.util.Map com.adobe.idp.config.PreferencesSPI.getSystemRoot() throws com.adobe.idp.common.errors.exception.IDPException,com.adobe.idp.common.errors.exception.IDPSystemException: com.adobe.idp.common.errors.exception.IDPSystemExceptionorigin: com.adobe.idp.common.errors.exception.IDPException| [com.adobe.idp.storeprovider.database.DBDatasourceFactory] errorCode:8193 errorCodeHEX:0x2001 message:javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/IDP_DS
        at com.adobe.idp.config.PreferencesBean.getSystemRoot(PreferencesBean.java:93) [um.jar:]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_91]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_91]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_91]
        at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_91]
        at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52) 
        ...

Caused by: java.sql.SQLRecoverableException: IO Error: Remote host closed connection during handshake
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:467)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
        at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:323)
        ... 178 more
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:992) [jsse.jar:1.8.0_91]
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) [jsse.jar:1.8.0_91]
        at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:747) [jsse.jar:1.8.0_91]
        at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123) [jsse.jar:1.8.0_91]
        at oracle.net.ns.Packet.send(Packet.java:403)
        at oracle.net.ns.ConnectPacket.send(ConnectPacket.java:198)
        at oracle.net.ns.NSProtocol.connect(NSProtocol.java:293)
        at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1102)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:320)
        ... 183 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
        at sun.security.ssl.InputRecord.read(InputRecord.java:505) [jsse.jar:1.8.0_91]
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973) [jsse.jar:1.8.0_91]
        ... 191 more

相应的证书已添加到$ JAVA_HOME / jre / lib / security / cacerts信任商店但没有运气

数据库服务器报告“未知错误”

DBA已成功使用连接字符串(使用SQL开发人员和SQL Plus),但已使用Oracle Wallet进行证书处理

我尝试使用Squirrel连接,但没有运气。有没有更好的方法来调试它?

0 个答案:

没有答案