try using this instead
UserTransaction transaction = (UserTransaction)ctx.lookup("UserTransaction");
Since this forum is for EJB design I would like
to point out that, in general, it is considered
bad practice to propagate a transaction that
starts in an application client.
Under most situations it is better to call a
method on a stateless session bean which starts
the transaction. This prevents a client from
starting a transaction and say walking away to
get a cup of coffee or go to lunch and lock
resources (transactional isolation).
This may be what you want. Just saying this
is not something you should normally do.
Just my thoughs.