I am working an enterprise application and built EAR file which contains WAR and ejb jar file and SOAP web services. I am successfully able to deploy the application without any startup errors and published the web services and I can access the wsdl file and make a web service call from SOAP UI. The web service makes a call to some Manager class which does an EJB look up to find session bean which is failing with exception javax.naming.NameNotFoundException: Name com.chubb.dgmk.dus.client.DigitalUserServiceLocal not found in context "ejblocal:".
My session ejb is marked as @Stateless and local interface with @Local annotations. But when I look at my application in admin console, I don't see any EJB's that are deployed. There is no "EJB References" link present under References section as shown in the below diagram. As I am not getting any deployment errors, I don't have any clue about what went wrong.
try {
context = new InitialContext();
Object obj = context.lookup("ejblocal:com.chubb.dgmk.dus.client.DigitalUserServiceLocal");
dusService = (IDigitalUserService)obj;
} catch (NamingException e) {
}
It is because of not specifying the dependent jars in the MANIFEST file of EJB project. After adding all those jars in the MANIFEST files, I am able to successfully load and lookup the EJBs.