tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Wang <pipa...@yahoo.com>
Subject Null XADataSource of Mysql from InitialContext in Tomcat
Date Thu, 09 Feb 2006 13:47:06 GMT
I have send this mail to another mail list, but have no reply yet.  I have wasted much time
in
this problem, please help.

Does MySQL5.0.18 suport XA in Tomcat 5.5 ? I do a XA test in tomcat with only one jsp file
and
necessary jars. The jsp is as:

---------------------------------------------
<%
Context ctx = new InitialContext();
com.mysql.jdbc.jdbc2.optional.MysqlXADataSource xads = new
com.mysql.jdbc.jdbc2.optional.MysqlXADataSource();
xads.setServerName("localhost");
xads.setDatabaseName("test");
xads.setPortNumber(3306);
XAConnection xcon = xads.getXAConnection("root","password");
Connection con = xcon.getConnection();

System.out.println("I get the correct xads and the con=" + con);
System.out.println("Bind xads to InitialContext");

ctx.bind("myXADB", xads);
MysqlXADataSource mysqlXADataSource = (MysqlXADataSource)ctx.lookup("myXADB");

System.out.println("Get the null MysqlXADataSource from ctx xads=" + mysqlXADataSource );
%>
---------------------------------------------

 Why I can only get a null mysqlXADataSource from the InitialContext ?

 Is this why I can not configure the XADataSource in tomcat ?



 Thanks.


Wang Jun


		
____________________________________________________


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message