0 Replies Latest reply on May 31, 2005 11:07 AM by marcus spiegel

    Unable to get a valid UserTransaction

    marcus spiegel Newbie

      I want to get a UserTransaction (not in a session bean) doing
      as follows:

      InitialContext context = null;
      Hashtable props = new Hashtable();
      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      try {
       context = new InitialContext(props);
      } catch (NamingException e) {
       // throw exception
      UserTransaction utx = (UserTransaction)context.lookup("UserTransaction");

      After the lookup I get back in utx an ServerVMClientUserTransaction object, but with TransactionManager tm=null and the Collection listeners = empty ArrayList, if I check in the debugger. Any operation on the object result in errors and consequently the UserTransaction is useless...

      What am I doing wrong? Why isn't the TransactionManager injected into the returned UserTransaction?

      Any hints and help welcome! ;-)