[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+Hibernate的问题  XML
Forum Index -> Terracotta 中文社区
Author Message
finikes

journeyman

Joined: 10/13/2009 02:11:29
Messages: 22
Offline

先前配置了Terracotta+Tomcat
基本没有问题了
接下来自然是配置Terracotta+Hibernate

照着官方的文档 配置好了以后 启动服务器没问题 启动节点

报错:
Code:
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


可明明我是照这样配了 还是不行!

我的tc-config.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
 <tc:tc-config
 	xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-5.xsd"
 	xmlns:tc="http://www.terracotta.org/config"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
 	<servers>
 
 		<server host="127.0.0.1">
 			<dso-port>9510</dso-port>
 		</server>
 
 	</servers>
 
 	<clients>
 		<modules>
 			<!--
 				<module name="tim-apache-struts-1.1" version="1.4.1" />
 				<module name="tim-jetty-6.1" version="2.0.1" />
 				<module name="jetty-terracotta-sessions" version="6.1.15" />
 				<module name="tim-session-common" version="2.0.0" />
 			-->
 			<module name="tim-concurrent-collections" version="1.2.1" />
 			<module name="tim-distributed-cache" version="1.2.1" />
 			<module name="tim-hibernate-cache-provider-3.2" version="1.0.1" />
 			<module name="tim-hibernate-concurrency-3.2" version="1.0.1" />
 			<module name="tim-hibernate-concurrency-common" version="1.0.1" />
 			<module name="tim-hibernate-cache-3.2" version="1.0.1" />
 			<module name="tim-tomcat-6.0" version="2.0.1" />
 			<module name="tim-tomcat-5.5" version="2.0.1" />
 			<module name="tim-tomcat-common" version="2.0.1" />
 			<module name="tim-ehcache-1.3" version="1.4.1" />
 			<module name="tim-ehcache-commons" version="1.4.1" />
 		</modules>
 	</clients>
 
 	<application>
 		<dso>
 			<instrumented-classes>
 				<include>
 					<class-expression>
 						org.terracotta.collections.ConcurrentDistributedMap
 					</class-expression>
 				</include>
 			</instrumented-classes>
 			<web-applications>
 				<web-application>TCTest</web-application>
 			</web-applications>
 		</dso>
 	</application>
 </tc:tc-config>


版本:
Terracotta: 3.1.1
Hibernate: 3.2
finikes

journeyman

Joined: 10/13/2009 02:11:29
Messages: 22
Offline

郁闷就郁闷在,按照错误报告的要求改了tc-config.xml文件
不仅继续出错,而且还是以前的错误 一点没变

另外再附上我的tomcat启动脚本:
Code:
set TOMCAT_HOME=D:\apache-tomcat-6.0.20
 set TC_INSTALL_DIR=D:\terracotta\terracotta-3.1.1
 set TC_CONFIG_PATH=D:\terracotta\terracotta-3.1.1\tc-config.xml
 call %TC_INSTALL_DIR%\bin\dso-env.bat -q
 set JAVA_OPTS=%JAVA_OPTS% %TC_JAVA_OPTS%
 startup.bat


另外在catalina.bat的第一行增加了:
Code:
set JAVA_OPTS=-javaagent:\terracotta\terracotta-3.1.1\hibernate\terracotta-hibernate-agent-1.0.1.jar -cp D:\terracotta\terracotta-3.1.1\hibernate\terracotta-hibernate-cache-1.0.1.jar


只要一启动tomcat就出错
lima

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

不知道您是按哪一个文档配置的。
如果只是需要Hibernate二级缓存何Tomcat Session复制的支持,您应该只需要:
<module name="tim-hibernate-cache-3.2" version="1.0.1" />
和下面两个中的一个:
<module name="tim-tomcat-6.0" version="2.0.1" />
<module name="tim-tomcat-5.5" version="2.0.1" />

EHCache肯定是没用的。

这里有一些文档,希望有用:
http://terracotta.org/web/display/orgsite/Configuring+Terracotta+With+Hibernate+Custom+Installation

http://terracotta.org/web/display/orgsite/Tomcat+Integration#TomcatIntegration-hibernate

lima
finikes

journeyman

Joined: 10/13/2009 02:11:29
Messages: 22
Offline

这里是Ari的回答:http://forums.terracotta.org/forums/posts/list/2615.page#15538

我就是按照管网的文档配置的,给我看得一头雾水!

现在已经不关tomcat和session什么事情了,我只是想配置Terracotta+Hibernate。
问题是我总要用tomcat之类的部署应用,Jetty我是用不了了,因为我在win32上做试验,Jetty+Terracotta+win32我是不知道怎么配
Tomcat一启动就报告那个error,而且按照Ari的说法,不要管那个提示,问题又来了,就算不管那个提示,应用总是跑不了的!

现在在tomcat访问不了应用(我就安排了一个测试用例),但是在developer-console可以看见HttpSession,也出现了hibernate监视器,只不过打开二级换成监视器没有数据流量(无效的应用当然不能产生缓存)。
finikes

journeyman

Joined: 10/13/2009 02:11:29
Messages: 22
Offline

测试用例
 Filename TCTest.rar [Disk] Download
 Description 测试用例
 Filesize 42978 Kbytes
 Downloaded:  28 time(s)

finikes

journeyman

Joined: 10/13/2009 02:11:29
Messages: 22
Offline

问题持续得不到解决,各种服务器都不能很好地和terracotta搭配,问过以前搭配成功的弟兄。都说是3.0版本以前的可以,后来都不再搞了。

这个东西真这么不好用么?
lima

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

我看了一下你上传的文件,现在还缺文件,所以我不能把整个系统搭建起来。
现在先说说我看到的几个问题:

1、tc-config.xml文件:
Module部分只需要两个TIM就可以了:
<modules>
<module name="tim-hibernate-cache-3.2" version="1.0.1"/>
<module name="tim-tomcat-6.0" version="2.0.2"/>
</modules>

2、我没找到hibernate.cfg.xml

麻烦你把错误信息,最好有log文件发过来。我看看到底是怎么回事儿。
如果能把MySQL的脚本也给我,我帮你看看在本地能不能把整个环境搭建起来。

老马
finikes

journeyman

Joined: 10/13/2009 02:11:29
Messages: 22
Offline

谢谢老马!

我的这个测试用例中的hibernate是用spring维护的

我看官网教程上terracotta整合hibernate是支持spring用户的

出错信息其实就是我用QQ传给你的文件里写的那么多

我从terracotta的3.1.0用到3.1.1 从开源版用到企业版

应用服务器从tomcat一路用到glassfish 不下5个种类

始终逃不掉!

现在我用terracotta管理tomcat的session没有问题

但是一打开terracotta的for hibernate的二级缓存并且加上-javaagent:terracotta-hibernate-agent-1.0.1.jar就启动时就自动跳出。

数据库我用的是sqlserver2005 建库文件在下面
finikes

journeyman

Joined: 10/13/2009 02:11:29
Messages: 22
Offline

就一张表
一个主键 是int自增型的

有劳,谢谢!
 Filename tctest.sql [Disk] Download
 Description
 Filesize 872 bytes
 Downloaded:  585 time(s)

finikes

journeyman

Joined: 10/13/2009 02:11:29
Messages: 22
Offline

spring配置文件在WEB-INF目录 里面有好几个spring 应用程序上下文配置文件
其中负责维护hibernate属性的是applicationContext.xml

测试用的数据库我给分离出来了 是ms sql server 2005

其实很简单的 就是一张表:passport
主键:id 为sqlserver int 自增长 种子为1

字段:name nvarchar
字段:pwd nvarchar

就这些了 麻烦你了!
 Filename TCTest-data.zip [Disk] Download
 Description
 Filesize 180 Kbytes
 Downloaded:  1065 time(s)

 
Forum Index -> Terracotta 中文社区
Go to:   
Powered by JForum 2.1.7 © JForum Team