[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
hib InstantiationException in PojoInitializer during stress testing  XML
Forum Index -> Ehcache
Author Message
bradrust

neo

Joined: 07/29/2010 13:59:25
Messages: 8
Offline

We are configured in DSO mode with the following components (and for the most part operating correctly with regard to what terracotta is supposed to do):

terracotta-3.4.0
spring-3.0.4
hibernate-3.5.6
ehcache-2.2.0

Everything appears to be working (except for why I am posting) correctly wrt to WebSession replication, Hibernate second level caching with ehcache, and DSO root functionality.

However, after a certain amount of stress-testing, one or more of the appservers (tomcat instances) starts to throw these InstantiationExceptions complaining about a defaultConstructor. The code previous to "breaking" is covered in the stress test. From that point, this particular class is always "broken" until the appserver is restarted -- like it's been instrumented or modified in the JVM.

Anyway, it appears someone else had this issue back in terracotta 2 and I am wondering if that was re-introduced or if there is something that I have mis-configured. http://forums.terracotta.org/forums/posts/list/319.page

We are using hibernate-3.5.6 and I have *not* been able to get the tim-hibernate-entity working. (It fails during startup where the terracotta classes are looking for a VERSION field in a hibernate class). Anyway, the fact that I am adding net.sf..* and org.hibernate..* to instrumented classes could be significant but I really really don't want to roll-back hibernate upgrades and all appears to be working otherwise.

Below is my tc-config for my appservers and a snippet of the exception.

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 name="tc1">
       <dso-port>59510</dso-port>
       <jmx-port>59520</jmx-port>
       <l2-group-port>59530</l2-group-port>
       <data>/tc/terracotta-data/server-logs</data>
       <logs>/tc/terracotta-data/server-logs</logs>
       <statistics>/tc/terracotta-data/server-statistics</statistics>
       <dso>
         <persistence>
           <mode>permanent-store</mode>
         </persistence>
       </dso>
     </server>
     <server name="tc2">
       <dso-port>59510</dso-port>
       <jmx-port>59520</jmx-port>
       <l2-group-port>59530</l2-group-port>
       <data>/tc/terracotta-data/server-logs</data>
       <logs>/tc/terracotta-data/server-logs</logs>
       <statistics>/tc/terracotta-data/server-statistics</statistics>
       <dso>
         <persistence>
           <mode>permanent-store</mode>
         </persistence>
       </dso>
     </server>
   </servers>
   <!--Tell DSO where to put the generated client logs See the Terracotta DSO Guide for additional information. -->
 
   <clients>
     <modules>
       <repository>company/lib</repository>
       <module name="tim-tomcat-6.0" version="2.2.1" />
       <module name="tim-ehcache-2.x" version="1.6.1" />
     </modules>
     <logs>/tc/terracotta-data/client-logs</logs>
   </clients>
   <application>
     <dso>
 
       <!-- needed for TreeMap -->
       <additional-boot-jar-classes>
         <include>java.lang.String$CaseInsensitiveComparator</include>
       </additional-boot-jar-classes>
 
       <instrumented-classes>
         <include>
           <class-expression>org.springframework.security..*</class-expression>
         </include>
         <include>
           <class-expression>com.company..*</class-expression>
           <honor-transient>true</honor-transient>
         </include>
 
         <!-- flex remoting -->
         <include>
           <class-expression>flex.messaging..*</class-expression>
         </include>
         <include>
           <class-expression>org.granite.messaging..*</class-expression>
         </include>
 
         <!-- needed for hibernate 2nd level cache (could not get the tim-hibernate to work) -->
         <include>
           <class-expression>org.hibernate..*</class-expression>
           <honor-transient>true</honor-transient>
         </include>
         <include>
           <class-expression>net.sf..*</class-expression>
           <honor-transient>true</honor-transient>
         </include>
 
         <!-- Exclude tomcat internals to improve performance of webapp loading -->
         <exclude>org.apache.coyote..*</exclude>
         <exclude>org.apache.catalina..*</exclude>
         <exclude>org.apache.jasper..*</exclude>
         <exclude>org.apache.tomcat..*</exclude>
       </instrumented-classes>
       <!--Tell DSO which applications in your web container is using DSO -->
 
       <!-- was getting locking issues with hibernate under load (could not get the tim-hibernate to work) -->
       <locks>
         <autolock auto-synchronized="true">
           <method-expression>* org.hibernate.cache.ReadWriteCache$Lock.lock(..)</method-expression>
           <lock-level>write</lock-level>
         </autolock>
         <autolock auto-synchronized="true">
           <method-expression>* org.hibernate.cache.ReadWriteCache$Lock.unlock(..)</method-expression>
           <lock-level>write</lock-level>
         </autolock>
       </locks>
 
       <web-applications>
         <web-application>product</web-application>
       </web-applications>
 
     </dso>
   </application>
 </tc:tc-config>
 




Code:
 org.hibernate.InstantiationException: No default constructor for entity: com.company.model.arts.CustomerAffiliationId
         at org.hibernate.tuple.PojoInstantiator.instantiate(PojoInstantiator.java:107)
         at org.hibernate.tuple.component.AbstractComponentTuplizer.instantiate(AbstractComponentTuplizer.java:102)
         at org.hibernate.type.ComponentType.instantiate(ComponentType.java:510)
         at org.hibernate.type.ComponentType.instantiate(ComponentType.java:516)
         at org.hibernate.type.ComponentType.assemble(ComponentType.java:565)
         at org.hibernate.type.ManyToOneType.assembleId(ManyToOneType.java:257)
         at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:241)
         at org.hibernate.collection.PersistentSet.initializeFromCache(PersistentSet.java:147)
         at org.hibernate.cache.entry.CollectionCacheEntry.assemble(CollectionCacheEntry.java:58)
         at org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:159)
         at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:71)
         at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1853)
         at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:369)
         at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
         at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:134)
         at org.hibernate.collection.PersistentSet.isEmpty(PersistentSet.java:169)
         at com.company.service.impl.CustomerManagerImpl.convertToCustDTO(CustomerManagerImpl.java:819)
 

ari

seraphim

Joined: 05/24/2006 14:23:21
Messages: 1665
Location: San Francisco, CA
Offline

Can I ask why you are using DSO-mode for Hibernate and Ehcache clustering? You should move to express...I am not even sure DSO-mode has been tested with Hibernate 3.5.6. Also, Ehcache2.2 is not supposed to be run w/ Terracotta 3.4.

Unfortunately, I would suggest you redo things and stay in express mode and stay in a single download kit...don't download the jars / components individually.

--Ari
[WWW]
rajoshi

seraphim

Joined: 07/04/2011 04:36:10
Messages: 1491
Offline

Issue seems to be resolved.Please let us know if more information is required.

Rakesh Joshi
Senior Consultant
Terracotta.
 
Forum Index -> Ehcache
Go to:   
Powered by JForum 2.1.7 © JForum Team