[jboss-user] [EJB 3.0] - Re: lookup datasource from ejb3 sessionbean (jboss 4.2.3)

woongiap do-not-reply at jboss.com
Sun Oct 19 23:58:07 EDT 2008


yes that's exacty the piece of code that i tried. i think something's wrong with my configuration, i can't even lookup environment entry:

(ejb-jar.xml)
<env-entry>
  the ds jndi
  <env-entry-name>ds_jndi</env-entry-name>
  <env-entry-type>java.lang.String</env-entry-type>
  <env-entry-value>java:/tims</env-entry-value>
</env-entry>

(in code)
InitialContext ic = new InitialContext();
Context envCtx = (Context) ic.lookup("java:comp/env");
String name = (String) envCtx.lookup("ds_jndi");
System.out.println("    ** jndi="+name);

this cause error with exception "name ds_jndi not found". any clue what might be the problem? ejb3 on jboss 4.2.3? my configuration?

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

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



More information about the jboss-user mailing list