oracle-databasejdbcvirtual-machineoid

Cannot connect Oracle ldap server(OID) in a virtual machine through JDBC


I set up an Oracle with LDAP (OID) in an virtual machine, create a user named "qa1user" authenticated through LDAP server.

Check with SqlPlus in VM and successfully logon to Oracle:

sqlplus qa1user/xxxx

Then I port forwarding these ports as:
LDAP server port: 3060 --> 4060,
Oracle port: 1521 --> 11521

and could also logon to Oracle on the host where VM resides.

sqlplus qa1user/xxxx@localhost:11521/orcl 

Question:

I can not connect to LDAP through JDBC:

jdbc:oracle:thin:@ldap://127.0.0.1:4060/orcl,cn=OracleContext,dc=phl,dc=sap,dc=corp

and UserName is:

cn=qa1user,cn=Users,dc=phl,dc=sap,dc=corp

See the screen shot about OID configuration and errors.

OID user configuration

Cannot connect outside VM


Solution

  • Finally, I know the root cause. There's one listener running on my local machine, also listening on the port 1521, which counld not identify the database running in the VM. Shutdown it, and then everything is OK.