Announcement Announcement Module
Collapse
No announcement yet.
No value for key [org.springframework.ldap.core.support.LdapContextS ource@d591cc] Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No value for key [org.springframework.ldap.core.support.LdapContextS ource@d591cc]

    I am getting java.lang.IllegalStateException , when there i try to rollback the transaction in ldap, we are doing two creates in transactions,
    and i am using PROPAGATION_REQUIRED for my service layer calls, also looks like it is closing the context after the first service level call

    i am attaching the code.

    ---------------------------------------------
    Exception String: No value for key [org.springframework.ldap.core.support.LdapContextS ource@d591cc] bound to thread [http-0.0.0.0-8080-1]
    Stack Trace:
    org.springframework.transaction.support.Transactio nSynchronizationManager.unbindResource(Transaction SynchronizationManager.java:184)
    org.springframework.transaction.compensating.suppo rt.AbstractCompensatingTransactionManagerDelegate. doCleanupAfterCompletion(AbstractCompensatingTrans actionManagerDelegate.java:119)
    org.springframework.ldap.transaction.compensating. manager.ContextSourceTransactionManager.doCleanupA fterCompletion(ContextSourceTransactionManager.jav a:133)
    org.springframework.transaction.support.AbstractPl atformTransactionManager.cleanupAfterCompletion(Ab stractPlatformTransactionManager.java:919)
    org.springframework.transaction.support.AbstractPl atformTransactionManager.processRollback(AbstractP latformTransactionManager.java:785)
    org.springframework.transaction.support.AbstractPl atformTransactionManager.rollback(AbstractPlatform TransactionManager.java:730)
    org.springframework.transaction.interceptor.Transa ctionAspectSupport.completeTransactionAfterThrowin g(TransactionAspectSupport.java:332)
    org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:111)
    org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :161)
    org.springframework.aop.framework.Cglib2AopProxy$D ynamicAdvisedInterceptor.intercept(Cglib2AopProxy. java:630)
    com.good.bl.cmty.CompanyBL$$EnhancerByCGLIB$$83052 dc2.create(<generated>)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:585)
    com.good.dbaccess.common.Delegate.invoke(Delegate. java:196)
    com.good.dbaccess.common.Delegate.invoke(Delegate. java:57)
    com.good.cmty.actions.UserRegistrationSubmitAction .myExecute(UserRegistrationSubmitAction.java:110)
    com.good.util.BaseAction.execute(BaseAction.java:9 0)
    org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:425)
    com.good.common.controller.GoodRequestProcessor.pr ocessActionPerform(GoodRequestProcessor.java:194)
    org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:228)
    com.good.common.controller.GoodRequestProcessor.pr ocess(GoodRequestProcessor.java:143)
    org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1913)
    org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:462)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:810)
    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252)
    org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    com.good.filters.AuthorizationFilter.doFilter(Auth orizationFilter.java:128)
    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
    org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    com.good.filters.UserCompanyFilter.doFilter(UserCo mpanyFilter.java:98)
    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
    org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    com.good.filters.ValidatorFilter.doFilter(Validato rFilter.java:77)
    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
    org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:96)
    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202)
    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.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:175)
    org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:74)
    org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:126)
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
    org.apache.catalina.valves.FastCommonAccessLogValv e.invoke(FastCommonAccessLogValve.java:495)
    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.MasterSlaveWorkerThread .run(MasterSlaveWorkerThread.java:112)
    java.lang.Thread.run(Thread.java:595)
    ----------------------------

    <bean id="contextSourceTarget" class="org.springframework.ldap.core.support.LdapC ontextSource">
    <property name="url" value="ldap:/XXXX:389" />
    <property name="base" value="XXX" />
    <property name="userDn" value="cn=USERNAME" />
    <property name="password" value="secret" />
    </bean>


    <bean id="contextSource" class="org.springframework.ldap.transaction.compen sating.manager.TransactionAwareContextSourceProxy" >
    <constructor-arg ref="contextSourceTarget" />
    </bean>

    <bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate" >
    <constructor-arg ref="contextSource" />
    </bean>



    <bean id="LdapManager" class="com.test.common.LdapManagerImpl">
    <property name="ldapTemplate" ref="ldapTemplate" />
    </bean>

    <bean id="UserManagerTarget" class="com.test.manager.cmty.UserManager">
    <property name="ldap" ref="LdapMmnager" />
    </bean>

    <bean id="ComapnyManagerTarget" class="com.test.manager.CompanyManager">
    <property name="userManager" ref="myUserManagerObject" />
    </bean>

    <bean id="transactionManager" class="org.springframework.ldap.transaction.compen sating.manager.ContextSourceTransactionManager">
    <property name="contextSource" ref="contextSource" />
    </bean>


    <bean id="myUserManagerObject" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
    <property name="transactionManager" ref="transactionManager" />
    <property name="target" ref="UserManagerTarget" />
    <property name="transactionAttributes">
    <props>
    <prop key="*">PROPAGATION_REQUIRED,-com.test.common.exception.LdapRollBackException</prop>
    </props>
    </property>
    </bean>

    <bean id="myCompanyManagerObject" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
    <property name="transactionManager" ref="transactionManager" />
    <property name="target" ref="ComapnyManagerTarget" />
    <property name="transactionAttributes">
    <props>
    <prop key="*">PROPAGATION_REQUIRED,-com.test.common.exception.LdapRollBackException</prop>
    </props>
    </property>
    </bean>


    Code Sniplet
    // CompanyManager
    public void create(String firstName, String lastName, String emailAddress, )
    throws Exception
    {
    // do some things
    UserManager.create(firstName, lastName,emailAddress);
    // do some things
    UserManager.create(firstName, lastName,"1"+emailAddress) ;
    // do some more things, if error , throw LdapRollBackException

    }

    // UserManager
    create(String firstName, String lastName, String emailAddress )throws Exception
    throws Exception
    {
    // do some things
    LdapManager.create(firstName, lastName,emailAddress);
    // do some things if error occur throw LdapRollBackException
    }

    // LdapManager
    create(String firstName, String lastName, String emailAddress )throws Exception{
    // create the DN..
    ldapTemplate.bind(dn,ctx,null);
    }

  • #2
    This might actually be a bug. Please post a jira issue here.

    Comment


    • #3
      Was this actually reported/confirmed? I am having the same problem using WebFlow/Weblogic 10.3/Spring 2.5.5/Spring LDAP1.2.1/JBoss EL 1.2 GA... Any information you can share would be most appreciated.

      Thanks.

      Keith

      Comment

      Working...
      X