3 messages in com.mysql.lists.javaTomcat MySQL XA support| From | Sent On | Attachments |
|---|---|---|
| Jack Wang | 08 Feb 2006 00:56 | |
| Christopher G. Stach II | 08 Feb 2006 07:50 | |
| Jack Wang | 12 Feb 2006 20:44 |
| Subject: | Tomcat MySQL XA support![]() |
|---|---|
| From: | Jack Wang (pipa...@yahoo.com) |
| Date: | 02/08/2006 12:56:28 AM |
| List: | com.mysql.lists.java |
I can get connect from Resource configured in tomcat with
type="javax.sql.DataSource". But the
project needs the XADataSource, so I configure the XADataSource in tomcat's
server.xml with
following:
--------------------- <Resource name="jdbc/myXADB" auth="Container" type="javax.sql.XADataSource" factory="org.objectweb.jndi.DataSourceFactory" driverClassName="com.mysql.jdbc.Driver" username="root" password="123456" url="jdbc:mysql://192.168.1.2/test" />
---------------------
But this can't work, I only get a null xaDs, so can not get the XAConnection.
The java code in the
web application to get the XADataSource is:
--------------------- Context ctx = new InitialContext(); XADataSource xaDs = (XADataSource)ctx.lookup("java:comp/env/jdbc/myXADB"); // Here get the null xaDs, Oops !!
---------------------
My environment is : JDK 1.5 Tomcat 5.5 MySQL 5.1 Connector/J 5.0
Please ask where is the wrong ? Thanks.
Wang Jun
__________________________________________________ 赶快注册雅虎超大容量免费邮箱? http://cn.mail.yahoo.com




