[Date Prev][Date Next] [Chronological] [Thread] [Top]

JDBC-LDAP bridge driver error



Hi ,

I am using JDBC-LDAP Bridge driver (octetstring) for 
querying  data form openldap3.0, but i am getting error.
Please let me know what could bethe reason.

The source java source code is,
==============================
driver.java

import java.sql.*;
import java.io.*;
import java.util.*;
import java.lang.*;
import com.octetstring.jdbcLdap.sql.*;
import com.octetstring.jdbcLdap.sql.statements.*;
import com.octetstring.jdbcLdap.jndi.*;

 class  driver {

 public  static void  main(String[]  args) {
  try {
    Class.forName("com.octetstring.jdbcLdap.sql.JdbcLdapDriver");

    String ldapConnStr =
"jdbc:ldap://134.15.15.4:9998/cn=CIMOM,o=WSSPL,C=INDIA?SEARCH_SCOPE:=subTree
Scope";

 Connection  con =
DriverManager.getConnection(ldapConnStr,"cn=CIMOM,o=WSSPL,c=INDIA"
,"secret");
   // PreparedStatement  pstmt = null;
   String stmt =  "SELECT cn,o,c FROM c=INDIA WHERE c=?";
   PreparedStatement pstmt = con.prepareStatement(stmt);
   ResultSet rs = pstmt.executeQuery(stmt);
  while(rs.next())
       {

     System.out.println("The DN=" +  rs.getString("dn") + ", o=" +
rs.getString("o") + ",c=" + rs.getString("c"));

        }

     }
catch (SQLException ex){
    System.out.println("SQL exception");
    }
catch (Exception ex1){
  System.out.println("exception");
    }

 }
}

=======================================

When i run this java application i get following error,

=======================================

javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object];
remaining name 'cn=CIMOM,o=WSSPL,C=INDIA'
        at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:2889)
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2810)
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2616)
        at com.sun.jndi.ldap.LdapCtx.c_lookup(LdapCtx.java:931)
        at
com.sun.jndi.toolkit.ctx.ComponentContext.p_lookup(ComponentContext.java:522
)
        at
com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(PartialCompositeCont
ext.java:155)
        at
com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(PartialCompositeCont
ext.java:144)
        at javax.naming.InitialContext.lookup(InitialContext.java:347)
        at
com.octetstring.jdbcLdap.jndi.JndiLdapConnection.isClosed(JndiLdapConnection
.java:270)
        at
com.octetstring.jdbcLdap.jndi.JndiLdapConnection.<init>(JndiLdapConnection.j
ava:241)
        at
com.octetstring.jdbcLdap.sql.JdbcLdapDriver.connect(JdbcLdapDriver.java:75)
        at java.sql.DriverManager.getConnection(DriverManager.java:512)
        at java.sql.DriverManager.getConnection(DriverManager.java:512)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
        at driver.main(driver.java:17)
        exception

====================================

The openldap log is,


               ...................

               ...................

line 5 (schemacheck     on)
line 7 (pidfile     /home/old-home/user/wilson/cimom/ldap/sample/slapd.pid)
line 13 (database   ldbm)
line 14 (suffix     "o=WSSPL,c=INDIA")
line 15 (directory  /home/old-home/user/wilson/cimom/ldap/sample/database)
line 16 (rootdn     "cn=CIMOM,o=WSSPL,c=INDIA")
line 17 (rootpw      secret )
line 18 (index           objectClass pres,eq)
index objectClass 0x0006
line 19 (index           uid     pres,eq,sub)
index uid 0x0716
line 20 (index           cn,sn   pres,eq,sub,subany)
index cn 0x0716
index sn 0x0716
line 22 (dbnosync)
line 23 (dbnolocking)
slapd startup: initiated.
slapd starting
daemon: added 6r
daemon: select: listen=6 active_threads=0 tvp=NULL
daemon: activity on 1 descriptors
daemon: new connection on 9
ldap_pvt_gethostbyname_a: host=virgo, r=0
daemon: conn=0 fd=9 connection from IP=134.15.15.35:1329
(IP=134.15.15.4:9998) accepted.
daemon: added 9r
daemon: activity on:
daemon: select: listen=6 active_threads=0 tvp=NULL
daemon: activity on 1 descriptors
daemon: activity on: 9r
daemon: read activity on 9
connection_get(9)
connection_get(9): got connid=0
connection_read(9): checking for input on id=0
ber_get_next
ldap_read: want=1, got=1
  0000:  30                                                 0
ldap_read: want=1, got=1
  0000:  47                                                 G
ldap_read: want=71, got=71
  0000:  02 01 01 60 25 02 01 03  04 18 63 6e 3d 43 49 4d   ...`%.....cn=CIM
  0010:  4f 4d 2c 6f 3d 57 53 53  50 4c 2c 63 3d 49 4e 44   OM,o=WSSPL,c=IND
  0020:  49 41 80 06 73 65 63 72  65 74 a0 1b 30 19 04 17   IA..secret..0...
  0030:  32 2e 31 36 2e 38 34 30  2e 31 2e 31 31 33 37 33   2.16.840.1.11373
  0040:  30 2e 33 2e 34 2e 32                               0.3.4.2
ber_get_next: tag 0x30 len 71 contents:
ber_dump: buf=0x080d81a8 ptr=0x080d81a8 end=0x080d81ef len=71
  0000:  02 01 01 60 25 02 01 03  04 18 63 6e 3d 43 49 4d   ...`%.....cn=CIM
  0010:  4f 4d 2c 6f 3d 57 53 53  50 4c 2c 63 3d 49 4e 44   OM,o=WSSPL,c=IND
  0020:  49 41 80 06 73 65 63 72  65 74 a0 1b 30 19 04 17   IA..secret..0...
  0030:  32 2e 31 36 2e 38 34 30  2e 31 2e 31 31 33 37 33   2.16.840.1.11373
  0040:  30 2e 33 2e 34 2e 32                               0.3.4.2
ber_get_next
ldap_read: want=1 error=Resource temporarily unavailable
ber_get_next on fd 9 failed errno=11 (Resource temporarily unavailable)
daemon: select: listen=6 active_threads=1 tvp=NULL
do_bind
ber_scanf fmt ({iat) ber:
ber_dump: buf=0x080d81a8 ptr=0x080d81ab end=0x080d81ef len=68
  0000:  60 25 02 01 03 04 18 63  6e 3d 43 49 4d 4f 4d 2c   `%.....cn=CIMOM,
  0010:  6f 3d 57 53 53 50 4c 2c  63 3d 49 4e 44 49 41 80   o=WSSPL,c=INDIA.
  0020:  06 73 65 63 72 65 74 a0  1b 30 19 04 17 32 2e 31   .secret..0...2.1
  0030:  36 2e 38 34 30 2e 31 2e  31 31 33 37 33 30 2e 33   6.840.1.113730.3
  0040:  2e 34 2e 32                                        .4.2
ber_scanf fmt (o}) ber:
ber_dump: buf=0x080d81a8 ptr=0x080d81ca end=0x080d81ef len=37
  0000:  80 06 73 65 63 72 65 74  a0 1b 30 19 04 17 32 2e   ..secret..0...2.
  0010:  31 36 2e 38 34 30 2e 31  2e 31 31 33 37 33 30 2e   16.840.1.113730.
  0020:  33 2e 34 2e 32                                     3.4.2
=> get_ctrls
ber_scanf fmt ({a) ber:
ber_dump: buf=0x080d81a8 ptr=0x080d81d4 end=0x080d81ef len=27
  0000:  30 19 04 17 32 2e 31 36  2e 38 34 30 2e 31 2e 31   0...2.16.840.1.1
  0010:  31 33 37 33 30 2e 33 2e  34 2e 32                  13730.3.4.2
=> get_ctrls: oid="2.16.840.1.113730.3.4.2" (noncritical)
<= get_ctrls: 1 0
do_bind: version=3 dn="cn=CIMOM,o=WSSPL,c=INDIA" method=128
conn=0 op=0 BIND dn="CN=CIMOM,O=WSSPL,C=INDIA" method=128
==> ldbm_back_bind: dn: cn=CIMOM,o=WSSPL,c=INDIA
dn2entry_r: dn: "CN=CIMOM,O=WSSPL,C=INDIA"
=> dn2id( "CN=CIMOM,O=WSSPL,C=INDIA" )
=> ldbm_cache_open(
"/home/old-home/user/wilson/cimom/ldap/sample/database/dn2id.gdbm", 82, 600
)
ldbm_cache_open (blksize 4096) (maxids 1022) (maxindirect 9)
<= ldbm_cache_open (opened 0)
<= dn2id 2
=> id2entry_r( 2 )
=> ldbm_cache_open(
"/home/old-home/user/wilson/cimom/ldap/sample/database/id2entry.gdbm", 82,
600 )
ldbm_cache_open (blksize 4096) (maxids 1022) (maxindirect 9)
<= ldbm_cache_open (opened 1)
=> str2entry
<= str2entry(cn=CIMOM, o=WSSPL, c=INDIA) -> -1 (0x80d6b28)
<= id2entry_r( 2 ) 0x80d6b28 (disk)
====> cache_return_entry_r( 2 ): created (0)
do_bind: v3 bind: "cn=CIMOM,o=WSSPL,c=INDIA" to "cn=CIMOM,o=WSSPL,c=INDIA"
send_ldap_result: conn=0 op=0 p=3
send_ldap_result: 0::
send_ldap_response: msgid=1 tag=97 err=0
ber_flush: 14 bytes to sd 9
  0000:  30 0c 02 01 01 61 07 0a  01 00 04 00 04 00         0....a........
ldap_write: want=14, written=14
  0000:  30 0c 02 01 01 61 07 0a  01 00 04 00 04 00         0....a........
conn=0 op=0 RESULT tag=97 err=0 text=
daemon: activity on 1 descriptors
daemon: activity on: 9r
daemon: read activity on 9
connection_get(9)
connection_get(9): got connid=0
connection_read(9): checking for input on id=0
ber_get_next
ldap_read: want=1, got=1
  0000:  30                                                 0
ldap_read: want=1, got=1
  0000:  73                                                 s
ldap_read: want=115, got=115
  0000:  02 01 02 63 51 04 31 63  6e 3d 43 49 4d 4f 4d 2c   ...cQ.1cn=CIMOM,
  0010:  6f 3d 57 53 53 50 4c 2c  43 3d 49 4e 44 49 41 2c   o=WSSPL,C=INDIA,
  0020:  63 6e 3d 43 49 4d 4f 4d  2c 6f 3d 57 53 53 50 4c   cn=CIMOM,o=WSSPL
  0030:  2c 43 3d 49 4e 44 49 41  0a 01 00 0a 01 03 02 01   ,C=INDIA........
  0040:  00 02 01 00 01 01 00 87  0b 6f 62 6a 65 63 74 43   .........objectC
  0050:  6c 61 73 73 30 00 a0 1b  30 19 04 17 32 2e 31 36   lass0...0...2.16
  0060:  2e 38 34 30 2e 31 2e 31  31 33 37 33 30 2e 33 2e   .840.1.113730.3.
  0070:  34 2e 32                                           4.2
ber_get_next: tag 0x30 len 115 contents:
ber_dump: buf=0x080d81a8 ptr=0x080d81a8 end=0x080d821b len=115
  0000:  02 01 02 63 51 04 31 63  6e 3d 43 49 4d 4f 4d 2c   ...cQ.1cn=CIMOM,
  0010:  6f 3d 57 53 53 50 4c 2c  43 3d 49 4e 44 49 41 2c   o=WSSPL,C=INDIA,
  0020:  63 6e 3d 43 49 4d 4f 4d  2c 6f 3d 57 53 53 50 4c   cn=CIMOM,o=WSSPL
  0030:  2c 43 3d 49 4e 44 49 41  0a 01 00 0a 01 03 02 01   ,C=INDIA........
  0040:  00 02 01 00 01 01 00 87  0b 6f 62 6a 65 63 74 43   .........objectC
  0050:  6c 61 73 73 30 00 a0 1b  30 19 04 17 32 2e 31 36   lass0...0...2.16
  0060:  2e 38 34 30 2e 31 2e 31  31 33 37 33 30 2e 33 2e   .840.1.113730.3.
  0070:  34 2e 32                                           4.2
ber_get_next
ldap_read: want=1 error=Resource temporarily unavailable
ber_get_next on fd 9 failed errno=11 (Resource temporarily unavailable)
daemon: select: listen=6 active_threads=1 tvp=NULL
do_search
ber_scanf fmt ({aiiiib) ber:
ber_dump: buf=0x080d81a8 ptr=0x080d81ab end=0x080d821b len=112
  0000:  63 51 04 31 63 6e 3d 43  49 4d 4f 4d 2c 6f 3d 57   cQ.1cn=CIMOM,o=W
  0010:  53 53 50 4c 2c 43 3d 49  4e 44 49 41 2c 63 6e 3d   SSPL,C=INDIA,cn=
  0020:  43 49 4d 4f 4d 2c 6f 3d  57 53 53 50 4c 2c 43 3d   CIMOM,o=WSSPL,C=
  0030:  49 4e 44 49 41 0a 01 00  0a 01 03 02 01 00 02 01   INDIA...........
  0040:  00 01 01 00 87 0b 6f 62  6a 65 63 74 43 6c 61 73   ......objectClas
  0050:  73 30 00 a0 1b 30 19 04  17 32 2e 31 36 2e 38 34   s0...0...2.16.84
  0060:  30 2e 31 2e 31 31 33 37  33 30 2e 33 2e 34 2e 32   0.1.113730.3.4.2
SRCH "cn=CIMOM,o=WSSPL,C=INDIA,cn=CIMOM,o=WSSPL,C=INDIA" 0 3    0 0 0
begin get_filter
PRESENT
ber_scanf fmt (o) ber:
ber_dump: buf=0x080d81a8 ptr=0x080d81ef end=0x080d821b len=44
  0000:  87 0b 6f 62 6a 65 63 74  43 6c 61 73 73 30 00 a0   ..objectClass0..
  0010:  1b 30 19 04 17 32 2e 31  36 2e 38 34 30 2e 31 2e   .0...2.16.840.1.
  0020:  31 31 33 37 33 30 2e 33  2e 34 2e 32               113730.3.4.2
end get_filter 0
    filter: (objectClass=*)
ber_scanf fmt ({v}}) ber:
ber_dump: buf=0x080d81a8 ptr=0x080d81fc end=0x080d821b len=31
  0000:  30 00 a0 1b 30 19 04 17  32 2e 31 36 2e 38 34 30   0...0...2.16.840
  0010:  2e 31 2e 31 31 33 37 33  30 2e 33 2e 34 2e 32      .1.113730.3.4.2
=> get_ctrls
ber_scanf fmt ({a) ber:
ber_dump: buf=0x080d81a8 ptr=0x080d8200 end=0x080d821b len=27
  0000:  30 19 04 17 32 2e 31 36  2e 38 34 30 2e 31 2e 31   0...2.16.840.1.1
  0010:  31 33 37 33 30 2e 33 2e  34 2e 32                  13730.3.4.2
=> get_ctrls: oid="2.16.840.1.113730.3.4.2" (noncritical)
<= get_ctrls: 1 0
    attrs:
conn=0 op=1 SRCH base="cn=CIMOM,o=WSSPL,C=INDIA,cn=CIMOM,o=WSSPL,C=INDIA"
scope=
0 filter="(objectClass=*)"
=> ldbm_back_search
dn2entry_r: dn: "CN=CIMOM,O=WSSPL,C=INDIA,CN=CIMOM,O=WSSPL,C=INDIA"
=> dn2id( "CN=CIMOM,O=WSSPL,C=INDIA,CN=CIMOM,O=WSSPL,C=INDIA" )
=> ldbm_cache_open(
"/home/old-home/user/wilson/cimom/ldap/sample/database/dn2id
.gdbm", 82, 600 )
<= ldbm_cache_open (cache 0)
<= dn2id NOID
dn2entry_r: dn: "O=WSSPL,C=INDIA,CN=CIMOM,O=WSSPL,C=INDIA"
=> dn2id( "O=WSSPL,C=INDIA,CN=CIMOM,O=WSSPL,C=INDIA" )
=> ldbm_cache_open(
"/home/old-home/user/wilson/cimom/ldap/sample/database/dn2id.gdbm", 82, 600
)
<= ldbm_cache_open (cache 0)
<= dn2id NOID
dn2entry_r: dn: "CN=CIMOM,O=WSSPL,C=INDIA"
=> dn2id( "CN=CIMOM,O=WSSPL,C=INDIA" )
====> cache_find_entry_dn2id("CN=CIMOM,O=WSSPL,C=INDIA"): 2 (1 tries)
<= dn2id 2 (in cache)
=> id2entry_r( 2 )
====> cache_find_entry_id( 2 ) "cn=CIMOM, o=WSSPL, c=INDIA" (found) (1
tries)
<= id2entry_r( 2 ) 0x80d6b28 (cache)
====> cache_return_entry_r( 2 ): returned (0)
send_ldap_result: conn=0 op=1 p=3
send_ldap_result: 10:cn=CIMOM, o=WSSPL, c=INDIA:
send_ldap_response: msgid=2 tag=101 err=32
ber_flush: 40 bytes to sd 9
  0000:  30 26 02 01 02 65 21 0a  01 20 04 1a 63 6e 3d 43   0&...e!.. ..cn=C
  0010:  49 4d 4f 4d 2c 20 6f 3d  57 53 53 50 4c 2c 20 63   IMOM, o=WSSPL, c
  0020:  3d 49 4e 44 49 41 04 00                            =INDIA..
ldap_write: want=40, written=40
  0000:  30 26 02 01 02 65 21 0a  01 20 04 1a 63 6e 3d 43   0&...e!.. ..cn=C
  0010:  49 4d 4f 4d 2c 20 6f 3d  57 53 53 50 4c 2c 20 63   IMOM, o=WSSPL, c
  0020:  3d 49 4e 44 49 41 04 00                            =INDIA..
conn=0 op=1 RESULT tag=101 err=32 text=
daemon: activity on 1 descriptors
daemon: activity on: 9r
daemon: read activity on 9
connection_get(9)
connection_get(9): got connid=0
connection_read(9): checking for input on id=0
=====================================

Thanks & Regards