aspose file tools*
The moose likes JBoss/WildFly and the fly likes  xa datasource binding problem in jboss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark " xa datasource binding problem in jboss" Watch " xa datasource binding problem in jboss" New topic
Author

xa datasource binding problem in jboss

adi reddy
Greenhorn

Joined: Apr 24, 2012
Posts: 8
i have a XA data source configuration as follows:

when i am running my application , while getting connection by using the jndi name , i am getting the following exception :

12:29:27,125 ERROR [STDERR] javax.naming.NameNotFoundException: ABC not bound
12:29:27,125 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
12:29:27,125 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
12:29:27,125 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
12:29:27,125 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
12:29:27,125 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
12:29:27,125 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
12:29:27,125 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
12:29:27,125 ERROR [STDERR] at javax.naming.InitialContext.lookup(Unknown Source)
---------
-----

is there any thing wrong!
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

Welcome to the Ranch Adi, i am moving this thread to a forum where the jboss people hang out
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10266
    
168

Where are you looking up the datasource from? Is it a remote standalone application or is it an application within the same server instance? What does the code look like?


[My Blog] [JavaRanch Journal]
adi reddy
Greenhorn

Joined: Apr 24, 2012
Posts: 8
sorry for late reply

i am looking the name in IntialContext!

the code is as follows

try {
Context cxt = new InitialContext();
DataSource ds = (DataSource) cxt.lookup("jdbc/ABC/API");
} catch (NamingException e) {
e.printStackTrace();
}
adi reddy
Greenhorn

Joined: Apr 24, 2012
Posts: 8
i got the solution

The following is the solution:

try {
Context cxt = new InitialContext();
DataSource ds = (DataSource) cxt.lookup("java:jdbc/ABC/API");
} catch (NamingException e) {
e.printStackTrace();
}
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

Glad you got it solved in the end
 
 
subject: xa datasource binding problem in jboss