glassfish
  1. glassfish
  2. GLASSFISH-19489

JDBC connections to Oracle with Wallet fail

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.2.2
    • Fix Version/s: None
    • Component/s: jdbc
    • Labels:
      None
    • Environment:

      Description

      Oracle JDBC 11.2.0.2
      /gf/glassfish/lib\ojdbc6.jar
      /gf/glassfish/lib\oraclepki.jar
      /gf/glassfish/lib\osdt_cert.jar
      /gf/glassfish/lib\osdt_core.jar

      /ora/admin/wallet/ewallet.p12
      /ora/admin/wallet/cwallet.sso
      /ora/admin/tnsnames.ora

      -Doracle.net.tns_admin=/ora/admin
      -Doracle.net.wallet_location=/ora/admin/wallet

      <jdbc-connection-pool res-type="javax.sql.DataSource" datasource-classname="oracle.jdbc.pool.OracleDataSource" name="DBpool" driver-classname="oracle.jdbc.OracleDriver">
      <property value="jdbc:oracle:thin:/@DB" name="URL"></property>
      </jdbc-connection-pool>
      <jdbc-resource pool-name="DBpool" description="" jndi-name="DBRES"></jdbc-resource>

      Please take a note that there is no user and password

      Simple test is working correctly
      OracleDataSource dsOracle = new OracleDataSource();
      dsOracle.setURL("jdbc:oracle:thin:/@DB");
      conn = dsOracle.getConnection(null,null);
      or conn = dsOracle.getConnection();

      But using connection pool not

      Context initContext = new InitialContext();
      DataSource ds = (DataSource)initContext.lookup("DBRES");
      ds.getConnection()

      We are getting exception
      " Connection could not be allocated because: ORA-01017: invalid username/password; logon denied Please check the server.log for more details. "

      While debugging I discovered that glassfish is passing to OracleDataSource
      empty string "" for "user" instead of null
      and empty string "" for password instead of null
      This is changing logic inside OracleDriver connected to reading user and password from secret store /ora/admin/wallet/cwallet.sso

        Activity

        krzysp created issue -
        sfelts made changes -
        Field Original Value New Value
        Assignee Shalini [ sm157516 ] sfelts [ sfelts ]

          People

          • Assignee:
            sfelts
            Reporter:
            krzysp
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: