Announcement Announcement Module
Collapse
No announcement yet.
Problems with building and deploy the spring-ldap-person Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems with building and deploy the spring-ldap-person

    Hi i'm a newbie trying to learn spring ldap. When i tried building the spring-ldap-person sample in spring-ldap-buildable-1.2-RC1, i faced some problems.

    Firstly the build kept complaining about unresolved dependencies for mina-filter-ssl, easymock, slf4j-log4j12 and etc.

    After much hair pulling, i finally managed to solve it by adding in "http://mirrors.ibiblio.org/pub/mirrors/maven2/" and "http://repo1.maven.org/maven2/" repositories in common-build's ivyconf.xml.

    I'm not sure whether it the correct way to solve it but its seems to work for now.
    ================================================== =======
    <ibiblio name="mirrors-ibiblio-maven2" checkconsistency="false" m2compatible="true" root="http://mirrors.ibiblio.org/pub/mirrors/maven2/"/>
    <!-- try popular maven2 ibiblio mirror second -->
    <ibiblio name="dotsrc-maven2-repo" checkconsistency="false" m2compatible="true" root="http://mirrors.dotsrc.org/maven2/"/>

    <!-- try ibiblio itself third -->
    <ibiblio name="ibiblio-maven2-repo" checkconsistency="false" m2compatible="true" root="http://www.ibiblio.org/maven2/"/>

    <ibiblio name="repo1-maven2" checkconsistency="false" m2compatible="true" root="http://repo1.maven.org/maven2/"/>
    ================================================== =======

    However after building the war file and deploying it tomcat, an error occurred.

    2007-07-11 15:05:05,937 ERROR [org.springframework.web.context.ContextLoader] - <Context initialization failed>
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'serverContext' defined in ServletContext resource [/WEB-INF/apacheDsContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [javax.naming.InitialContext]: Constructor threw exception; nested exception is javax.naming.NamingException [Root exception is java.io.InvalidClassException: org.apache.directory.server.core.partition.impl.bt ree.jdbm.AttributesSerializer; local class incompatible: stream classdesc serialVersionUID = 1, local class serialVersionUID = -3756830073760754086]
    Caused by:
    org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [javax.naming.InitialContext]: Constructor threw exception; nested exception is javax.naming.NamingException [Root exception is java.io.InvalidClassException: org.apache.directory.server.core.partition.impl.bt ree.jdbm.AttributesSerializer; local class incompatible: stream classdesc serialVersionUID = 1, local class serialVersionUID = -3756830073760754086]
    Caused by:
    javax.naming.NamingException [Root exception is java.io.InvalidClassException: org.apache.directory.server.core.partition.impl.bt ree.jdbm.AttributesSerializer; local class incompatible: stream classdesc serialVersionUID = 1, local class serialVersionUID = -3756830073760754086]
    at org.apache.directory.server.core.partition.impl.bt ree.jdbm.JdbmTable.<init>(JdbmTable.java:150)
    at org.apache.directory.server.core.partition.impl.bt ree.jdbm.JdbmTable.<init>(JdbmTable.java:168)
    at org.apache.directory.server.core.partition.impl.bt ree.jdbm.JdbmMasterTable.<init>(JdbmMasterTable.ja va:79)
    at org.apache.directory.server.core.partition.impl.bt ree.jdbm.JdbmPartition.init(JdbmPartition.java:185 )
    at org.apache.directory.server.core.partition.Default PartitionNexus.initializeSystemPartition(DefaultPa rtitionNexus.java:363)
    at org.apache.directory.server.core.partition.Default PartitionNexus.init(DefaultPartitionNexus.java:200 )
    at org.apache.directory.server.core.DefaultDirectoryS ervice.initialize(DefaultDirectoryService.java:819 )
    at org.apache.directory.server.core.DefaultDirectoryS ervice.startup(DefaultDirectoryService.java:229)
    at org.apache.directory.server.core.jndi.AbstractCont extFactory.getInitialContext(AbstractContextFactor y.java:117)
    at javax.naming.spi.NamingManager.getInitialContext(U nknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unkn own Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    .................................................. ...................
    .................................................. ...................
    Caused by: java.io.InvalidClassException: org.apache.directory.server.core.partition.impl.bt ree.jdbm.AttributesSerializer; local class incompatible: stream classdesc serialVersionUID = 1, local class serialVersionUID = -3756830073760754086
    at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
    at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
    at java.io.ObjectInputStream.readClassDesc(Unknown Source)
    .................................................. ...................
    .................................................. ...................
    ... 55 more


    Can anyone advise me on how to solve the above problem?
    Btw is there a particular version of java jdk, apache tomcat or apache DS i had to use to get this sample to work?
    Last edited by jackohy; Jul 11th, 2007, 02:46 AM.

  • #2
    This looks like old stuff may be lying around. Have you deployed an earlier version of the sample to Tomcat before? Try to clean the Tomcat directories temp and work, as well as the sample directory itself in webapps.

    Anything above JDK 1.4.1 should work. Which versions of the JDK and Tomcat are you using?

    Comment


    • #3
      Thanks for your help.
      Like what you say its due to the earlier version sample i deployed.

      Comment


      • #4
        Hi,

        I was trying out the ldap person sample application and an error occurs when i try to update the company or country fields in the edit person details screen.
        ================================================== ===========================================
        org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is org.springframework.webflow.engine.ActionExecution Exception:
        Exception thrown executing [AnnotatedAction@1e61026 targetAction = org.springframework.webflow.action.LocalBeanInvoki ngAction@d507d3, attributes = map[[empty]]] in state 'editDetails' of flow 'detail-flow' -- action execution attributes were 'map[[empty]]';
        nested exception is org.springframework.binding.method.MethodInvocatio nException: Unable to invoke method [MethodSignature@46fef3 methodName = 'update', parameters = [[Parameter@ae8af4 type = [null], name = flowScope.person]]] with arguments array<Object>[[Person@11d329d]];
        nested exception is org.springframework.ldap.NameNotFoundException: [LDAP: error code 32 - failed to modify DN of entry cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se: Attempt to move to non-existant parent: 2.5.4.11=company1,2.5.4.6=sweden1,0.9.2342.1920030 0.100.1.25=jayway,0.9.2342.19200300.100.1.25=se];
        nested exception is javax.naming.NameNotFoundException: [LDAP: error code 32 - failed to modify DN of entry cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se: Attempt to move to non-existant parent: 2.5.4.11=company1,2.5.4.6=sweden1,0.9.2342.1920030 0.100.1.25=jayway,0.9.2342.19200300.100.1.25=se]; remaining name 'cn=Some Person2, ou=company1, c=Sweden'

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

        Can anyone help me with this? Its seems like the create function on the personDaoImpl also have similar errors when i try to implement them.

        Comment


        • #5
          Well, this is a bug - the thing is that the country and company fields are part of the Distinguished Name of a person, so changing of these fields will need to be handled specifically (which we currently don't).

          Comment


          • #6
            As a matter of fact, since 1.2-RC1, the company and the country can be changed as long as they are changed to a value that already exists. For example, changing "Some Person2, company1, Sweden" to "Some Person2, company2, Sweden" works. Also, "Some Person2, company1, Sweden" to "Some Person2, company1, Norway" works as well. However, changing "Some Person, company1, Norway" to "Some Person, company2, Norway" will not work, since there is no company2 in Norway.

            failed to modify DN of entry cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se: Attempt to move to non-existant parent: 2.5.4.11=company1,2.5.4.6=sweden1,0.9.2342.1920030 0.100.1.25=jayway,0.9.2342.19200300.100.1.25=se
            In your example, it seems you tried to change the company from "Sweden" to "sweden1", which will not work, since there is no such country in the database.

            One way to limit the number of such errors would be to have drop-down lists with only the available countries/companies. Since the available choices of the companies would depend on the choice of country, and the filling of the lists would require some data access logic, this is a perfect example of where the nice little framework ChainedOptions could be used.

            Comment

            Working...
            X