среда, 1 сентября 2010 г.

Authentication problems in multithreading

In my application, I have a tree widget that using ajax for loading nodes. Tomcat create some threads to service requests. Each requests validate security ticket that stores in http session:

  1. authenticationService.validate(ticket, null);  

And some threads can not validate this ticket and service throws AuthenticationException. If you have particular problem, then you should look at alfresco's jira: ALF-3789. This bug was fixed in revision 21065 at trunk. To fix it in my code, I simple override bean:

  1. <!--Override alfresco-->  
  2.     <bean name="ticketsCache" class="org.alfresco.repo.cache.EhCacheAdapter">  
  3.        <property name="cache">  
  4.           <bean class="org.springframework.cache.ehcache.EhCacheFactoryBean" >  
  5.              <property name="cacheManager">  
  6.                 <ref bean="internalEHCacheManager" />  
  7.              </property>  
  8.              <property name="cacheName">  
  9.                 <value>org.alfresco.cache.ticketsCache</value>  
  10.              </property>  
  11.           </bean>  
  12.        </property>  
  13.     </bean>  

After this all works fine :)

Комментариев нет:

Most popular

Authors