i'm new in EJB3 technology and i have difficulties to call an Ejb Session from my Projetct1.EAR. My Ejb Session is defined in Projet2.EAR (EJB3 projet), and my IHM is in Project1.EAR (simple Java EE project), in the same server(WAS7).
1) Project2.EAR
package com.myejb;
@Local
public interface CustomerTask{
public Customer find(int number);
}
package com.myejb;
@Stateless
public class CustomerTaskImpl implements CustomerTask{
@PersistenceContext(name="my_persistenceunit")
EntityManager em;
public Customer find(int number){....}
}
2) Project1.EAR
public static void main(String[] args){
InitialContext ic = new InitialContext();
CustomerTask customerTask= (CustomerTask) ic.lookup("");
}
Anyone know the right way to call this EJB in my main function please? Thank you very much