Hi,
I try to use the transactionmanagement from client like the manual says :
InitialContext ctx = new InitialContext();
| tx = (UserTransaction) ctx.lookup("UserTransaction");
| tx.begin();
| ...
That works realy fine. But when I am connected to an user defined provider
java.util.Hashtable env = new java.util.Hashtable();
| env.put( Context.PROVIDER_URL, "myserver:1199");
| InitialContext ctx = new InitialContext(env);
| tx = (UserTransaction) ctx.lookup("UserTransaction");
it fails (at lookup) with following exception:
| javax.naming.CommunicationException: Failed to connect to server
mydefaultserver:1099 [Root exception is
javax.naming.ServiceUnavailableException: Failed to connect to server
172.30.1.22:1099 [Root exception is java.net.ConnectException: Connection timed
out: connect]]
|
| at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:213)
|
| at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1187)
| ...
|
Is there any solution for this problem ?
I think the problem is in
org.jboss.tm.usertx.client.ClientUserTransactionObjectFactory:
static private UserTransaction getUserTransaction()
| {
| if (userTransaction == null) {
| // See if we have a local TM
| try {
| new InitialContext().lookup("java:/TransactionManager");
|
| // We execute in the server.
| userTransaction = ServerVMClientUserTransaction.getSingleton();
| } catch (NamingException ex) {
| // We execute in a stand-alone client.
| userTransaction = ClientUserTransaction.getSingleton();
| }
| }
| return userTransaction;
| }
because a new InitialContext will be created.
TIA
Dirk
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3860733#3860733
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3860733
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user