[jboss-user] [JCA/JBoss] - look up datasource failing~

tntxia do-not-reply at jboss.com
Tue Oct 24 07:39:09 EDT 2006


I deploy my application ear in jboss-4.0.4.CR2;
flow is jboss console:

8:27:45,218 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-local-jdbc.rar
18:27:45,500 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
18:27:47,156 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
18:27:47,625 INFO  [A] Bound to JNDI name: queue/A
18:27:47,625 INFO  [B] Bound to JNDI name: queue/B
18:27:47,625 INFO  [C] Bound to JNDI name: queue/C

This is my client class :

	 InitialContext context;
	try {
		context = new InitialContext();
		Object obj = context.lookup("java:/DefaultDS");			
		} catch (NamingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

When I run the class ;throw the exception :

javax.naming.NameNotFoundException: DefaultDS not bound
	at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
	at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
	at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
	at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
	at javax.naming.InitialContext.lookup(InitialContext.java:351)
	at com.netsboss.btoss.logic.traceInfo.test.Test.main(Test.java:22)

How can I write the jndi name  for datasource in client class ?ths


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980333#3980333

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980333



More information about the jboss-user mailing list