How do i access EJB implementing remote interface in separate web application?
Posted
by Nitesh Panchal
on Stack Overflow
See other posts from Stack Overflow
or by Nitesh Panchal
Published on 2010-03-10T14:31:00Z
Indexed on
2010/03/12
22:57 UTC
Read the original article
Hit count: 244
Hello,
I am using Netbeans 6.8 and Glassfish v3.0.
I created an ejb module and created entity classes from database and then created stateless session bean with remote interface. Say eg.
@Remote
public interface customerRemote{
public void add(String name, String address);
public Customer find(Integer id);
}
@Stateless
public class customerBean implements customerRemote{
//implementations of methods
}
Then i created a new web application. But now how do i access remote ejb's in my web application. I could lookup a bean with jndi name but what i want to know is, what type of object it will return? How do i typecast it in customerRemote? I don't have any class named customerRemote in my web application. So, how do i do it? Also, what about the entity class Customer? There is no such class named Customer in my web application also. All ejb's and entity classes are in separate ejb module. Please help me :(
© Stack Overflow or respective owner