Com.sun.jndi.ldap

Hi,
Is anyone familiar with JNDI LDAP automatic discovery codes
env.put(Context.PROVIDER_URL,
    ldap:///o=JNDITutorial,dc=example,dc=com);
It seems that by using DNS that associate with multiple domain controllers, it would lock out user account if they enter wrong pw because LDAP provider will send the request to each of the associated DC at the same time.  I wonder if anyone run through this issue and if it is a JDK bug and if someone does, how to you work around it?
Thanks,
Jennifer

Hi,
did you also try the following timeout variables?
env.put("com.sun.jndi.dns.timeout.initial", "2000");
env.put("com.sun.jndi.dns.timeout.retries", "3");...
Besides you specific problem you will find a probably interesting article about handling network timeouts her:
http://www.javacoffeebreak.com/articles/network_timeouts/
Regards
Klaus

Similar Messages

  • NullPointerException at com.sun.jndi.ldap.Connection.run(Connection.java:52

    We are using the Sun jndi 1.2.1 files from a Java client to
    access the IBM SecureWay Directory 3.2 server. Our test case is
    retrieving entries using the ctx.getAttributes (String, String[])
    method. Occasionally we are receiving the following error.
    java.lang.NullPointerException
    at com.sun.jndi.ldap.Connection.run(Connection.java:525)
    at java.lang.Thread.run(Thread.java:481)
    The java.lang.NullPointerException is coming from the Sun JNDI file.
    Our program is not catching this exception.
    Has anyone seen this problem before and have any ideas on how this can be resolved?

    Download and use LDAP 1.2.3 or JDK 1.3.1.
    The problem should go away.

  • Message: Cannot begin session. com/sun/jndi/ldap/ctl/PagedResultsControl

    When I try to request a simple reuest (getversion) from the drm wsdl I receive an error in the XML repsonse (see below).
    I read somewhere in the forum that I have to change the external direcortory provider in HSS from "MSAD" to LDAP/OID. But this can not be configured in HSS since I can not change the ID attribute (its greyed out).
    Does anyone knows how I can sole it: I think its related to: "message: Cannot begin session. com/sun/jndi/ldap/ctl/PagedResultsControl"
    Perhaps wrong or missing jar files in the connection configuration?
    Any help is welcome.
    Detlev
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <env:Fault>
    <faultcode>env:Server</faultcode>
    <faultstring>Cannot getVersion.
    [Tue Feb 14 16:03:06 CET 2012] - Oracle EPM Foundation Agent
    Error in request: begin session (message: Cannot begin session. com/sun/jndi/ldap/ctl/PagedResultsControl)</faultstring>
    <detail>
    <DrmServiceException xmlns="http://drm.webservices.epm.oracle">
    <Message xmlns:ns2="http://drm.webservices.epm.oracle" xmlns="">Cannot getVersion.
    [Tue Feb 14 16:03:06 CET 2012] - Oracle EPM Foundation Agent
    Error in request: begin session (message: Cannot begin session. com/sun/jndi/ldap/ctl/PagedResultsControl)</Message>
    <Code xmlns:ns2="http://drm.webservices.epm.oracle" xmlns="">0</Code>
    </DrmServiceException>
    </detail>
    </env:Fault>
    </env:Body>
    </env:Envelope>

    Thanks for the repsonse.
    Its exactly how you explain it.
    Last thing I am dealing with (as var as I can see now) is getting a (generic/other) ldap connection in HSS to our MSAD.
    HSS userinterface comes up with an error just before showing the user list. (on the serverside I traced traffic (wireshark) and see that userinformation is indeed retrieved).
    But the frontend is juist not showing/ loading the information.
    the error"a communication error occured when loading the view pane" Than the screen keeps on loading for ever
    Oracle support tries to find out whats going wrong here.
    Detlev

  • Need javadoc for com.sun.jndi.ldap.ctl.*?

    Hi,
    has anybody the javadoc for the above named package?
    I need at first com.sun.jndi.ldap.ctl.SortKey.
    It is needed to get a sorted search result from a LDAP server.
    Thank you for your help.
    Fredi

    Download the LDAP provider at
    http://java.sun.com/products/jndi/#download
    See the README-LDAP.txt in the bundle.
    It says that the javadocs for the controls are
    at doc/ldapcontrols.

  • Com.sun.jndi.ldap.ctl.PagedResultsControl

    Hi,
    I was wondering if iPlanet Server Directory 5.0 SP1 supports the Page Result
    Control?
    I am developing a Java Client that will read more than 2 000 entries from
    iPlanet.
    I have an OperationNotSupportedException with iPlanet 5.0.
    Thanks in advance.
    Stephane Chauvin.

    Hello Stephane,
    No, it is not. You can list the supported controls by executing an ldapsearch on the root DSE.<br>
    <i>ldapsearch -h <serverhost> -p <serverport> -s base -b "" \<br>"objectclass=*" supportedcontrol</i><br>
    Instead of the Page Result Control, you may want to consider using the Virtual List View control (see http://search.ietf.org/internet-drafts/draft-ietf-ldapext-ldapv3-vlv-04.txt)
    Regards,
    Bertold

  • No such method found for com.sun.jndi.toolkit.url.UrlUtil: method

    Hello,
    I have a servlet which allow users to authenticate to IPlanet LDAP server. I have no problem to access it when it runs under a standalone Tomcate server but I have an internal error when it runs under Oracle8i server.
    The following error message was found in mod_serv.log file in \%OracleHome%\Apache\Jserv\logs folder:
    ajp12: Servlet Error: java.lang.NoSuchMethodError: com.sun.jndi.toolkit.url.UrlUtil: method decode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found: com.sun.jndi.toolkit.url.UrlUtil: method decode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found.
    What is the problem? Where should I put my jndi.jar? Thanks.
    Regards
    CY Seah

    Hello,
    I have a servlet which allow users to authenticate to IPlanet LDAP server. I have no problem to access it when it runs under a standalone Tomcate server but I have an internal error when it runs under Oracle8i server.
    The following error message was found in mod_serv.log file in \%OracleHome%\Apache\Jserv\logs folder:
    ajp12: Servlet Error: java.lang.NoSuchMethodError: com.sun.jndi.toolkit.url.UrlUtil: method decode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found: com.sun.jndi.toolkit.url.UrlUtil: method decode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found.
    What is the problem? Where should I put my jndi.jar? Thanks.
    Regards
    CY Seah

  • Is the Sun JNDI LDAP provider thread safe?

    Hi,
    The JNDI documentation states that the Context implementation is not required to be thread safe although some providers provide thread safety. My question is whether the Sun JNDI LDAP provider is thread safe or do we have to synchronize on the Context instance?
    Thanks

    Read this: http://java.sun.com/j2se/1.3/docs/api/javax/naming/Context.html
    The answer, I think is no you need to synchronize accesses yourself. If you're using it from a servlet container, this should be OK, since each request is on a separate thread.

  • Looking for com.sun.jndi.toolkit.url.Uri.class

    Does anybody have any idea where I can find com.sun.jndi.toolkit.url.Uri.class?

    Ah well...I found it. Not seperate from the provider classes but I did finally find it. It is in the providerutil.zip that is included with the LDAP Service Provider download. The download is available at: http://java.sun.com/products/jndi/#download

  • Com.sun.jndi.cosnaming.CNCtxFactory in java stored, makes ORA-03113

    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    In java store procedure we have to contact an iiop enabled application
    If I specify
    env.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
    In the java stored procedure
    the SQL call will end with the error :
    ORA-03113: end-of-file on communication channel
    with a huge core dump in cdump
    any idea?
    The class exists in the loaded JVM
    it is valid and resolved
    Nothing can explain that.
    Thanks in advance
    Message was edited by:
    Réda BOULOS

    Yes, CORBA as well as the entire J2EE stack has been desupported in 9i R2.
    I ran the sample using 10g database which is Java SE 4.0 compatible and therefore susceptible of acting as RMI/IIOP client. Here are the jars file i have loaded in my example
    loadjava -u scott/tiger@localhost:port:instance_name -r -v
    $J2EE_HOME/ejb/helloworld/dist/stub_helloworld.jar
    $J2EE_HOME/lib/ejb.jar
    $J2EE_HOME/ejb/helloworld/dist/helloworld-ejb.jar
    $J2EE_HOME/ejb/helloworld/dist/helloworld-client.jar
    [code/]
    In addition, you need to:
    - grant ejbclient to the schema in question
    - grant java.util.PropertyPermission, java.lang.RuntimePermission, java.util.logging.LoggingPermission, and java.util.PropertyPermission
    Frankly you need to read the section of my book to get everything right;
    for example i tweak a bit the JNDI lookup in the client code.
    Fwiw, SAP JCO callout using RMI is also covered in chapter 4 of my book.
    Kuassi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Random classcast exception - com.sun.jndi.cosnaming.CNCtxFactory

    Hi,
    I am trying to use a remote ejb (weblogic 8.1.5/ jdk 14) from a j2se 1.5 rmi-iiop client.
    If I use com.sun.jndi.cosnaming.CNCtxFactory to look up the remote home & then use the remote interface, I get the following error RANDOMly (i.e only some calls succeed).
    java.lang.ClassCastException
         at xxx.equals(xxxjava:129)
         at weblogic.corba.utils.IndirectionValueHashtable.get(IndirectionValueHashtable.java:119)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1471)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1624)
         at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
         at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
         at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
         at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
         at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1593)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1624)
         at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
         at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
         at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
         at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
         at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1593)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1624)
         at weblogic.iiop.RMIMsgOutput.writeObject(RMIMsgOutput.java:117)
         at xxx.yyy_ehqjge_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:492)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:435)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:430)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    I had a look at IndirectionValueHashtable class. It looks like the classcast is happening because the "handle-to-object" map has non String values.
    Could this be a corba compatabilty issue?
    The problem doesn't occur if I use weblogic initial context factory & t3 protocol.
    What is the best way to overcome this problem? I dont want to distribute weblogic.jar [from 8.1.5 server]. wlclient is okay.
    thanks

    Tony Zimmer <> writes:
    Certainly looks like a bug, in which case you need to go through
    support to get it fixed. Do however check that your objects are in
    fact serializable (including all their fields).
    andy
    Tried a few more combinations. No luck so far.
    classcast exception for some objects at some times
    server: WebLogic Server 10.0 / Sun 1.5.0_06/ WinNT 6
    client: Sun jdk 1.5.0_11/1.4.2_14
    java.lang.ClassCastException: java.lang.String
         at xxxpack.client.PaymentReceipt.equals(PaymentReceipt.java:881)
         at weblogic.corba.utils.IndirectionValueHashtable.get(IndirectionValueHashtable.java:119)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1836)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1992)
         at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2253)
         at weblogic.utils.io.ObjectStreamClass.writeFields(ObjectStreamClass.java:413)
         at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:235)
         at weblogic.corba.utils.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:182)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1957)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1992)
         at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2253)
         at weblogic.utils.io.ObjectStreamClass.writeFields(ObjectStreamClass.java:413)
         at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:235)
         at weblogic.corba.utils.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:182)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1957)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1992)
         at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2253)
         at xxxpack.server.ProcessPayment_ehqjge_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:479)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:475)
         at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:59)
         at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:1016)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
    server: WebLogic Server 8.1 SP6 / Sun 1.4.2_11 / WinNT 6
    client jdk 1.4.2_14/1.5.0_11:
    java.lang.ClassCastException
         at xxxpack.client.PurchaseAmount.equals(PurchaseAmount.java:148)
         at weblogic.corba.utils.IndirectionValueHashtable.get(IndirectionValueHashtable.java:119)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1471)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1624)
         at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
         at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
         at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
         at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
         at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1593)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1624)
         at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
         at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
         at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
         at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
         at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1593)
         at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1624)
         at weblogic.iiop.RMIMsgOutput.writeObject(RMIMsgOutput.java:117)
         at xxxpack.server.ProcessPayment_ehqjge_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:491)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:120)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:434)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:429)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    Do you have a list/ martix of client-server versions used for the bug fixes?
    Thanks

  • JNDI: Can't find Class com.sun.jndi.nis.NISCtxFactory

    Hi
    I searched this forum for similar problems .. and I also found some, but this questions were either not be answered or not detailed enough.
    Now to my question. I've got a Java File that I imported to Oracle (I use it from PL/SQL). This Java File contains following code.
    static Properties = System.getProperties();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.nis.NISCtxFactory");
    env.put(Context.PROVIDER_URL, "nis://disney/geo.unizh.ch");
    Context ctx = new InitialContext(env);
    And if I run it from oracle(PL/SQL) I get the error below.
    javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.nis.NISCtxFactory. Root exception is java.lang.ClassNotFoundException: com/sun/jndi/nis/NISCtxFactory
    at java.lang.Class.forName0(Class.java)
    at java.lang.Class.forName(Class.java)
    at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java)
    at javax.naming.InitialContext.init(InitialContext.java)
    at javax.naming.InitialContext.<init>(InitialContext.java)
    at GIUZContext.getCtx(GIUZContext:42)
    at CheckPwd.check(CheckPwd:18)
    The nis.jar I imported with the loadjava, so actuallay should it be in the database. But why it cant find this class (NISCtxFactory)!
    I get no error if I use this code ->
    NISCtxFactory test = new NISCtxFactory();
    System.out.println(test);
    It would be very nice if you could give me some clues. TNX!!
    Oracle Version 8.1.7.
    Cyrill

    Hi Cyrill,
    I don't know what other postings you have read, and I also don't
    know why they were insufficient for you, so excuse me if I repeat
    things you already know.
    As far as I know, the error message you are getting is most probably
    due to one of the following three causes:
    1. The class is not loaded into the database.
    2. The class is loaded but is not "valid".
    3. You don't have permission to access the class.
    To the best of my memory, there have been several posts to either
    this forum or the "Products > Database > JVM" forum
    http://forums.oracle.com/forums/forum.jsp?id=424322
    that (in my opinion) sufficiently explain how to resolve the problem
    for each of the three causes listed above.
    Personally, I believe that the Oracle documentation sufficiently
    explains how to resolve the above three issues, and I have posted
    the URLs for the relevant Oracle documentation several times already.
    I am guessing that you are trying to "talk" to an EJB (probably deployed
    in SUN's application server) from a java stored procedure in the Oracle
    database. If that is the case, then that question has been discussed
    many times in this forum. Perhaps you can say why those discussions
    were not sufficiently helpful for you.
    Hope this helps.
    Good Luck,
    Avi.

  • Problem with JNDI/LDAP AND connection pool

    I'm a newbie to Java but am attempting to write a servlet that retrieves info use to populate the contents of drop down menus. I'd like to only have to do this once. The servlet also retrieves other data (e.g. user profile info, etc ...). I'd like to be able to use the connection pool for all of these operations but I'm getting a compile error:
    public class WhitePages extends HttpServlet {
    ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
    public static String m_servletPath = null;
    public static String cattrs = null;
    public static String guidesearchlist[] = {};
    public static int isLocalAddr = 0;
    private int aeCtr;
    private String[] sgDNArray;
    private HashMap sgDN2DNLabel = new HashMap();
    private HashMap sgDN2SearchGuide = new HashMap();
    private String strport;
    private int ldapport;
    private String ldaphost;
    private String ldapbinddn;
    private String ldapbindpw;
    private String ldapbasedn;
    private int maxsearchcontainers;
    private int maxsearchkeys;
    private String guidesearchbases;
    private String guidecontainerclass;
    private String strlocaladdr;
    private String providerurl;
    // my init method establishes the connection
    // pool and then retrieve menu data
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    String strport = config.getInitParameter("ldapport");
    ldapport = Integer.parseInt(strport);
    String strconts = config.getInitParameter("maxsearchcontainers");
    maxsearchcontainers = Integer.parseInt(strconts);
    String strkeys = config.getInitParameter("maxsearchkeys");
    maxsearchkeys = Integer.parseInt(strkeys);
    ldaphost = config.getInitParameter("ldaphost");
    ldapbinddn = config.getInitParameter("ldapbinddn");
    ldapbindpw = config.getInitParameter("ldapbindpw");
    ldapbasedn = config.getInitParameter("ldapbasedn");
    guidesearchbases = config.getInitParameter("guidesearchbases");
    guidecontainerclass = config.getInitParameter("guidecontainerclass");
    strlocaladdr = config.getInitParameter("localaddrs");
    providerurl = "ldap://" + ldaphost + ":" + ldapport;
    /* Set up environment for creating initial context */
    Hashtable env = new Hashtable(11);
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, providerurl.toString());
    /* Enable connection pooling */
    env.put("com.sun.jndi.ldap.connect.pool", "true");
    StringTokenizer st = new StringTokenizer(guidesearchbases, ":" );
    String guidesearchlist[] = new String[st.countTokens()];
    for ( int i = 0; i < guidesearchlist.length; i++ ) {
    guidesearchlist[i] = st.nextToken();
    // Get a connection from the connection pool
    // and retrieve the searchguides
    StringBuffer asm = new StringBuffer(""); // This is the advanced search menu htmlobject buffer
    StringBuffer strtmpbuf = new StringBuffer(""); // This is the simple search menu htmlobject buffer
    try {
    StringBuffer filter = new StringBuffer("");
    filter.append("(objectclass=" + guidecontainerclass + ")");
    String[] attrList = {"dn","cn","searchguide"};
    SearchControls ctls = new SearchControls();
    ctls.setReturningAttributes(attrList);
    ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
    String attrlabelkey;
    sgDNArray = new String[guidesearchlist.length];
    for( int i = 0; i < guidesearchlist.length; i++ ) {
    // Search each of the namingspaces where
    // searchguides exist then build
    // the dynamic menus from the result
    DirContext ctx = new InitialDirContext(env);
    NamingEnumeration results = ctx.search(guidesearchlist, filter, ctls);
    I get a compile error:
    WhitePages.java:164: cannot resolve symbol
    symbol : method search (java.lang.String,java.lang.StringBuffer,javax.naming.directory.SearchControls)
    location: interface javax.naming.directory.DirContext
    NamingEnumeration results = ctx.search(guidesearchlist[i], filter, ctls);
    ^
    WhitePages.java:225: cannot resolve symbol
    symbol : variable ctx
    location: class OpenDirectory
    ctx.close();
    ^
    Can anyone help? If there is someone out there with JNDI connection pool experience I would appreciate your assistance!

    Manish
    The issue may not be related to the number of connections or the initial
    connections. Check your heap size (ms, mx). Turn on verbosegc. Your heap may
    not be big enough to accept the 25,000 rows.
    Bernie
    "Manish Kumar Singh" <[email protected]> wrote in message
    news:3e6c34ca$[email protected]..
    We are creating the result set with 25000 rows(each row has 56 columns) bygetting the connection using data source. With the initial capacity of the
    connection pool is 5 and the max capacity as 30 and grow connection as 1,
    the server gets out of memory exception, when we issue a new request, even
    after closing the previous connections.
    Now, if we change the initial capacity to 1 and rest all the things assame, the issue gets resolved and the server works fine.
    Could you please help me out in this regard????
    thanks in advance
    manish

  • JNDI LDAP Response Parsing Problems

    Help!
    I am having problems dealing with LDAP responses using JNDI 1.2.2 with the
    LDAP SPI.
    It seems that the detinguished name is unparsable but as far as I can see
    the server output is fine. Any clues how to get around this? Have I done
    something wrong or is the LDAP spi unusably buggy?
    Please could you also reply in mail as this is an urgent matter for the
    project I am working on. If the LDAP spi is unusable I will have to change
    direction completely...
    Thanks in advance,
    John
    The experimental code causing problems is this (except I have substituted
    hard coded values that were bombing into the code):
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, "ldap://directory.verisign.com");
    InitialLdapContext context_ldap = new InitialLdapContext(env, null);
    Attributes match = new BasicAttributes(true);
    match.put(new BasicAttribute("cn", "microsoft"));
    NamingEnumeration enum = context_ldap.search("", match);
    NameParser parser = context_ldap.getNameParser("");
    while (enum.hasMore())
    SearchResult result = (SearchResult)enum.next();
    System.out.println("Parsing " + (result.isRelative() ? "[relative]: " :
    "[non-relative]: ") + result.getName());
    Name name = parser.parse(result.getName());
    The output is this:
    Parsing [relative]: "ou=MS INTERNAL TESTING
    ONLY,cn=Microsoft,l=redmond,st=wa,c=US,ou=Digital ID Class 3 - Microsoft
    Software Validation v2,ou=\"www.verisign.com/repository/CPS Incorp. by
    Ref.,LIAB.LTD(c)96\",ou=VeriSign Commercial Software Publishers
    CA,o=\"VeriSign, Inc.\",l=Internet"
    javax.naming.InvalidNameException: Invalid name: "ou=MS INTERNAL TESTING
    ONLY,cn=Microsoft,l=redmond,st=wa,c=US,ou=Digital ID Class 3 - Microsoft
    Software Validation v2,ou=\"www.verisign.com/repository/CPS Incorp. by
    Ref.,LIAB.LTD(c)96\",ou=VeriSign Commercial Software Publishers
    CA,o=\"VeriSign, Inc.\",l=Internet"
    at com.sun.jndi.ldap.LdapName$DnParser.parseAttrType(LdapName.java:478)
    at com.sun.jndi.ldap.LdapName$DnParser.parseRdn(LdapName.java:432)
    at com.sun.jndi.ldap.LdapName$DnParser.getDn(LdapName.java:400)
    at com.sun.jndi.ldap.LdapName.parse(LdapName.java:303)
    at com.sun.jndi.ldap.LdapName.<init>(LdapName.java:76)
    at com.sun.jndi.ldap.LdapNameParser.parse(LdapNameParser.java:23)
    at
    com.softcomms.trackomatic.ext.ldap.gui.LDAPViewer$ResultsTableModel.parseRes
    ult(LDAPViewer.java:304)
    at
    com.softcomms.trackomatic.ext.ldap.gui.LDAPViewer$1.run(LDAPViewer.java:240)
    at com.softcomms.trackomatic.util.RunQueue.run(RunQueue.java:109)

    at least you need cn= in front of the name.
    Here some more questions you may ask yourself:
    How do you know, that the requested object is in the database?
    What is its DN?
    Can you retrieve it using the ldap command line utilities like ldapsearch?
    What does context.list("") return?

  • Java JNDI LDAP connectivity problem.  NoSuchAttributeException

    Hello,
    I am trying to add a user to Active Directory server through LDAP. Following is the code I am using:
    ======================================================================
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, "ldap://192.123.321.123:389");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, "user1");
    env.put(Context.SECURITY_CREDENTIALS, "user123");
    try {
    System.out.println("68");
    Context ctx = new InitialContext(env);
    System.out.println("71");
    BasicAttribute oc = new BasicAttribute("objectclass", "top");
    oc.add("person");
    oc.add("organizationalperson");
    oc.add("User");
    BasicAttribute ouSet = new BasicAttribute("ou");
    ouSet.add("test");
    BasicAttributes attrs = new BasicAttributes(true);
    attrs.put(oc);
    attrs.put(ouSet);
    attrs.put("cn", "ndubey001");
    attrs.put("sn", "ndubey001");
    attrs.put("sAMAccountName", "ndubey001");
    attrs.put("givenName", "ndubey001");
    attrs.put("name", "ndubey001");
    ctx.bind("uid=ndubey001,ou=test,o=myserver.com", attrs);
    System.out.println("74");
    ctx.close();
    } catch (NamingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    ======================================================================
    I have tried with so many different combinations. Most of the times the parameters I am passing looks okay but I keep getting the same exception as follows:
    ======================================================================
    68
    71
    javax.naming.directory.NoSuchAttributeException: [LDAP: error code 16 - 00000057: LdapErr: DSID-0C090B38, comment: Error in attribute conversion operation, data 0, vece
    at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
         at com.sun.jndi.ldap.LdapCtx.c_bind(Unknown Source)
         at com.sun.jndi.ldap.LdapCtx.c_bind(Unknown Source)
         at com.sun.jndi.toolkit.ctx.ComponentContext.p_bind(Unknown Source)
         at com.sun.jndi.toolkit.ctx.PartialCompositeContext.bind(Unknown Source)
         at com.sun.jndi.toolkit.ctx.PartialCompositeContext.bind(Unknown Source)
         at javax.naming.InitialContext.bind(Unknown Source)
         at LDAPTest.main(LDAPTest.java:99)Coming out
    ======================================================================
    Can anyone tell what is the exact problem ?
    Cheers,
    Nitin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Too many errors to even consider correcting your code (objectClasses, UID attribute, ctx.create)....
    Refer to the following for a description & sample code:
    JNDI, Active Directory (Creating new users & demystifying userAccountControl
    http://forum.java.sun.com/thread.jspa?threadID=582103&tstart=15

  • Help with SUN JNDI tutorial example

    HI guys there's an example of how to bound an object along with its codebase in the sun jndi tutorial
    import javax.naming.*;
    import javax.naming.directory.*;
    import java.util.Hashtable;
    * Demonstrates how to bind a Serializable object to a directory
    * with a codebase.
    * (Use Unbind to remove binding.)
    * usage: java SerObjWithCodebase <codebase URL>
    class SerObjWithCodebase {
    public static void main(String[] args) {
         if (args.length != 1) {
         System.err.println("usage: java SerObjWithCodebase <codebase URL>");
         System.exit(-1);
         String codebase = args[0];
         // Set up environment for creating initial context
         Hashtable env = new Hashtable(11);
         env.put(Context.INITIAL_CONTEXT_FACTORY,
         "com.sun.jndi.ldap.LdapCtxFactory");
         env.put(Context.PROVIDER_URL, "ldap://localhost:389/o=JNDITutorial");
         try {
         // Create the initial context
         DirContext ctx = new InitialDirContext(env);
         // Create object to be bound
         Flower f = new Flower("rose", "pink");
         // Perform bind and specify codebase
         ctx.bind("cn=Flower", f, new BasicAttributes("javaCodebase", codebase));
         // Check that it is bound
         Flower f2 = (Flower)ctx.lookup("cn=Flower");
         System.out.println(f2);
         // Close the context when we're done
         ctx.close();
         } catch (NamingException e) {
         System.out.println("Operation failed: " + e);
    So in therory you should be able to retrieve an object in through doing a look up, and then cast it... but in this approach the client that performs the look up shouldn't need to include the class definition of the object that is being retrieved, because it's being included in the code base of the context, but then how do you avoid compilation errors such:
    SerObjWithCodebase.java:73: cannot resolve symbol
    symbol : class Flower
    location: class SerObjWithCodebase
    Flower f2 = (Flower)ctx.lookup("cn=Flower");
    in the client code that is attepting to perform the look up?... is there a work-around for this problem? please let me know, thanks in advance.

    As far as I am aware, there is no possible way to compile or execute code without the client knowing it's definition.
    The client will always need the class definition if it want's to use it.
    If you don't want this coupling, then you could look at using an EJB container (which still requires the client to have skeleton code) or using something like web services

Maybe you are looking for

  • "Mission Control" does not show space row and I cannot add a new space (27 inch screen)

    Firstly, "Mission Control" does not show upper row with spaces. I have configured Dashboard as space, but it is not showed either. Second, I cannot add a new space because the upper right corner wont show an empty space. In system I have configured (

  • Making songs start from a later time than the beginning

    Okay, so on a few songs (Holy Diver by Dio, Indestructible by Disturbed) I have the options set to start the song when the ambience stops, because when I'm in my car I don't care to listen to more than 5 seconds of near silence before (or after) a so

  • Difference between creating service in SE80 and SICF

    Hello All, In SE80 we create a service specifying the Tcode,theme and publish the service.In SICF also we create a sub element,giving the tcode.I want to know what we do exactly in SE80 and SICF (in layman's language). Thanks, Rakesh.

  • Spry Known Issue

    Sorry if missed this post... I have a CSS layout with a repeating background for my faux columns. I have two Spry collapseable panels in the left column with alot of text. If you open up both panels at the same time, it is probably 2500px high. But,

  • ALV List processing

    Hi I have created a transaction which when executed displays a selection screen and on entering proper search criteria, result data is displayed in the form of ALV list.  (for example name this screen 'A' ). Here, On the application toolbar, there is