[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Shared Object Type: java.util.GregorianCalendar, problem with unvisible method  XML
Forum Index -> Terracotta Platform
Author Message
twister

master

Joined: 12/19/2009 08:51:09
Messages: 59
Offline

Hi all;

While doing tests and essais with Terracotta and Tomcat in the scope of DSO, i've encountred an exeption that is :
Code:
2010-05-12 16:51:51,377 [http-8090-Processor22] ERROR com.tc.object.TCObjectImpl - Exception thrown
 com.tc.object.tx.UnlockedSharedObjectException: 
 *********************************************************************
 Attempt to access a shared object outside the scope of a shared lock.
 All access to shared objects must be within the scope of one or more
 shared locks defined in your Terracotta configuration.
 
 Caused by Thread: http-8090-Processor22 in VM(22)
 Shared Object Type: java.util.GregorianCalendar
 
 The cause may be one or more of the following:
  * Terracotta locking was not configured for the shared code.
  * The code itself does not have synchronization that Terracotta
    can use as a boundary.
  * The class doing the locking must be included for instrumentation.
  * The object was first locked, then shared.
 
 For more information on how to solve this issue, see:
 http://www.terracotta.org/usoe
 *********************************************************************
 
 	at com.tc.object.tx.ClientTransactionManagerImpl.getTransaction(ClientTransactionManagerImpl.java:202)
 	at com.tc.object.tx.ClientTransactionManagerImpl.fieldChanged(ClientTransactionManagerImpl.java:405)
 	at com.tc.object.TCObjectImpl.objectFieldChanged(TCObjectImpl.java:331)
 	at java.util.Calendar.__tc_setzone(Calendar.java)
 	at java.util.Calendar.writeObject(Calendar.java:2389)
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 	at java.lang.reflect.Method.invoke(Unknown Source)

I've added this to my tc-config.xml:
Code:
<autolock auto-synchronized="true">
           <method-expression>void java.util.Calendar.writeObject(java.io.ObjectOutputStream)</method-expression>
           <lock-level>write</lock-level>
         </autolock>

but the error still raised, and the method writeObject is unvisible (private method in Calendar class)
here is my tc-config.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
 <tc:tc-config xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-4.xsd" xmlns:tc="http://www.terracotta.org/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <servers>
     <!--Tell DSO where the Terracotta server can be found.-->
     <server host="localhost">
       <dso-port>9510</dso-port>
       <jmx-port>9520</jmx-port>
       <data>%(user.home)/rracottaWeb/server-data</data>
       <logs>%(user.home)/rracottaWeb/server-logs</logs>
       <dso>
         <persistence>
           <mode>permanent-store</mode>
         </persistence>
       </dso>
     </server>
   </servers>
   <!--Tell DSO where to put the generated client logs-->
   <clients>
   <modules>
   <module name="tim-tomcat-5.5" version="2.1.2"/>
   </modules>
     <logs>%(user.home)/rracttaWeb/client-logs</logs>
   </clients>
   <application>
     <dso>
       <!--Start by including all classes for instrumentation.
 It's more efficient to instrument only those classes that
 hold shared roots or are part of a shared root's graph.-->
       <instrumented-classes>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.runtime.ProcessDefinitionRepository</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.runtime.ProcessDefinition</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.nodes.StartStateNode</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.nodes.Node</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.nodes.ActivityNode</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.transitions.Transition</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.nodes.StateNode</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.screen.Screen</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.nodes.EndStateNode</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.nodes.ProcessNode</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.events.NodeEnterEvent</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.events.NodeLeaveEvent</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.expression.BooleanExpression.LessOrEqual</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.expression.Variable</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.expression.Litteral</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.nodes.DecisionNode</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.expression.BooleanExpression.GreaterThan</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.screen.Attribute</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.expression.BooleanExpression.BooleanExpression</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.expression.Expression</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.events.Event</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.expression.ArthmeticExpression.ArithmeticExpression</class-expression>
         </include>
 		<include>
            <class-expression>ma.co.omnidata.framework.services.workflow.runtime.Token</class-expression>
          </include>
 		 <include>
            <class-expression>ma.co.omnidata.framework.services.workflow.runtime.ExecutionContext</class-expression>
          </include>
 		 <include>
            <class-expression>omnidata.rekrut.candidatures.metier.modele.Candidature</class-expression>
          </include>
 		 <include>
            <class-expression>omnidata.rekrut.curriculumVitae.metier.modele.CV</class-expression>
          </include>
          <include>
            <class-expression>omnidata.rekrut.curriculumVitae.metier.modele.CVPere</class-expression>
          </include>
 		 <include>
            <class-expression>omnidata.rekrut.offrePoste.metier.modele.PosteAPourvoir</class-expression>
          </include>
          <include>
            <class-expression>omnidata.rekrut.offrePoste.metier.modele.Poste</class-expression>
          </include>
 
         <include>
           <class-expression>lhabib.InitWorkflow</class-expression>
         </include>
         <include>
           <class-expression>ma.co.omnidata.framework.services.workflow.InitWorkflow</class-expression>
         </include>
 		<include>
               <class-expression>ma.co.omnidata.framework.services.workflow.runtime.ExecutionService</class-expression>
         </include>
 	</instrumented-classes>
 	  <!--
 	  <additional-boot-jar-classes>
         <include>java.util.TimeZone</include>
         <include>sun.util.calendar.ZoneInfo</include>
 		<include>java.util.TimeZone</include>
        </additional-boot-jar-classes>
 	   -->
 
       <roots>
         
         <root>
           <field-name>ma.co.omnidata.framework.services.workflow.InitWorkflow.pdr</field-name>
           <root-name>maconfig</root-name>
         </root>
 		
 		<root>
           <field-name>lhabib.InitWorkflow.pdr</field-name>
           <root-name>maconfig</root-name>
         </root>
 		
 		<root>
           <field-name>ma.co.omnidata.framework.services.workflow.runtime.ExecutionService.pdr</field-name>
           <root-name>maconfig</root-name>
         </root>
 		
         <root>
           <field-name>ma.co.omnidata.framework.services.workflow.runtime.ExecutionService.pdr2</field-name>
           <root-name>maconfig</root-name>
         </root>
 		
       </roots>
 	  
 	  <transient-fields>
         <field-name>java.util.Calendar.zone</field-name>
        </transient-fields> 
 
 
       <!--Apply write level autolocks for all instrumented methods.
 It's more efficient to create finer-grain locks as dictated
 by your application needs.-->
       <locks>
 	  
 	    <autolock auto-synchronized="true">
           <method-expression>void java.util.GregorianCalendar.writeObject(java.io.ObjectOutputStream)</method-expression>
           <lock-level>write</lock-level>
         </autolock>
 	  <autolock auto-synchronized="true">
           <method-expression>void ma.co.omnidata.framework.services.workflow.runtime.Token.setCurrentNode(ma.co.omnidata.framework.services.workflow.nodes.Node)</method-expression>
           <lock-level>write</lock-level>
         </autolock>
 		
 	  <autolock auto-synchronized="true">
           <method-expression>void ma.co.omnidata.framework.services.workflow.runtime.ExecutionContext.setLastStateNode(ma.co.omnidata.framework.services.workflow.nodes.Node)</method-expression>
           <lock-level>write</lock-level>
         </autolock>
 		
         <autolock auto-synchronized="true">
           <method-expression>void ma.co.omnidata.framework.services.workflow.nodes.Node.setToken(ma.co.omnidata.framework.services.workflow.runtime.Token)</method-expression>
           <lock-level>write</lock-level>
         </autolock>        
         <autolock auto-synchronized="true">
           <method-expression>String ma.co.omnidata.framework.services.workflow.runtime.ExecutionService.buildProcessInstance(java.lang.String,java.lang.String)</method-expression>
           <lock-level>write</lock-level>
         </autolock>
         <autolock auto-synchronized="true">
           <method-expression>String ma.co.omnidata.framework.services.workflow.runtime.ExecutionService.buildProcessInstanceByEntityName(java.lang.String,java.lang.String)</method-expression>
           <lock-level>write</lock-level>
         </autolock>
         <autolock auto-synchronized="true">
           <method-expression>void ma.co.omnidata.framework.services.workflow.nodes.Node.setName(java.lang.String)</method-expression>
           <lock-level>write</lock-level>
         </autolock>
         <autolock auto-synchronized="true">
           <method-expression>void ma.co.omnidata.framework.services.workflow.transitions.Transition.setTo(java.lang.String)</method-expression>
           <lock-level>write</lock-level>
         </autolock>
         <autolock auto-synchronized="true">
           <method-expression>void ma.co.omnidata.framework.services.workflow.transitions.Transition.setName(java.lang.String)</method-expression>
           <lock-level>write</lock-level>
         </autolock>
         <autolock auto-synchronized="true">
           <method-expression>ma.co.omnidata.framework.services.workflow.runtime.ProcessDefinitionRepository ma.co.omnidata.framework.services.workflow.runtime.ProcessDefinitionRepositoryBuilder.buildProcessDefinitionRepository(java.lang.String)</method-expression>
           <lock-level>write</lock-level>
         </autolock>
 		</locks>
       <app-groups>
         <app-group name="webAndPojo">
           <web-application>rh</web-application>
           <named-classloader>Standard.system</named-classloader>
         </app-group>
       </app-groups>
     </dso>
   </application>
 </tc:tc-config>


Any idea would be welcome
Thanks
ari

seraphim

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

Private methods are never invisible to us :)

Here's a thread where someone got it working 6 months ago in another app.

http://forums.terracotta.org/forums/posts/list/2115.page
[WWW]
twister

master

Joined: 12/19/2009 08:51:09
Messages: 59
Offline

I've already red this topic, added the autolocks stanzas :
Code:
<autolock auto-synchronized="true">
           <method-expression>void java.util.Calendar.writeObject(..)</method-expression>
           <lock-level>write</lock-level>
         </autolock>

But the i still get the exeption above.
 
Forum Index -> Terracotta Platform
Go to:   
Powered by JForum 2.1.7 © JForum Team