You usually inject the EJB references in your Web components or another EJBs using annotations. While doing that you can specify the desired JNDI name if you want to look it up in Bean's Environmental Naming Context (ENC). If not provided then there are certain rules as in how the injected EJB will be bound in the JNDI Tree.
Apart from this App. Server specific JNDI name also exists which can be used in annotation attributes. The annotation to look for is @EJB.
i am using weblogic 10.3 as the application server!! i went through the jndi tree in weblogic...if i use the name mentioned as 'binding name' in weblogic jndi tree(Environments->Servers->Admin Server->view jndi tree) it gives 'ClassNotFound Exception'..... am i right in locating the default jndi name in the place i mentioned??....if not what is the format of default jndi name in weblogic 10.3?
I am not sure abt how do you specify the JNDI name in weblogic 10.3. But you should be able to do that in the weblogic-ejb.xml ( I think this was the filename where we used to configure WLS specific parameters.).
Apart from this we dont know your scenario for accessing the EJB so merely specifying ClassNotFoundException will not help us to resolve the issue. You will need to elaborate more on this.
private static CalculatorBean helloWorld;
public static void main(String args)
Hashtable<String, String> env = new Hashtable<String, String>();
Context ctx = new InitialContext(env);
System.out.println("Initial Context created");
helloWorld = (CalculatorBean) ctx.lookup("TestSessionBean");
System.out.println("Calling EJB method . . .");
System.out.println("Output will be in Managed server console");
catch (Exception e)
as i am writing ejb3.0 we do not need the deployment descriptors(ejb-jar.xml,weblogic-ejb-jar.xmal etc.).
in the above files how should i give the jndi name and what is the format of default jndi name for weblogic 10.3?
weblogic-ejb-jar.xml is used in EJB 2.0 that i know ! but EJB 3.0 is deployment descriptors light (what i hav read from web sites)....in JBOSS and other servers we have a defined format for default jndi names but i am unable to figure it out in weblogic 10.3???
AFAIK you need to fallback on the server specific Deployment Desc. file to specify global JNDI name. You shall not be able to put that in your EJB code. If you do that then your EJB cannot be portable.