Hi,

I've noticed that UserTransaction does not seem to work without JVM-wide jndi 
configuration. For example, the following code

<code>
Hashtable env = new Hashtable();
env.put("java.naming.factory.initial", 
        "org.jnp.interfaces.NamingContextFactory");
env.put("java.naming.provider.url", "jnp://localhost:1099");
env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
env.put("jnp.disableDiscovery", "true");
Context ctx = new InitialContext(env);
UserTransaction utx = (UserTransaction) ctx.lookup("UserTransaction"); 
utx.begin(); // <= exception is here!
</code>

throws

<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)
</exception>

but works if JNDI is configured using jndi.properties. This behaviour makes user 
transactions unusable if a client runs inside managed environment (like standalone 
servlet container) that provides its own JNDI. JBoss 3.2, as of Friday noon. I had a 
quick look, and the problem seems to be due to "new InitialContext()" in 
ClientUserTransaction at around line 278. Is it a bug or a feature?

Igor Fedorenko
Think smart. Think automated. Think Dynamics. 
www.thinkdynamics.com 


-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to