averemee-si / oracdc

Oracle database CDC (Change Data Capture)
http://a2-solutions.eu/
Apache License 2.0
107 stars 37 forks source link

Cannot use username and password with Materialized View Logs connector #34

Closed dellekappa closed 1 year ago

dellekappa commented 1 year ago

Using this configuration:

{
   "name" : "my-connector",
   "config" : {
     "connector.class" : "solutions.a2.cdc.oracle.OraCdcSourceConnector",
     "a2.wallet.location": "",
     "a2.jdbc.url" : "jdbc:oracle:thin:@//oracle:1521/ORCLPDB1",
     "a2.jdbc.username" : "scott",
     "a2.jdbc.password" : "tiger"
    ...
   }
 }

this appears into the log

[2022-11-11 14:45:33,945] INFO [my-connector|worker] Connecting to Oracle RDBMS using Oracle Wallet (solutions.a2.cdc.oracle.OraCdcSourceConnector:74)
[2022-11-11 14:45:33,945] INFO [my-connector|worker] Starting connection to database jdbc:oracle:thin:@//oracle:1521/ORCLPDB1... (solutions.a2.cdc.oracle.OraPoolConnectionFactory:73)
[2022-11-11 14:45:35,367] ERROR [my-connector|worker] Unable to initialize database connection. (solutions.a2.cdc.oracle.OraCdcSourceConnector:96)
[2022-11-11 14:45:35,369] ERROR [my-connector|worker] oracle.ucp.UniversalConnectionPoolException: Cannot get Connection from Datasource: java.sql.SQLException: ORA-01017: invalid username/password; logon denied

the problem resides at line 73 of OraCdcSourceConnector

if (StringUtils.isNotBlank(ParamConstants.CONNECTION_WALLET_PARAM)) {

that checks that the constant is not blank (and never it will be ;) ) instead of the property value

averemee-si commented 1 year ago

Salve Giulio,

Grazie mille per la correzione e il consiglio!

Done. Please see - https://github.com/averemee-si/oracdc/commit/ab292b334b1732822b7eb1164c31c1c4c994dd20

Cordiali saluti, Alessio

averemee-si commented 1 year ago

No reponse from filer in two weeks