连接到Oracle数据库云服务数据源时的javax.net.ssl.SSLHandshakeException

时间:2017-06-22 17:16:12

标签: java oracle ssl jcs

我有一个将部署到Oracle Java Cloud Service的Java应用程序。我在Oracle数据库云服务中创建了一个表,并在Java云服务中创建了一个数据源。我的数据源已启动并正在运行。现在以编程方式我正在尝试连接到DB,如下所示。

OracleConnection conn=null;
    javax.sql.DataSource ds=null;
    Hashtable env = new Hashtable();
    env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
    env.put(Context.PROVIDER_URL, "https://<host>:7002");


    try{
      Context context=new InitialContext( env );
      //you will need to have create a Data Source with JNDI name testDS
      ds=(javax.sql.DataSource) context.lookup ("jdbc/testDS");
      conn=(OracleConnection) ds.getConnection();
      java.util.Properties prop = new java.util.Properties();
      System.out.println("Connection object details : "+conn);
      conn.close();
    }catch(Exception ex){
      //handle the exception
        System.out.println("Exception "+ ex);
    }

我得到了下面提到的问题

Exception javax.naming.CommunicationException: https://<host>:7002: [RJVM:000575]Destination <host>, 7002 unreachable.; nested exception is:
  javax.net.ssl.SSLHandshakeException: General SSLEngine problem; [RJVM:000576]No available router to destination.; nested exception is:
  java.rmi.ConnectException: [RJVM:000576]No available router to destination. [Root exception is java.net.ConnectException: https://<host>:7002: [RJVM:000575]Destination <host>, 7002 unreachable.; nested exception is:
  javax.net.ssl.SSLHandshakeException: General SSLEngine problem; [RJVM:000576]No available router to destination.; nested exception is:
  java.rmi.ConnectException: [RJVM:000576]No available router to destination.]

有人可以建议我解决上述问题吗?

0 个答案:

没有答案