From user-return-2152-apmail-geronimo-user-archive=geronimo.apache.org@geronimo.apache.org Thu Feb 09 06:44:38 2006 Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 54854 invoked from network); 9 Feb 2006 06:44:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Feb 2006 06:44:25 -0000 Received: (qmail 69165 invoked by uid 500); 9 Feb 2006 06:44:10 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 69121 invoked by uid 500); 9 Feb 2006 06:44:10 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 69102 invoked by uid 99); 9 Feb 2006 06:44:10 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2006 22:44:10 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [202.43.216.206] (HELO web15403.mail.cnb.yahoo.com) (202.43.216.206) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 08 Feb 2006 22:44:09 -0800 Received: (qmail 90209 invoked by uid 60001); 9 Feb 2006 06:43:42 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=yBqzakOFh4dtS5cy6r6O/dbdvVen2FJzT18Kd8wQv3kOTeFTQ4JS5oB1Rb9W4c4cz9c6dTMbpdti1E9mvpZfK7WSr+XSHN7YfzQNpcc7Bxu9zipIfDJlPUsvv4t3A1r211aY/NbwqUnIF5agKYQxV3nPL82WcibHb63cJw9SBBI= ; Message-ID: <20060209064342.90207.qmail@web15403.mail.cnb.yahoo.com> Received: from [218.90.165.188] by web15403.mail.cnb.yahoo.com via HTTP; Thu, 09 Feb 2006 14:43:37 CST Date: Thu, 9 Feb 2006 14:43:37 +0800 (CST) From: Jack Wang Subject: Re: Tomcat MySQL XA support To: user@geronimo.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --- lichtner дµÀ: > > Anything in any logs? Maybe something is failing and this is a side > effect? > There is no error message in logs. The web application is started normally. But the xaDs from "XADataSource xaDs = (XADataSource)ctx.lookup("java:comp/env/jdbc/myXADB");" is null ! Maybe "mysql 5.0.18 + Connector/J + tomcat 5" can not support XA ? > On Thu, 9 Feb 2006, Jack Wang wrote: > > > --- lichtner дµÀ: > > > > > > Is it possible that the data source also has to be listed in your web.xml? > > > > > > > Yes, I have resource-ref defined in web.xml. But the XADataSource is null, why ? > > > > > > > > jdbc/myXADB > > javax.sql.XADataSource > > Container > > Shareable > > > > > > > > > > > On Thu, 9 Feb 2006, Jack Wang wrote: > > > > --- "Christopher G. Stach II" дµÀ: > > > > > Jack Wang wrote: > > > > > > 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 > > > > > You need to use mysql-connector-java-5.0.0-beta's > > > > > com.mysql.jdbc.jdbc2.optional.MysqlXADataSource with a MySQL 5.0 server, > > > > > or the far less desirable XAPool for fake XA. > > > > > > > > > > > > > --- "Christopher G. Stach II" дµÀ: > > > > > You need to use mysql-connector-java-5.0.0-beta's > > > > > com.mysql.jdbc.jdbc2.optional.MysqlXADataSource with a MySQL 5.0 server, > > > > > or the far less desirable XAPool for fake XA. > > > > > > > > > > > > > I have used mysql-connector-java-5.0.0-beta, but I still have the null XADataSource xaDs > from > > > the > > > > java action. > > > > Here is the server.xml in tomcat: > > > > > > > > ------------------------------------------------- > > > > > > > type="javax.sql.XADataSource" > > > > factory="com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory" > > > > driverClassName="com.mysql.jdbc.Driver" > > > > user="root" > > > > password="password" > > > > url="jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=gbk" > > > > /> > > > > ------------------------------------------------- > > > > > > > > And the is my action: > > > > > > > > ------------------------------------------------- > > > > 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.0.18-win32 > > > > Connector/J 5.0 beta > > > > > > > > I have checked mysql-connector-java-5.0.0-beta changes. The 11-04-05 - Version 5.0.0-beta > > > > - XADataSource implemented (ported from 3.2 branch which won't be > > > > released as a product). > > > > Use "com.mysql.jdbc.jdbc2.optional.MysqlXADataSource" as your datasource > > > > class name in your application server to utilize XA transactions > > > > in MySQL-5.0.10 and newer. > > > > > > > > So, what's the wrong ? Please help. Thanks. > > > > > > > > > > > > Wang Jun > > > > > > > > ____________________________________________________ > > > > > Wang Jun ____________________________________________________