• Post Reply Bookmark Topic Watch Topic
  • New Topic

UserTransaction

 
Nuno Martins
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is it possible to set jndi properties from Properties objects, or must be given a jndi.properties file?
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");
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!