Tomcat6下部署BTM
参考http://docs.codehaus.org/display/BTM/Tomcat2x进行配置,可是出现了下面的错误
2012-9-10 20:09:03 bitronix.tm.BitronixTransactionManager logVersion 信息: Bitronix Transaction Manager version 2.1.0 2012-9-10 20:09:03 bitronix.tm.Configuration buildServerIdArray 警告: cannot get this JVM unique ID. Make sure it is configured and you only use ASCII characters. Will use IP address instead (unsafe for production usage!). 2012-9-10 20:09:03 bitronix.tm.Configuration buildServerIdArray 信息: JVM unique ID: <10.10.212.85> 2012-9-10 20:09:03 bitronix.tm.recovery.Recoverer run 信息: recovery committed 0 dangling transaction(s) and rolled back 0 aborted tra nsaction(s) on 0 resource(s) [] (restricted to serverId '10.10.212.85') 2012-9-10 20:09:03 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 2012-9-10 20:09:03 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.35 2012-9-10 20:09:03 org.apache.catalina.startup.HostConfig deployDescriptor 信息: Deploying configuration descriptor host-manager.xml 2012-9-10 20:09:04 org.apache.catalina.core.NamingContextListener addResource警告: Failed to register in JMX: javax.naming.NamingException: no resource regis tered with uniqueName 'jdbc/MYSQL', available resources: [] 2012-9-10 20:09:04 org.apache.catalina.startup.HostConfig deployDescriptor 信息: Deploying configuration descriptor manager.xml 2012-9-10 20:09:04 org.apache.catalina.core.NamingContextListener addResource警告: Failed to register in JMX: javax.naming.NamingException: no resource regis tered with uniqueName 'jdbc/MYSQL', available resources: [] 2012-9-10 20:09:04 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory BTM 2012-9-10 20:09:04 org.apache.catalina.core.NamingContextListener addResource 警告: Failed to register in JMX: javax.naming.NamingException: no resource regis tered with uniqueName 'jdbc/MYSQL', available resources: [] 2012-9-10 20:09:04 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory docs 2012-9-10 20:09:04 org.apache.catalina.core.NamingContextListener addResource 警告: Failed to register in JMX: javax.naming.NamingException: no resource regis tered with uniqueName 'jdbc/MYSQL', available resources: [] 2012-9-10 20:09:04 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory examples 2012-9-10 20:09:05 org.apache.catalina.core.NamingContextListener addResource 警告: Failed to register in JMX: javax.naming.NamingException: no resource regis tered with uniqueName 'jdbc/MYSQL', available resources: [] 2012-9-10 20:09:05 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: contextInitialized() 2012-9-10 20:09:05 org.apache.catalina.core.ApplicationContext log 信息: SessionListener: contextInitialized() 2012-9-10 20:09:05 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory ROOT 2012-9-10 20:09:05 org.apache.catalina.core.NamingContextListener addResource 警告: Failed to register in JMX: javax.naming.NamingException: no resource regis tered with uniqueName 'jdbc/MYSQL', available resources: [] 2012-9-10 20:09:05 org.apache.coyote.http11.Http11Protocol start 信息: Starting Coyote HTTP/1.1 on http-8080 2012-9-10 20:09:05 org.apache.jk.common.ChannelSocket init 信息: JK: ajp13 listening on /0.0.0.0:8009 2012-9-10 20:09:05 org.apache.jk.server.JkMain start 信息: Jk running ID=0 time=0/60 config=null 2012-9-10 20:09:05 org.apache.catalina.startup.Catalina start 信息: Server startup in 2234 ms
下面是我的tomcat配置:
btm-config.properties:
bitronix.tm.serverId=tomcat-btm-node0 bitronix.tm.journal.disk.logPart1Filename=${btm.root}/work/btm1.tlog bitronix.tm.journal.disk.logPart2Filename=${btm.root}/work/btm2.tlog bitronix.tm.resource.configuration=${btm.root}/conf/resources.properties
context.xml:
<?xml version='1.0' encoding='utf-8'?> <Context> <!-- Default set of monitored resources --> <WatchedResource>WEB-INF/web.xml</WatchedResource> <!-- about BTM --> <Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory" /> <Resource name="jdbc/MYSQL" auth="Container" type="javax.sql.DataSource" factory="bitronix.tm.resource.ResourceObjectFactory" className="bitronix.tm.resource.jdbc.lrc.LrcXADataSource" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/xxx" username="root" password="root" minPoolSize="0" maxPoolSize="5" uniqueName="jdbc/MYSQL"/> </Context>
server.xml:
<?xml version='1.0' encoding='utf-8'?> <Server port="8005" shutdown="SHUTDOWN"> <!--APR library loader. Documentation at /docs/apr.html --> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html --> <Listener className="org.apache.catalina.core.JasperListener" /> <!-- Prevent memory leaks due to use of particular java/javax APIs--> <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html --> <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <!-- about BTM--> <Listener className="bitronix.tm.integration.tomcat55.BTMLifecycleListener" /> <GlobalNamingResources> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <Service name="Catalina"> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> <Engine name="Catalina" defaultHost="localhost"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> </Host> </Engine> </Service> </Server>
tomcat下的jar包:
求解决,被这问题困扰很久了,看警告信息应该是context.xml没配对,但是我又没发现哪里错了
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
同样的问题,有解决方案吗?
请问你这个问题解决了没有?我现在用的tomcat6.0 遇到了同样的问题