Announcement Announcement Module
Collapse
No announcement yet.
ldapTemplate.lookup causes problem with accessing to baseDN Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ldapTemplate.lookup causes problem with accessing to baseDN

    Hi,
    when i accessing baseDN ( to modify ), I have problem in lookup method. This is the code:

    result = (SynapseVH)ldapTemplate.lookup(buildSynapseVHDn(), new SynapseVHCM());

    It's throw this exception:
    2007-02-19 05:40:42,027 ERROR [net.itsynapse2.security.data.LDAPSecurityManager2] - <afterPropertiesSet[]Operation failed; nested exception is javax.naming.NamingException: problem generating object using object factory [Root exception is org.springframework.ldap.BadLdapGrammarException: Failed to parse DN; nested exception is org.springframework.ldap.support.TokenMgrError: Lexical error at line 1, column 2. Encountered: <EOF> after : ""]; remaining name '/'>

    I found at this forum, it's problem. Is it bug or property of spring-ldap?
    http://forum.springframework.org/sho...ammarException

  • #2
    Well, it might be a bug, but then again it might be a syntactically invalid DN (I do live under the assumtion that we manage to parse syntactically correct Distinguished Names until proven otherwise ).

    Either way: it is not the same problem as the referenced thread, even though it results in the same exception. Is there anything particular with the Distinguished Name?

    Also, as always, a full stack trace (including line numbers etc.) may provide us with more insight of what went wrong.

    Comment


    • #3
      There's complete stack trace. When I not use lookup, but I find it with search method, it's right. There's problem with accessing root element. Root element have in spring-ldap empty path. When I would like access this element, I may use this code:
      result = (SynapseVH)ldapTemplate.lookup(DistinguishedName.E MPTY_PATH, new SynapseVHCM());

      Pet


      2007-02-20 06:05:04,058 ERROR [net.itsynapse2.security.data.LDAPSecurityManager2] - <afterPropertiesSet[]
      ---------------------------------------------------
      Operation failed; nested exception is javax.naming.NamingException: problem generating object using object factory [Root exception is org.springframework.ldap.BadLdapGrammarException: Failed to parse DN; nested exception is org.springframework.ldap.support.TokenMgrError: Lexical error at line 1, column 2. Encountered: <EOF> after : ""]; remaining name '/'
      ---------------------------------------------------
      org.springframework.ldap.DefaultNamingExceptionTra nslator.translate(DefaultNamingExceptionTranslator .java:93)
      org.springframework.ldap.LdapTemplate.executeWithC ontext(LdapTemplate.java:764)
      org.springframework.ldap.LdapTemplate.executeReadO nly(LdapTemplate.java:749)
      org.springframework.ldap.LdapTemplate.lookup(LdapT emplate.java:829)
      net.itsynapse2.security.data.LDAPSecurityManager2. getSynapseVH(LDAPSecurityManager2.java:124)
      net.itsynapse2.security.data.LDAPSecurityManager2. afterPropertiesSet(LDAPSecurityManager2.java:83)
      org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1057)
      org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1024)
      org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:421)
      org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 45)
      org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:140)
      org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:242)
      org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:156)
      org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:273)
      org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:346)
      org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:156)
      org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:246)
      org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:184)
      org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 49)
      org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3729)
      org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4187)
      org.apache.catalina.core.StandardContext.reload(St andardContext.java:2990)
      org.apache.catalina.manager.ManagerServlet.reload( ManagerServlet.java:906)
      org.apache.catalina.manager.ManagerServlet.doGet(M anagerServlet.java:353)
      javax.servlet.http.HttpServlet.service(HttpServlet .java:689)
      javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
      org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252)
      org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
      org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:213)
      org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:178)
      org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:524)
      org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:126)
      org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
      org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:107)
      org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
      org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869)
      org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664)
      org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
      org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80)
      org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
      java.lang.Thread.run(Thread.java:595)

      ---------------------------------------------------

      Comment


      • #4
        You are saying that you find your entry using search, but not using lookup. Correct?

        What is your base?

        What is the full distinguished name of the entry you're trying to look up?

        I think it would be helpful to see relevant portions of your configuration file.

        Comment


        • #5
          > You are saying that you find your entry using search, but not using lookup. Correct?
          correct.

          > What is your base?

          full distinguished name is:
          dn = my rootdn in spring-spring: name=www.itbridge.net,name=synapse,itbVirtualHostN ame=vh15_01,name=virtualhosts,dc=wh1,dc=itbridge,d c=net

          I would like to get this object by lookup for modify.

          I think it would be helpful to see relevant portions of your configuration file.
          Code:
              <bean id="contextSource" class="org.springframework.ldap.support.LdapContextSource">
                  <property name="url" value="ldap://localhost:389" />
                  <property name="base" value="name=www.itbridge.net,name=synapse,itbVirtualHostName=vh15_01,name=virtualhosts,dc=wh1,dc=itbridge,dc=net" />
                  <property name="userName" value="adminDn" />
                  <property name="password" value="password" />
              </bean>
          __________________
          Ulrik Sandberg
          Jayway AB (www.jayway.se)
          Spring-LDAP project member

          Comment

          Working...
          X