[jboss-user] [Beginners Corner] - Can't get Datasource outside container (4.2)

viniciuscarvalho do-not-reply at jboss.com
Fri Aug 31 17:25:16 EDT 2007


Hello there! This is a very dumb question, I know. But it's friday, past 6pm, and its annoying me a lot.

I'm running some junit tests, and I'm not being able to get the datasource from the jndi. It's deployed. My SLSBs do have access on them (through entity manager) but on the unit test it says its not bound. What's odd, is that if I look for anything else (ConnectionFactory, Queue, Topic, Remote interfaces) it locates, but no datasource at all. Here's a snippet:

  | InitialContext ctx = new InitialContext();
  | 		Queue q = (Queue)ctx.lookup("java:/queue/A"); //found
  | 		ConnectionFactory qf = (ConnectionFactory)ctx.lookup("java:/ConnectionFactory");//found
  |                 SomeEJB ejb = (SomeEJB)ctx.lookup("SomeEJB/remote");//found
  | 		DataSource ds = (DataSource)ctx.lookup("java:mysqlDS");//not bound
  | 

I've double checked the jndi name on the jmx-console and it's bound to java:mysqlDS.

Any ideas of why I just can't find the datasource object?

Regards

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

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



More information about the jboss-user mailing list