1 Reply Latest reply on Sep 17, 2003 7:21 AM by nmartins

    UserTransaction

    nmartins

      Hi,

      Is it possible to set jndi properties from Properties objects, or must be given a jndi.properties file?

      ctx = new InitialContext(p);
      ut = (UserTransaction) ctx.lookup("UserTransaction");

      I'am asking this because if with the first possibility, I get this
      exception

      javax.transaction.SystemException: java.lang.RuntimeException: UT factory lookup failed: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
      at org.jboss.tm.usertx.client.ClientUserTransaction.begin(ClientUserTransaction.java:107)

      I can't define jndi properties in jvm.

      Any ideias?

      Thanks.

        • 1. Re: UserTransaction
          nmartins

          Hi,

          Here are the jndi properties that I set.

          p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); p.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); p.put(javax.naming.Context.PROVIDER_URL,"jnp://localhost:1099");

          Thanks.