[jboss-user] [JNDI/Naming/Network] - Looking up ejb on jboss 4.0

defkewl do-not-reply at jboss.com
Thu Oct 12 00:04:40 EDT 2006


Dear all,

How do I lookup for an EJB on Jboss 4.0?

This is the code I write:


  | InitialContext ctx=new InitialContext();
  | 			Context ref=(Context)ctx.lookup("java:comp/env/ejb");
  | 			
  | 			DepartmentHome home=(DepartmentHome)ref.lookup("DepartmentHome");
  | 			Department ejb=home.create();
  | 			
  | 			System.out.println(ejb.getName());
  | 

This is my JNDI_NAME and COMP_NAME:
anonymous wrote :    public static final String COMP_NAME="java:comp/env/ejb/Department";
  |    public static final String JNDI_NAME="Department";

Thanks in advance.

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

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



More information about the jboss-user mailing list