[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Messages posted by: tchoesan  XML
Profile for tchoesan -> Messages posted by tchoesan [7]
Author Message
The following class fails to serialize
org.springframework.security.core.session.SessionRegistryImpl.java: spring-security-core-3.1.0.RELEASE.jar

I went on and implemented the SessionRegistry interface and made it serializable. But than comes the next unserializable class and when i made that serializable the next class pops up

org.springframework.security.acls.domain.AclAuthorizationStrategyImpl
org.springframework.security.acls.domain.SidRetrievalStrategyImpl
org.springframework.security.access.hierarchicalroles.NullRoleHierarchy

i will give a look at the Examinator app. Thanks
I will try the examinator and find the difference between this and our appl Thank you very much
Thanks Ari! will let you know if we succeed in making our application fully serializable. Thank you for the insight
Is it possible to do clustering with Terracotta DSO with spring security?
We are using spring security to manage our sessions and the spring class SessionRegistryImpl.java throwsNotSerializableException (my previous post http://forums.terracotta.org/forums/posts/list/7015.page)
Due to which we have to use TERRACOTTA DSO to declare this class and its fields as not serializable.
I am getting two different information.
This forum http://forums.terracotta.org/forums/posts/list/66.page


The answer is yes, it should it work fine -- all of our testing with this use case has shown that. The key point is to use AspectJ at compile time if aspects have any state that should be clustered.

The issue with AspectJ weaving at load time (LTW) and DSO is that DSO instrumentation runs before (as AspectJ uses javaagent and DSO is in the bootjar), meaning that any load time woven-in code won't be instrumented by DSO and hence, won't be clustered.

On the other hand, it is still possible to move all the clusterable state outside of aspects in a Spring application (i.e. inject it using Spring's @Configurable) and then we can cluster that data as usual. However, this works only for Spring and requires the Terracotta for Spring product. There is a good reference at http://static.springframework.org/spring/docs/2.0.x/reference/aop.html#aop-aj-configure.
 

suggests that it will work together but this documentation http://docs.terracotta.org/confluence/display/docs/DSO+Technical+FAQ#DSOTechnicalFAQ-Q%3ACanImixTerracottaDSOwithAOPframeworks%3F tells otherwise.

Because of collisions that can occur due to both DSO and AOP instrumentation of classes, mixing the two is not an option. However, if instead of DSO the standard Terracotta installation is used, then no collisions can occur and the AOP framework can be used. 
Our application stack is hibernate/spring / spring security/JSF running inside tomcat 7.

We want to configure Terracotta DSO. we are using spring security SessionRegistryImpl.java to get session information on logged in users, but this class is not serializable and thus our session becomes unserializable.
Due to which i constantly get java.io.NotSerializableException for the above spring class.
Is it possible to do clustering with Terracotta in this case?

I have downloaded and installed the Open source Terracotta 3.6.2.

I Followed the following documentations
http://terracotta.org/documentation/web-sessions/installation-guide
http://terracotta.org/documentation/terracotta-dso/dso-install
Configured tc-config.xml following http://docs.terracotta.org/confluence/display/docs/Configuration+Guide+and+Reference


We have the following jars in our application

Code:
 <dependency>
    <groupId>net.sf.ehcache</groupId>
    <artifactId>ehcache-core</artifactId>
    <version>2.5.2</version>
 </dependency>
 <dependency>
      <groupId>org.terracotta</groupId>
      <artifactId>terracotta-toolkit-1.5-runtime</artifactId>
      <version>4.2.0</version>
 </dependency>
 <dependency>
 	<groupId>org.terracotta.session</groupId>
 	<artifactId>terracotta-session</artifactId>
 	<version>1.2.2</version>
 </dependency>
 



I performed tim-get.bat install on tomcat7, ehcache, spring-security
Code:
 <module name="tim-tomcat-7.0"/>
 <module name="tim-spring-security-2.0" />
 <module name="tim-ehcache-1.7" />
 


EHCACHE

Since we are using ehcache in our application, we thought we should configure it to make everything work together. Please find below our ehcache.xml
when ehcache-terracotta.jar is missing it throws the following error net.sf.ehcache.CacheException: Terracotta cache classes are not available, you are missing jar(s) most likely
I read that for DSO configuration, we should not have this jar in application path.

So at the moment the serialization does not work and ehcache complains.

Any hints on where I am making mistakes.


tc-config.xml

Code:
 
 <?xml version="1.0" encoding="UTF-8"?> 
 <tc:tc-config xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-5.xsd"
 xmlns:tc="http://www.terracotta.org/config"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
 	<servers>
 		<server host="localhost" name="localhost:9510" bind="0.0.0.0"> 
 			<dso-port bind="10.7.65.31">9510</dso-port> 
 			<jmx-port bind="10.7.65.31">9520</jmx-port>
 			<data>C:/Terracotta/terracotta/server-data</data>
 			<logs>C:/Terracotta/terracotta/server-logs</logs>
 			<index>C:/Terracotta/terracotta/server-index</index>
 			<statistics>C:/Terracotta/terracotta/server-statistics</statistics>
 			<dso>
 				<client-reconnect-window>120</client-reconnect-window>
 				<persistence>
 				  <mode>temporary-swap-only</mode>
 				  <offheap>
 					<enabled>false</enabled>
 					<maxDataSize>5g</maxDataSize>
 				  </offheap>
 				</persistence>
 			</dso>
 		</server>
 	</servers>
 	
 	<clients>
 		<logs>C:/Terracotta/terracotta/client-logs/</logs>
 		<modules>
 			<module name="tim-tomcat-7.0"/>
 			<module name="tim-spring-security-2.0" />
 			<module name="tim-ehcache-1.7" />			
 			<!--<module name="tim-quartz-2.0" />
 			<module group-id="org.terracotta.toolkit" name="terracotta-toolkit-1.5" />-->
 		</modules>
 		
 		<dso>
 			<debugging>
 				<instrumentation-logging>
 				  <class>true</class>
 				  <locks>false</locks>
 				  <transient-root>true</transient-root>
 				  <roots>true</roots>
 				  <distributed-methods>false</distributed-methods>
 				</instrumentation-logging>
 				
 				<runtime-logging>
 				  <non-portable-dump>true</non-portable-dump>
 				  <lock-debug>true</lock-debug>
 				  <wait-notify-debug>false</wait-notify-debug>
 				  <distributed-method-debug>false</distributed-method-debug>
 				  <new-object-debug>true</new-object-debug>
 				  <named-loader-debug>false</named-loader-debug>
 				</runtime-logging>
 				
 				<runtime-output-options>
 				  <auto-lock-details>true</auto-lock-details>
 				  <caller>true</caller>
 				  <full-stack>false</full-stack>
 				</runtime-output-options>
 				
 			</debugging>
 		</dso>
 	</clients>
 
 	<application>
 	  <dso>
 	  
 		<instrumented-classes>
 			<include>
 			   <class-expression>org.springframework.*</class-expression>
 				<honor-transient>true</honor-transient>
 			 </include>
 			 <include>
 			   <class-expression>org.springframework..*</class-expression>
 				<honor-transient>true</honor-transient>
 			 </include>
 			 <include>
 			   <class-expression>org.springframework...*</class-expression>
 				<honor-transient>true</honor-transient>
 			 </include>
 			 <include>
 			   <class-expression>org.springframework.security.core.session.*</class-expression>
 				<honor-transient>true</honor-transient>
 			 </include>
 		
 		</instrumented-classes>
 		
 		<locks>         
           <autolock auto-synchronized="true">
             <method-expression>* org.springframework.security.core.session.SessionRegistryImpl.re*(..)</method-expression>
 		  </autolock>	
         </locks>
 		
 		<roots>
 			<root>
 			  <field-name>org.springframework.security.core.session.SessionRegistryImpl.principals</field-name>
 			  <root-name>PRINCIPALS</root-name>
 			</root>
 			<root>
 			  <field-name>org.springframework.security.core.session.SessionRegistryImpl.sessionIds</field-name>
 			  <root-name>SESSIONIDS</root-name>
 			</root>
 		</roots>
 		
 		 	<injected-instances>
 			 <injected-field>
 			   <field-name>org.springframework.security.core.session.SessionRegistryImpl.principals</field-name>
 			 </injected-field>
 			 <injected-field>
 			   <field-name>org.springframework.security.core.session.SessionRegistryImpl.sessionIds</field-name>
 			 </injected-field>
 			</injected-instances>
 		
 		<web-applications>
 			<web-application serialization="false">nymphaea</web-application>
 		</web-applications>
 		<dso-reflection-enabled>false</dso-reflection-enabled>
 	  
 	  </dso>
 	</application>
 	
 	
 </tc:tc-config>
 


ehcache.xml

Code:
 
 <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="ehcache.xsd"
          updateCheck="true" monitoring="autodetect"
          dynamicConfig="true">
 
 
     <diskStore path="java.io.tmpdir"/>
 
     <defaultCache
         maxElementsInMemory="50000"
         eternal="false"
         timeToIdleSeconds="900"
         timeToLiveSeconds="1200"
         >
              <terracotta clustered="true" valueMode="identity"/>       
         </defaultCache>
 
     <cache name="ContentHierarchyNode"
         maxElementsInMemory="500000"
         eternal="false"
         timeToIdleSeconds="900"
         timeToLiveSeconds="21600"        
         />
         
     <cache name="ForumHierarchyNode"
         maxElementsInMemory="500000"
         eternal="false"
         timeToIdleSeconds="900"
         timeToLiveSeconds="21600"        
         />
 </ehcache>
 
 


Choesang Tenzin
 
Profile for tchoesan -> Messages posted by tchoesan [7]
Go to:   
Powered by JForum 2.1.7 © JForum Team