You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dasarath Weeratunge <da...@yahoo.com> on 2004/06/14 06:02:55 UTC
Integrating Tomcat, JOTM and Axis
Hi,
I'm trying to use Tomcat (4.1.24), JOTM (1.4.3) and
Axis (1.1). I'm using the following axis.xml in
%tomcat_home%\webapps. However, when I try to lookup
"java:comp/UserTransaction" within a web service it
fails and the JDBC DataSource doesn't work either. I
followed the "How to use JDBC and transactions in
Tomcat with JOTM" and the same SQL server database
(given below) and JOTM **works well** for that
example(jsp). Is this not applicable to web services?
Thanks
Dasarath
axis.xml in %tomcat_home%\webapps
----------------------------------
<Context path="/axis" docBase="axis" debug="0"
reloadable="true" crossContext="true">
<Resource name="jdbc/test" auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/test">
<parameter>
<name>factory</name>
<value>org.objectweb.jndi.DataSourceFactory</value>
</parameter>
<parameter><name>username</name><value>sa</value></parameter>
<parameter><name>password</name><value>admin</value></parameter>
<parameter><name>driverClassName</name>
<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value></parameter>
<parameter><name>url</name>
<value>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=test;SelectMethod=cursor</value></parameter>
</ResourceParams>
<Resource name="UserTransaction" auth="Container"
type="javax.transaction.UserTransaction"/>
<ResourceParams name="UserTransaction">
<parameter>
<name>factory</name>
<value>org.objectweb.jotm.UserTransactionFactory</value>
</parameter>
<parameter>
<name>jotm.timeout</name>
<value>60</value>
</parameter>
</ResourceParams>
</Context>
added to web.xml
%tomcat_home%\webapps\axis\WEB-INF\web.xml
--------------------------------------
<resource-env-ref>
<resource-env-ref-name>jdbc/test</resource-env-ref-name>
<resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
</resource-env-ref>
lookup code used in the web service
-------------------------------------------
new
InitialContext().lookup("java:comp/UserTransaction");
initCtx.lookup("java:comp/env/jdbc/test");
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org