Announcement Announcement Module
Collapse
No announcement yet.
Why is objectClass attribute different from others? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why is objectClass attribute different from others?

    Hello,

    I was trying to create new entry on my LDAP, the process always running into

    objectclass: value #0 invalid per syntax

    Here is the error stack:


    org.springframework.ldap.InvalidAttributeValueExce ption: [LDAP: error code 21 - objectClass: value #0 invalid per syntax]
    at org.springframework.ldap.support.LdapUtils.convert LdapException(LdapUtils.java:122)
    at org.springframework.ldap.core.LdapTemplate.execute WithContext(LdapTemplate.java:786)
    at org.springframework.ldap.core.LdapTemplate.execute ReadWrite(LdapTemplate.java:779)
    at org.springframework.ldap.core.LdapTemplate.bind(Ld apTemplate.java:982)
    at edu.ggu.ldap.web.SearchLdapAction.execute(SearchLd apAction.java:153)
    at org.springframework.web.struts.DelegatingActionPro xy.execute(DelegatingActionProxy.java:105)
    at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:421)
    at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:226)
    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1164)
    ------------------------------------------------------------------------



    I drop one level down, I can go and modify/remove/replace attribute, it works well with any other attribute but not for 'objectclass'. I got an error

    -------------------------------------------------------------------------
    INFO: Server startup in 19313 ms
    2008-03-17 15:17:52,531 WARN - StrutsExceptionHandler.execute(41) | Uncaught Exception
    org.springframework.ldap.SchemaViolationException: [LDAP: error code 65 - no structural object class provided]
    at org.springframework.ldap.support.LdapUtils.convert LdapException(LdapUtils.java:178)
    at org.springframework.ldap.core.LdapTemplate.execute WithContext(LdapTemplate.java:786)
    at org.springframework.ldap.core.LdapTemplate.execute ReadWrite(LdapTemplate.java:779)
    at org.springframework.ldap.core.LdapTemplate.modifyA ttributes(LdapTemplate.java:951)
    at edu.ggu.ldap.web.SearchLdapAction.execute(SearchLd apAction.java:162)
    at org.springframework.web.struts.DelegatingActionPro xy.execute(DelegatingActionProxy.java:105)
    at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:421)
    at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:226)
    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1164)
    I am wonder why is objectClass different from other fields. So if I am going to create new cn entry with all the required objectclass (like in my oldap, there 3 objectclass required), how do I do it without having those exception??

    Please help!

  • #2
    We need more information. Post your configuration and the code where you perform the LDAP operations. Also please tell us what directory server you use.

    Comment


    • #3
      Thanks! ulsa

      I use openldap v3.


      And after successfully connect to the oldap server (I am able to do search)

      I tried to add new entry by doing

      ldapTemplate.bind(dn, null, buildAttributes(newEntry)
      I read more about the schema definition of 'objectclass' and found that my 3 objectclass:

      inetOrgPerson, posixAccount, top

      have dependency on other required fields.

      So I add all the required fields into the newEntry, I got a different error shows


      2008-03-17 16:26:08,515 WARN - StrutsExceptionHandler.execute(41) | Uncaught Exception
      org.springframework.ldap.NameAlreadyBoundException : [LDAP: error code 68 - Entry Already Exists]
      at org.springframework.ldap.support.LdapUtils.convert LdapException(LdapUtils.java:152)
      at org.springframework.ldap.core.LdapTemplate.execute WithContext(LdapTemplate.java:786)
      at org.springframework.ldap.core.LdapTemplate.execute ReadWrite(LdapTemplate.java:779)
      at org.springframework.ldap.core.LdapTemplate.bind(Ld apTemplate.java:982)
      at edu.ggu.ldap.web.SearchLdapAction.execute(SearchLd apAction.java:155)
      at org.springframework.web.struts.DelegatingActionPro xy.execute(DelegatingActionProxy.java:105)
      at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:421)
      at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:226)
      at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1164)
      at org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:397)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:689)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
      at edu.ggu.cms.webapp.PreviewFilter.doFilter(PreviewF ilter.java:137)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
      at org.acegisecurity.util.FilterChainProxy$VirtualFil terChain.doFilter(FilterChainProxy.java:264)
      at org.acegisecurity.intercept.web.FilterSecurityInte rceptor.invoke(FilterSecurityInterceptor.java:107)
      at org.acegisecurity.intercept.web.FilterSecurityInte rceptor.doFilter(FilterSecurityInterceptor.java:72 )
      at org.acegisecurity.util.FilterChainProxy$VirtualFil terChain.doFilter(FilterChainProxy.java:274)
      at org.acegisecurity.ui.ExceptionTranslationFilter.do Filter(ExceptionTranslationFilter.java:110)
      at org.acegisecurity.util.FilterChainProxy$VirtualFil terChain.doFilter(FilterChainProxy.java:274)
      at org.acegisecurity.wrapper.SecurityContextHolderAwa reRequestFilter.doFilter(SecurityContextHolderAwar eRequestFilter.java:81)
      at org.acegisecurity.util.FilterChainProxy$VirtualFil terChain.doFilter(FilterChainProxy.java:274)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFi lter(AbstractProcessingFilter.java:217)
      at org.acegisecurity.util.FilterChainProxy$VirtualFil terChain.doFilter(FilterChainProxy.java:274)
      at org.acegisecurity.context.HttpSessionContextIntegr ationFilter.doFilter(HttpSessionContextIntegration Filter.java:229)
      at org.acegisecurity.util.FilterChainProxy$VirtualFil terChain.doFilter(FilterChainProxy.java:274)
      at org.acegisecurity.util.FilterChainProxy.doFilter(F ilterChainProxy.java:148)
      at org.acegisecurity.util.FilterToBeanProxy.doFilter( FilterToBeanProxy.java:98)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
      at edu.ggu.search.web.LoginGoogleFilter.doFilter(Logi nGoogleFilter.java:56)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
      at edu.ggu.web.DisableUrlSessionFilter.doFilter(Disab leUrlSessionFilter.java:46)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
      at org.springframework.orm.hibernate.support.OpenSess ionInViewFilter.doFilterInternal(OpenSessionInView Filter.java:172)
      at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Unknown Source)
      Caused by: javax.naming.NameAlreadyBoundException: [LDAP: error code 68 - Entry Already Exists]; remaining name 'ou=People, dc=ggu, dc=edu'
      at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
      at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknow n Source)
      at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknow n Source)
      at com.sun.jndi.ldap.LdapCtx.c_bind(Unknown Source)
      at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_bin d(Unknown Source)
      at com.sun.jndi.toolkit.ctx.PartialCompositeDirContex t.bind(Unknown Source)
      at javax.naming.directory.InitialDirContext.bind(Unkn own Source)
      at org.springframework.ldap.core.LdapTemplate$21.exec uteWithContext(LdapTemplate.java:985)
      at org.springframework.ldap.core.LdapTemplate.execute WithContext(LdapTemplate.java:784)
      Even though the entry is never there

      any idea?

      Thanks a lot!

      Comment


      • #4
        Hi, all,

        Thanks all for look into this.

        I got the issue resolved. I think add entry in oldap is different from what my thinking is. It require you put the new cn name in dn even though it has not exist yet. Which I have my entry inserted correctly.

        Thanks!

        Comment

        Working...
        X