In my web application i used ejb which is present in lib folder of my project as a jar and the ejb classes and interfaces are not annotationed based now i dont know how to call that ejb class from my application by through jndi name, i am deploying my application as a war file and using jboss 7 EAP server, and I can not change the ejb classes to annotation based also as it is a existing application.Please help how to achieve this.
web.xml :-
<ejb-ref>
<ejb-ref-name>local/com/BusinessService</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.common.ejb.service.BusinessServiceLocalHome</home>
<remote>com.common.ejb.service.BusinessServiceLocal</remote>
<ejb-link>BusinessService.jar#BusinessService</ejb-link>
</ejb-ref>
in my java file i am accessing like below:-
javax.naming.Context ic = new javax.naming.InitialContext();
initCtx.lookup("java:comp/env/local/com/BusinessService");
but always i am getting javax.naming.NameNotFoundException : local/com/BusinessService
ejb-jar.xml: which is is meta-inf folder of businesservice.jar
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar id="ejb-jar_ID">
<display-name>BusinessService</display-name>
<enterprise-beans>
<session id="BusinessService">
<ejb-name>BusinessService</ejb-name>
<home>com.common.ejb.service.BusinessServiceHome</home>
<remote>com.common.ejb.service.BusinessService</remote>
<local-home>com.common.ejb.service.BusinessServiceLocalHome</local-home>
<local>com.common.ejb.service.BusinessServiceLocal</local>
<ejb-class>com.common.ejb.service.BusinessServiceBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>BusinessService</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
--->and also when i am adding <local-home> tag in web.xml its showing error. so i removed the tag
i tried with lots of alternative like ejb/local/com/BusinessService but i am facing same issue please help ....
Note:- I am using jboss EAP Server
BusinessService
to your question – Steve C