You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gerard Biemolt <gb...@gmail.com> on 2007/09/07 12:13:43 UTC

tomcat usertransation

Hi All,

I'm currently trying to create a transaction between a standalone
application and a web service. By starting a usertransaction in
the standalone app and bridging it to/with the web service.
However I'm unable to get use a transaction in the web service.
I took these steps:

- published a transactional webservice with apache axis on tomcat 5.5
- added to /conf/server.xml
  <Transaction name="UserTransaction" factory="
com.arjuna.mw.wst.UserTransacti onFactory "/>
- added to /conf/context.xml
   <ResourceLink name="UserTransaction" global="UserTransaction" type="
com.arjuna.mw.wst.UserTransactionFactory"/>
- added the following lines to the code:
            InitialContext ctx = new InitialContext();
            ut = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
which gives the javax.naming.NameNotFoundException: Name UserTransaction is
not bound in this Context

Am I missing some xml-statements somewhere?

thanks in advance,

Gerard

Re: tomcat usertransation

Posted by David Smith <dn...@cornell.edu>.
Disclaimer: I don't know any more about this than what's in the tomcat docs.

Have you tried to specify the <Transaction ... /> element in your 
webapp's context.xml (not the one in conf/context.xml or conf/server.xml)? 

Also, it appears the only valid attribute of the <Transaction ... /> 
element is the factory attribute.  I'm assuming all other attributes are 
passed in to setters on the factory class.  Lastly, when you do 
reintroduce the ResourceLink, it should probably be declared of type 
UserTransaction since that's what I understand the factory method is 
supposed to spit out.

I would try the simplest possible case first and then work from there.  
Hope this gives you some fuel for thought.

--David

Gerard Biemolt wrote:

>Hi All,
>
>I'm currently trying to create a transaction between a standalone
>application and a web service. By starting a usertransaction in
>the standalone app and bridging it to/with the web service.
>However I'm unable to get use a transaction in the web service.
>I took these steps:
>
>- published a transactional webservice with apache axis on tomcat 5.5
>- added to /conf/server.xml
>  <Transaction name="UserTransaction" factory="
>com.arjuna.mw.wst.UserTransacti onFactory "/>
>- added to /conf/context.xml
>   <ResourceLink name="UserTransaction" global="UserTransaction" type="
>com.arjuna.mw.wst.UserTransactionFactory"/>
>- added the following lines to the code:
>            InitialContext ctx = new InitialContext();
>            ut = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
>which gives the javax.naming.NameNotFoundException: Name UserTransaction is
>not bound in this Context
>
>Am I missing some xml-statements somewhere?
>
>thanks in advance,
>
>Gerard
>
>  
>


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


Re: tomcat usertransation

Posted by Gerard Biemolt <gb...@gmail.com>.
sorry if i'm acting offending, but i just wanted it to be on the agenda
a second time, it's not that there's a lot of information on this subject
and i'm on a extremely tight schedule. anyway, i will not post this
message again.

best regards

On 07/09/2007, Mark Thomas <ma...@apache.org> wrote:
>
> http://tomcat.apache.org/faq/tomcatuser.html#why
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: tomcat usertransation

Posted by Mark Thomas <ma...@apache.org>.
http://tomcat.apache.org/faq/tomcatuser.html#why


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


Re: tomcat usertransation

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
Gerard Biemolt wrote:
> Hi All,
>
> I'm currently trying to create a transaction between a standalone
> application and a web service. By starting a usertransaction in
> the standalone app and bridging it to/with the web service.
> However I'm unable to get use a transaction in the web service.
> I took these steps:
>
> - published a transactional webservice with apache axis on tomcat 5.5
> - added to /conf/server.xml
>   <Transaction name="UserTransaction" factory="
> com.arjuna.mw.wst.UserTransacti onFactory "/>
>   
factory attribute has added spaces to it
shouldn't you define <Resource> not <Transaction>
> - added to /conf/context.xml
>    <ResourceLink name="UserTransaction" global="UserTransaction" type="
> com.arjuna.mw.wst.UserTransactionFactory"/>
> - added the following lines to the code:
>             InitialContext ctx = new InitialContext();
>             ut = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
> which gives the javax.naming.NameNotFoundException: Name UserTransaction is
>   
java:comp/env/UserTransaction would be the correct place,

Filip
> not bound in this Context
>
> Am I missing some xml-statements somewhere?
>
> thanks in advance,
>
> Gerard
>
>   
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.485 / Virus Database: 269.13.8/993 - Release Date: 9/6/2007 3:18 PM
>   


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