[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]
TC 2.7.2 + Spring 2.5 + JBoss 4 - Duplicated Application Context  XML
Forum Index -> Terracotta for Spring
Author Message
naaka

neo

Joined: 12/23/2008 06:20:18
Messages: 4
Offline

Hi,
i'm deploying a simple Spring 2.5 web application with a clustered object in a JBoss 4 AS.

The problem is that every time i restart the application server a new tc:spring_context and tc:spring_info are created into terracotta, instead of retrieving the ones created in the last run.

As a side effect, if i start two different instances, each one has a different context and there is no real clustering between the two.


Can you provide me some hints ?

In each context the object is correctly clustered.


Thanks in advance


Nicola
[Thumb - tc-dpring-duplicated context.png]
 Filename tc-dpring-duplicated context.png [Disk] Download
 Description Terracotta console showing duplicated contexts.
 Filesize 109 Kbytes
 Downloaded:  331 time(s)

 Filename tc-config.xml [Disk] Download
 Description terracotta config file
 Filesize 1 Kbytes
 Downloaded:  256 time(s)

naaka

neo

Joined: 12/23/2008 06:20:18
Messages: 4
Offline

I add other screenshot with the details of the spring_info and spring_context.
[Thumb - tc-spring-context.png]
 Filename tc-spring-context.png [Disk] Download
 Description spring context
 Filesize 145 Kbytes
 Downloaded:  297 time(s)

[Thumb - tc-spring-info.png]
 Filename tc-spring-info.png [Disk] Download
 Description spring info
 Filesize 148 Kbytes
 Downloaded:  320 time(s)

aksonov

neo

Joined: 01/16/2009 07:21:38
Messages: 3
Offline

Have you solved this problem? I don't know how to share application contexts as well...

naaka wrote:
I add other screenshot with the details of the spring_info and spring_context. 
gcastaldi

neo

Joined: 01/05/2009 01:17:33
Messages: 1
Offline

We've found out that terracotta need to assign an id to spring ContextFactory and if not specified with <root-name> it uses one obtained by the absolute path of the config file (or somehing similar).
To resolve the problem we have specified the root-name in jee-application:

Code:
 <?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/config http://www.terracotta.org/schema/terracotta-4.xsd">
 
   <servers>
     <server host="%i" name="localhost">
       <dso-port>9510</dso-port>
       <jmx-port>9520</jmx-port>
       <data>/opt/terracotta/ecommerce-webapp/server-data</data>
       <logs>/opt/terracotta/ecommerce-webapp/server-logs</logs>
       <statistics>/opt/terracotta/ecommerce-webapp/server-statistics</statistics>
     </server>
   </servers>
 
   <clients>
     <logs>/opt/terracotta/ecommerce-webapp/client-logs/%(tc.node-name)</logs>
     <statistics>/opt/terracotta/ecommerce-webapp/client-statistics/%(tc.node-name)</statistics>
   </clients>
 
   <application>
     <dso>
       <web-applications>
         <web-application>ecommerce-webapp</web-application>
       </web-applications>
     </dso>
     <spring>
       <jee-application name="ecommerce-webapp">
         <application-contexts>
           <application-context>
             <root-name>myClusteredSpringContext</root-name>
             <paths>
               <path>spring-cluster.xml</path>
             </paths>
             <beans>
               <bean name="clusteredCounter" />
             </beans>
           </application-context>
         </application-contexts>
       </jee-application>
     </spring>
   </application>
 </tc:tc-config>
 


Giannandrea
aksonov

neo

Joined: 01/16/2009 07:21:38
Messages: 3
Offline

Thanks! I've figured out this about 30 minutes ago and going to write it to the forum ;)

Strange, why nobody replied to you :)
gyan10

ophanim

Joined: 06/28/2011 23:15:25
Messages: 701
Offline

This is very old thread.Please respond if issue is still not resolved.
Thanks

Gyan Awasthi
Terracotta -A Software AG company
 
Forum Index -> Terracotta for Spring
Go to:   
Powered by JForum 2.1.7 © JForum Team