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
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.
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.