简体   繁体   中英

WebSphere v7.0 is not deploying EJB

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) {
        }

在此处输入图片说明

在此处输入图片说明

You don't see references, as there is no reference defined in your web module where you have service. You would need to have ejb-local-ref entry in the web.xml or @EJB annotation.

Regarding your ejblocal: lookup, it should work. Verify in the SystemOut.log , what are the bindings under which the DigitalUserService is bound. Maybe you have ibm-ejb-jar-bnd.xml file, which overrides the default bindings.

You should also be able to see EJB JNDI names on that page, in the Enterprise Java Beans Properties section. If you don't, then looks like your EJB is not detected.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM