[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]
使用terracotta之后,访问应用程序始终处于Loading状态  XML
Forum Index -> Terracotta 中文社区
Author Message
wangbo

journeyman

Joined: 10/27/2009 00:43:02
Messages: 10
Offline

如果我在tc-config.xml中去掉以下内容,那么我的应用程序可以正常工作
<web-applications>
<web-application>root</web-application>
</web-applications>

一旦加上上述内容,就会出现应用程序无法访问,网页始终处于Loading状态,无法登陆。

下面是我的tc-config.xml文件内容:
<?xml version="1.0" encoding="UTF-8"?>
<tc:tc-config xsi:schemaLocation="http://www.terracotta.org/config http://www.terracotta.org/schema/terracotta-4.xsd" xmlns:tc="http://www.terracotta.org/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<tc-properties>

多谢!
<property name="l2.l1reconnect.enabled" value="true"/>
<property name="l2.l1reconnect.timeout.millis" value="15000"/>
<property name="l2.nha.tcgroupcomm.reconnect.enabled" value="true"/>
<property name="l2.nha.tcgroupcomm.reconnect.timeout" value="5000"/>
</tc-properties>

<servers>
<!--
<server host="192.168.1.22" name="abc">
<l2-group-port>9530</l2-group-port>
<dso>
<persistence>
<mode>permanent-store</mode>
</persistence>
</dso>
</server>
-->
<server host="192.168.1.19" name="xyz">
<l2-group-port>9530</l2-group-port>
<dso>
<persistence>
<mode>permanent-store</mode>
</persistence>
</dso>
</server>
<ha>
<mode>networked-active-passive</mode>
<networked-active-passive>
<election-time>5</election-time>
</networked-active-passive>
</ha>
<update-check>
<enabled>true</enabled>
</update-check>
</servers>


<clients>
<logs>%(user.home)/terracotta/client-logs</logs>
<modules>
<module name="tim-cglib-2.1.3" version="1.4.1"/>
<module name="tim-hibernate-cache-3.2" version="1.0.1"/>
<module name="tim-apache-struts-1.1" version="1.4.2"/>
<module name="tim-tomcat-5.5" version="2.0.2"/>
<module name="tim-spring-webflow-2.0" version="1.2.1"/>
<module name="tim-spring-security-2.0" version="1.2.1"/>
</modules>
</clients>


<application>
<dso>
<additional-boot-jar-classes>
<include>java.util.UUID</include>
<include>java.lang.String$CaseInsensitiveComparator</include>
</additional-boot-jar-classes>

<!--Tell DSO which applications in your web container is using DSO-->
<web-applications>
<web-application>root</web-application>
</web-applications>
<roots>
<root>
<field-name>com.i3.h24.service.store.Cart.items</field-name>
<root-name>CartItemList</root-name>
</root>
</roots>
</dso>
</application>

</tc:tc-config>

lima

consul
[Avatar]
Joined: 06/22/2009 10:12:31
Messages: 361
Offline

能不能把log文件都发过来看看,包括tomcat 5.5的和Terracotta的服务器和客户端的。

谢谢!
wangbo

journeyman

Joined: 10/27/2009 00:43:02
Messages: 10
Offline

lima wrote:
能不能把log文件都发过来看看,包括tomcat 5.5的和Terracotta的服务器和客户端的。
-
谢谢! 


仅运行了十分钟,日至文件terracotta-client就有160兆了。肯定有什么问题。请这位大侠帮忙看看。多谢!

 Filename catalina.out [Disk] Download
 Description
 Filesize 15 Kbytes
 Downloaded:  479 time(s)

 Filename terracotta-server.log [Disk] Download
 Description
 Filesize 29 Kbytes
 Downloaded:  551 time(s)

 Filename terracotta-client.log.zip [Disk] Download
 Description
 Filesize 6863 Kbytes
 Downloaded:  281 time(s)

lima

consul
[Avatar]
Joined: 06/22/2009 10:12:31
Messages: 361
Offline

在client log里面看到了大量如下错误信息:

2009-11-03 09:43:06,192 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - Dumping object graph of non-portable instance of type com.i3.h24.se
rvice.store.Cart. Lines that start with !! are non-portable types.2009-11-03 09:43:06,195 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - com.i3.h24.service.store.Cart (id 0)
2009-11-03 09:43:06,201 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - List items = (ArrayList, id 1)2009-11-03 09:43:06,202 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - com.i3.h24.service.store.Cart pendingCart = null
2009-11-03 09:43:06,202 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! com.i3.h24.model.Money poundPricePerSms = (id 2)
2009-11-03 09:43:06,205 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - double amount = 25.02009-11-03 09:43:06,206 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - Currency currency = EUR
2009-11-03 09:43:06,207 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! com.i3.h24.model.Money pricePerSms = (id 3)
2009-11-03 09:43:06,207 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - double amount = 25.0
2009-11-03 09:43:06,208 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - Currency currency = EUR2009-11-03 09:43:06,209 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - boolean processed = false
2009-11-03 09:43:06,210 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - int smsCredits = 02009-11-03 09:43:06,218 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - com.i3.h24.service.store.IStoreService storeService = (com.i3.
h24.service.store.TransactionalStoreService$$EnhancerByCGLIB$$937b10c7, id 4)2009-11-03 09:43:06,220 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - boolean CGLIB$BOUND = true
2009-11-03 09:43:06,221 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! net.sf.cglib.proxy.MethodInterceptor CGLIB$CALLBACK_0 = (org
.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor, id 5)2009-11-03 09:43:06,225 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! org.springframework.aop.framework.AdvisedSupport advised =
(org.springframework.aop.framework.ProxyFactory, id 6)
2009-11-03 09:43:06,226 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - boolean active = true2009-11-03 09:43:06,227 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - org.springframework.aop.Advisor[] advisorArray = (id 7)
2009-11-03 09:43:06,229 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! [0] = (org.springframework.transaction.interceptor.Bea
nFactoryTransactionAttributeSourceAdvisor, id 8)
2009-11-03 09:43:06,230 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! org.aopalliance.aop.Advice advice = (org.springframework.transaction.interceptor.TransactionInterceptor, id 9)
2009-11-03 09:43:06,232 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! org.apache.commons.logging.Log logger = (org.apach
e.commons.logging.impl.Log4JLogger, id 10)
2009-11-03 09:43:06,234 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! org.apache.log4j.Logger logger = (id 11)
2009-11-03 09:43:06,234 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - org.apache.log4j.helpers.AppenderAttachableImpl aai = null
...
 

我想这就是导致系统死机和产生大量日志文件的原因。

具体看这段信息,发现你试图把com.i3.h24.service.store.Cart放到session里面。但是这个类里面引用了很多没有在Terracotta配置中声明的类(前面有!!的都是),比如:
com.i3.h24.model.Money pricePerSms
com.i3.h24.service.store.IStoreService
等等。
你看看能不能把功能性的类引用从存储类中分离出来。只把存储类放在session里面。这样会减少很多对其它类的引用,共享起来方便的多。
wangbo

journeyman

Joined: 10/27/2009 00:43:02
Messages: 10
Offline

lima wrote:
在client log里面看到了大量如下错误信息:

2009-11-03 09:43:06,192 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - Dumping object graph of non-portable instance of type com.i3.h24.se
rvice.store.Cart. Lines that start with !! are non-portable types.2009-11-03 09:43:06,195 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - com.i3.h24.service.store.Cart (id 0)
2009-11-03 09:43:06,201 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - List items = (ArrayList, id 1)2009-11-03 09:43:06,202 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - com.i3.h24.service.store.Cart pendingCart = null
2009-11-03 09:43:06,202 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! com.i3.h24.model.Money poundPricePerSms = (id 2)
2009-11-03 09:43:06,205 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - double amount = 25.02009-11-03 09:43:06,206 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - Currency currency = EUR
2009-11-03 09:43:06,207 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! com.i3.h24.model.Money pricePerSms = (id 3)
2009-11-03 09:43:06,207 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - double amount = 25.0
2009-11-03 09:43:06,208 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - Currency currency = EUR2009-11-03 09:43:06,209 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - boolean processed = false
2009-11-03 09:43:06,210 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - int smsCredits = 02009-11-03 09:43:06,218 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - com.i3.h24.service.store.IStoreService storeService = (com.i3.
h24.service.store.TransactionalStoreService$$EnhancerByCGLIB$$937b10c7, id 4)2009-11-03 09:43:06,220 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - boolean CGLIB$BOUND = true
2009-11-03 09:43:06,221 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! net.sf.cglib.proxy.MethodInterceptor CGLIB$CALLBACK_0 = (org
.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor, id 5)2009-11-03 09:43:06,225 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! org.springframework.aop.framework.AdvisedSupport advised =
(org.springframework.aop.framework.ProxyFactory, id 6)
2009-11-03 09:43:06,226 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - boolean active = true2009-11-03 09:43:06,227 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - org.springframework.aop.Advisor[] advisorArray = (id 7)
2009-11-03 09:43:06,229 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! [0] = (org.springframework.transaction.interceptor.Bea
nFactoryTransactionAttributeSourceAdvisor, id 8)
2009-11-03 09:43:06,230 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! org.aopalliance.aop.Advice advice = (org.springframework.transaction.interceptor.TransactionInterceptor, id 9)
2009-11-03 09:43:06,232 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! org.apache.commons.logging.Log logger = (org.apach
e.commons.logging.impl.Log4JLogger, id 10)
2009-11-03 09:43:06,234 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! org.apache.log4j.Logger logger = (id 11)
2009-11-03 09:43:06,234 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - org.apache.log4j.helpers.AppenderAttachableImpl aai = null
...
 

我想这就是导致系统死机和产生大量日志文件的原因。

具体看这段信息,发现你试图把com.i3.h24.service.store.Cart放到session里面。但是这个类里面引用了很多没有在Terracotta配置中声明的类(前面有!!的都是),比如:
com.i3.h24.model.Money pricePerSms
com.i3.h24.service.store.IStoreService
等等。
你看看能不能把功能性的类引用从存储类中分离出来。只把存储类放在session里面。这样会减少很多对其它类的引用,共享起来方便的多。 


这意味着如果要使用terracotta就必须大面积重构原代码?还有其它方法吗,比如将所有的类都加入到terracotta配置中声明一下?
wangbo

journeyman

Joined: 10/27/2009 00:43:02
Messages: 10
Offline

lima wrote:
在client log里面看到了大量如下错误信息:

2009-11-03 09:43:06,192 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - Dumping object graph of non-portable instance of type com.i3.h24.se
rvice.store.Cart. Lines that start with !! are non-portable types.2009-11-03 09:43:06,195 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - com.i3.h24.service.store.Cart (id 0)
2009-11-03 09:43:06,201 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - List items = (ArrayList, id 1)2009-11-03 09:43:06,202 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - com.i3.h24.service.store.Cart pendingCart = null
2009-11-03 09:43:06,202 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! com.i3.h24.model.Money poundPricePerSms = (id 2)
2009-11-03 09:43:06,205 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - double amount = 25.02009-11-03 09:43:06,206 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - Currency currency = EUR
2009-11-03 09:43:06,207 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! com.i3.h24.model.Money pricePerSms = (id 3)
2009-11-03 09:43:06,207 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - double amount = 25.0
2009-11-03 09:43:06,208 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - Currency currency = EUR2009-11-03 09:43:06,209 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - boolean processed = false
2009-11-03 09:43:06,210 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - int smsCredits = 02009-11-03 09:43:06,218 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - com.i3.h24.service.store.IStoreService storeService = (com.i3.
h24.service.store.TransactionalStoreService$$EnhancerByCGLIB$$937b10c7, id 4)2009-11-03 09:43:06,220 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - boolean CGLIB$BOUND = true
2009-11-03 09:43:06,221 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! net.sf.cglib.proxy.MethodInterceptor CGLIB$CALLBACK_0 = (org
.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor, id 5)2009-11-03 09:43:06,225 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! org.springframework.aop.framework.AdvisedSupport advised =
(org.springframework.aop.framework.ProxyFactory, id 6)
2009-11-03 09:43:06,226 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - boolean active = true2009-11-03 09:43:06,227 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - org.springframework.aop.Advisor[] advisorArray = (id 7)
2009-11-03 09:43:06,229 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! [0] = (org.springframework.transaction.interceptor.Bea
nFactoryTransactionAttributeSourceAdvisor, id 8)
2009-11-03 09:43:06,230 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! org.aopalliance.aop.Advice advice = (org.springframework.transaction.interceptor.TransactionInterceptor, id 9)
2009-11-03 09:43:06,232 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! org.apache.commons.logging.Log logger = (org.apach
e.commons.logging.impl.Log4JLogger, id 10)
2009-11-03 09:43:06,234 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - !! org.apache.log4j.Logger logger = (id 11)
2009-11-03 09:43:06,234 [http-8443-Processor25] WARN com.terracottatech.dso.runtime - org.apache.log4j.helpers.AppenderAttachableImpl aai = null
...
 

我想这就是导致系统死机和产生大量日志文件的原因。

具体看这段信息,发现你试图把com.i3.h24.service.store.Cart放到session里面。但是这个类里面引用了很多没有在Terracotta配置中声明的类(前面有!!的都是),比如:
com.i3.h24.model.Money pricePerSms
com.i3.h24.service.store.IStoreService
等等。
你看看能不能把功能性的类引用从存储类中分离出来。只把存储类放在session里面。这样会减少很多对其它类的引用,共享起来方便的多。 


还有一个问题就是,为什么会有这么多warn打印?这些打印“WARN com.terracottatech.dso.runtime”都是啥意思?

多谢!
lima

consul
[Avatar]
Joined: 06/22/2009 10:12:31
Messages: 361
Offline

还有一个办法,就是利用transient配置,参见这两个文档的说明:
http://www.terracotta.org/web/display/docs/Sessions+Configurator+Guide
http://www.terracotta.org/web/display/docs/Configuring+DSO
这样指定为transient的字段就不被Terracotta处理了。但是你需要为他们指定初始化的方法。上面的文档中都有介绍。

把所有类都放到 instrucmented-class里面不是一个最好的办法。因为一是会影响效率,二是类太多,尤其是引用到的类太多,根本放不过来。
 
Forum Index -> Terracotta 中文社区
Go to:   
Powered by JForum 2.1.7 © JForum Team