« Return to Thread: webapp spring roots

Re: webapp spring roots

by Fernando Padilla :: Rate this Message:

Reply to Author | View in Thread

attached is my tc-config.xml


Fernando Padilla wrote:

> I did as you suggested.  I loaded the app under tomcat, and it works as
> usual.  Then I shutdown tomcat and ran it under jetty and got this
> exception:
>
> 7233 [main] INFO com.tcspring.DistributableBeanFactoryMixin - ptAppsRoot
> registering transient fields for tc-cache-map-factory
> com.protrade.common.cache.CacheFactory
> com.tc.exception.TCClassNotFoundException:
> java.lang.ClassNotFoundException: No registered loader for description:
> Tomcat.Catalina:localhost:/fbracket, trying to load
> com.tcspring.ComplexBeanId
>          at
> com.tc.object.ClientObjectManagerImpl.lookupOrCreateRoot(ClientObjectManagerImpl.java:600)
>          at
> com.tc.object.bytecode.ManagerImpl.lookupOrCreateRoot(ManagerImpl.java:287)
>          at
> com.tc.object.bytecode.ManagerImpl.lookupOrCreateRoot(ManagerImpl.java:266)
>          at
> com.tc.object.bytecode.ManagerUtil.lookupOrCreateRoot(ManagerUtil.java:130)
>          at
> com.tcspring.DistributableBeanFactoryMixin$ManagerUtilWrapperImpl.lookupOrCreateRoot(DistributableBeanFactoryMixin.java:419)
>          at
> com.tcspring.DistributableBeanFactoryMixin.registerBeanDefinitions(DistributableBeanFactoryMixin.java:221)
>          at
> org.springframework.beans.factory.support.AbstractBeanFactory.registerBeanDefinitions(AbstractBeanFactory.java)
> ....
> ...
>
>
>
>
> Eugene Kuleshov wrote:
>> Hi Fernando,
>>
>>   By default Terracotta for Spring is naming those roots using synthetic
>> name derived from the matching web application name and matching spring
>> config names. There is a FAQ entry about that in the "Troubleshooting
>> Guide" linked from the on Terracotta home page. See
>> https://terracotta.org/confluence/display/wiki/Troubleshooting+Guide#TroubleshootingGuide-TerracottaforSpring...
>>
>>   So you can override that root name in your tc-config.xml using
>> <root-name> element:
>>
>> ...
>> <application>
>>    <spring>
>>      <jee-application>
>>        <application-contexts>
>>          <application-context>
>>            <root-name>myClusteredSpringContext</root-name>
>>              ...
>>
>>   regards,
>>   Eugene Kuleshov
>>
>> PS: it feels like I am the only one answering all the questions today,
>> but by strange coincidence those happens to be from my area of expertise
>>
>>
>> Fernando Padilla wrote:
>>> I want to run my webapp through tomcat, jetty and mvn jetty:run, but
>>> when I did, I noticed that terracotta was generating unique roots for
>>> different ways that I launch the web application; and for each different
>>> context path that I launch my webapp under.. ( so developers can't share
>>> roots )
>>>
>>> This is very disappointing.  How can I get this working?
>>>
>>> -------
>>> tc:spring_info.appName is coming up with different things:
>>>
>>> fbracket
>>> Jetty.path=/fbracket
>>> Jetty.path=/fannetwork
>>>  
>>
>>
>> _______________________________________________
>> tc-users mailing list
>> tc-users@...
>> http://lists.terracotta.org/mailman/listinfo/tc-users
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users

<?xml version="1.0" encoding="UTF-8" ?>
<tc:tc-config xmlns:tc="http://www.terracotta.org/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-4.xsd">

  <!-- Tell DSO where the Terracotta server can be found. -->
  <servers>
    <server host="%h">
      <data>%(user.home)/terracotta/server-data</data>
      <logs>%(user.home)/terracotta/server-logs</logs>
<!--
      <dso>
        <persistence>permanent-store</persistence>
      </dso>
-->
    </server>
  </servers>

  <!-- Tell DSO where to put the generated client logs -->  
  <clients>
    <logs>%(user.home)/terracotta/client-logs</logs>
    <modules>
      <module name="clustered-commons-collections-3.1" version="2.5.2"/>
      <module name="clustered-jetty-6.1" version="2.5.2"/>
    </modules>
  </clients>

  <application>
    <spring>

      <!-- The JEE application name is in most cases the name of the WAR, EAR
           or JAR file in which the Spring application resides. If you are
           using Spring in a stand-alone application then you can use "*" as
           the name. The pattern matching supports wildcards of leading and
           ending asterisk (*), which matches an arbitrary number of
           characters. -->
      <jee-application name="*">

        <!-- Turns on clustering of the HTTP session. Needed for f.e. Spring
             WebFlow clustering. -->
        <session-support>false</session-support>

        <application-contexts>
          <application-context>
            <root-name>ptAppsRoot</root-name>

            <!-- Specifies the bean definition resource patterns; The matching
                 applys OR logic for individual path element. -->
            <paths>
              <path>common-conf-props.xml</path>
              <path>terracotta-on-conf.xml</path>
            </paths>

            <!-- Specifies the Spring beans to cluster/share; The bean name
                 should be the same name that the bean has in the Spring bean
                 config file. Matching has to be exact; -->
            <beans>
              <bean name="tc-cache-map-factory"/>
              <bean name="tc-kodo-data-cache-mapfactory"/>
              <bean name="tc-kodo-query-cache-mapfactory"/>
              <bean name="tc-lockCache"/>
            </beans>

          </application-context>
        </application-contexts>

      </jee-application>
    </spring>
    <dso>
      <roots>
        <root>
          <field-name>com.protrade.terracotta.MasterRoot.masterRoot</field-name>
          <root-name>masterRoot</root-name>
        </root>
      </roots>
        <instrumented-classes>
<!-- master-root -->
          <include>
            <class-expression>com.protrade.terracotta.MasterRoot</class-expression>
          </include>

<!-- base -->
          <include>
            <class-expression>com.protrade.common.base.BaseObject</class-expression>
          </include>
          <include>
            <class-expression>org.apache.commons.collections.map.LazyMap</class-expression>
          </include>
          <include>
            <class-expression>org.apache.commons.collections.map.AbstractMapDecorator</class-expression>
          </include>
          <include>
            <class-expression>org.apache.commons.collections.functors.FactoryTransformer</class-expression>
          </include>
          <include>
            <class-expression>com.protrade.common.cache.CacheFactory$1</class-expression>
          </include>
          <include>
            <class-expression>com.protrade.common.util.LockCache$1</class-expression>
          </include>
 
<!-- kodo -->
          <include>
            <class-expression>kodo.util.Id</class-expression>
          </include>
          <include>
            <class-expression>kodo.datacache.DataCachePCDataImpl</class-expression>
          </include>
          <include>
            <class-expression>kodo.runtime.PCDataImpl</class-expression>
          </include>
          <include>
            <class-expression>kodo.runtime.AbstractPCData</class-expression>
          </include>
          <include>
            <class-expression>com.protrade.common.cache.MapDataCache$1</class-expression>
          </include>
          <include>
            <class-expression>com.protrade.common.cache.MapQueryCache$1</class-expression>
          </include>
 
<!-- protrade id -->
          <include>
            <class-expression>com.protrade.common.persistence.ProtradeId+</class-expression>
          </include>

<!-- buffer -->
          <include>
            <class-expression>com.protrade.tapestry5.base.services.BufferServices$CacheValue</class-expression>
          </include>
          <include>
            <class-expression>com.protrade.tapestry5.base.services.BufferServices$BufferValue</class-expression>
          </include>
        </instrumented-classes>

        <locks>
<!-- kodo -->
          <autolock>
            <method-expression>* kodo.datacache.DataCachePCDataImpl.get*(..)</method-expression>
            <lock-level>read</lock-level>
          </autolock>
          <autolock>
            <method-expression>* kodo.datacache.DataCachePCDataImpl.is*(..)</method-expression>
            <lock-level>read</lock-level>
          </autolock>
          <autolock>
            <method-expression>* kodo.datacache.DataCachePCDataImpl.load*(..)</method-expression>
            <lock-level>write</lock-level>
          </autolock>
          <autolock>
            <method-expression>* kodo.datacache.DataCachePCDataImpl.set*(..)</method-expression>
            <lock-level>write</lock-level>
          </autolock>
          <autolock>
            <method-expression>* kodo.datacache.DataCachePCDataImpl.store*(..)</method-expression>
            <lock-level>write</lock-level>
          </autolock>
        </locks>
    </dso>

  </application>

</tc:tc-config>

_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

 « Return to Thread: webapp spring roots

LightInTheBox - Buy quality products at wholesale price!