Hi Christophe,

I also face the same problem as you. I'm also using Tomcat 4.0.1. I tried
your 1st way, ic.lookup("java:comp/env/jta/UserTransaction"), but got the
same error as you. Then I try your 4th way,
ic.lookup("java:comp/UserTransaction"), and get something different from
you. I got the error:

Tue Dec 11 20:08:04 CST 2001 [Tyrex] Failed to locate messages resource
tyrex.util.resources.messages

But I didn't get the error java.lang.NoClassDefFoundError.
BTW, is the tyrex-0.9.7.0.jar inside your common\lib directory? This may
help you to solve the NoClassDefFoundError.

Regards,
Roy

-----Original Message-----
From: christophe marcourt [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 11, 2001 4:06 PM
To: [EMAIL PROTECTED]
Subject: UserTransaction and tomcat 4.0.1


Hi,

I've got a serious problem with the UserTransaction.
I've just done what the "how-to" tells for the JNDI, the fact is that for
JDBC it's working on a standalone server.
But for UserTransaction still nothing.

My web.xml code :
<resource-ref>
<res-ref-name>jta/UserTransaction</res-ref-name>
<res-type>javax.transaction.UserTransaction</res-type>
<res-auth>Container</res-auth>
</resource-ref>

My server.xml code :
<Resource name="jta/UserTransaction" auth="Container"
type="javax.transaction.UserTransaction"/>

I've tried several code for my servlet :
1) logical one
ic = new InitialContext();
ut = (UserTransaction) ic.lookup("java:comp/env/jta/UserTransaction");
sos.println("transaction : " + ut.getStatus());

=> result : cannot create instance resource !!!!

2) less logical
ic = new InitialContext();
ut = (UserTransaction) ic.lookup("java:comp/env/UserTransaction");
sos.println("transaction : " + ut.getStatus());

=> result : cannot find UserTransaction in JNDI...
it's normal

3) stupid one
ic = new InitialContext();
ut = (UserTransaction) ic.lookup("java:comp/jta/UserTransaction");
sos.println("transaction : " + ut.getStatus());

=> result : 
java.lang.NoClassDefFoundError at
org.apache.naming.factory.TyrexTransactionFactory.getObjectInstance(TyrexTra
nsa ctionFactory.java:120)

4) the worth
ic = new InitialContext();
ut = (UserTransaction) ic.lookup("java:comp/UserTransaction");
sos.println("transaction : " + ut.getStatus());

=> result :
java.lang.NoClassDefFoundError at
org.apache.naming.factory.TyrexTransactionFactory.getObjectInstance(TyrexTra
nsa ctionFactory.java:120)

what can I try else ???

thanks to help me.

Christophe 

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to