关于Terracotta+Hibernate+Ehcache整合的一个问题

09-10-19 finikes
                   

版本:

OS:win32

Terracotta:3.1.1

Hibernate:3.2.5

Tomcat:6.0.

好不容易配置了Terracotta+Hibernate+Tomcat,Terracotta+Tomcat运行没有问题

加入Hibernate后,启动Tomcat老是报错:

Thread                                        : main
JVM ID                                        : VM(0)
Non-portable root name                        : default:terracottaHibernateCaches
Unshareable class                             : org.terracotta.modules.concurrent.collections.ConcurrentStringMap
Classes to add to the <includes> configuration: org.terracotta.collections.ConcurrentDistributedMap

Under most circumstances, you should only be adding classes for your
application. If you are adding classes for frameworks or code not written by
you, then you should consider finding a Terracotta Integration Module (TIM)
that matches the framework you are using.

As an example, if the non-portable class listed below is
net.sf.ehcache.CacheManager, you should consider using the ehcache TIM.

It is possible that some or all of the super classes above are truly
non-portable, the solution is then to mark the referring field(s) as
transient.


Action to take:

1) Reconfigure to include the unshareable super-class(es)
   * edit your tc-config.xml file
   * locate the <dso> element
   * add this snippet inside the <dso> element

       <instrumented-classes>
         <include>
           <class-expression>org.terracotta.collections.ConcurrentDistributedMap</class-expression>
         </include>
       </instrumented-classes>

   * if there is already an <instrumented-classes> element present, simply add
     the new includes inside it
<p>

即便是改过了tc-config.xml也继续报告这个错误!

请问这个问题该如何解决?

谢谢!

另外,Ehcache在Terracotta+Hibernate的环境下究竟干什么呢?

需要单独安装Ehcache吗?

谢谢!

[该贴被finikes于2009-10-19 01:36修改过]

                   

1
banq
2009-10-19 09:47

直接将Terracotta作为Hibernate二级缓存就可以,和Tomcat无关,tomcat出错,就换Jetty等试验一下,下面这篇文章可翻墙过去看看,安装步骤很清晰,是3.1版本的:

Second Level Caching for Hibernate with Terracotta

finikes
2009-10-19 12:21

板桥哥,还是不行啊!

我这个配置是按照官方的那个网页来的,和你提供的网页上的教程差不多。

关键是它也没有提到我遇到的这个问题。

现在我的developer-console可以看见客户端,可以管理HttpSession,甚至可以监测到我的应用里面的hibernate 只不过数据都是零而已(因为应用出错,根本无法服务,当然是零)

banq
2009-10-20 09:41

我意思你换一个服务器JBoss或Jetty试验一下,Terracotta+Hibernate+Ehcache是和服务器无关的,这可能是Tomcat自身问题。