I have this on the server:
class Person{...}
and
@Stateless
public class HelloServiceBean implements HelloServiceLocal, HelloServiceRemote {
public Person getPerson(String name) {
return new Person(name);
}
}
And I have this in my client (in some different JVMs):
public static void main(String[] a) throws Exception{
String name = "java2s";
HelloServiceRemote service = null;
service = (HelloServiceRemote)new InitialContext().lookup("HelloServiceBean/remote");
Person p = service.getPerson(name));
}
When I need to call, for example, the getPerson () method from my EJB, which returns an object of type Person, how will my client understand that Person is a class?
Do I have to re-write the Person class again in my client (as well as the HelloServiceRemote class) so that it can understand what Person is? Or do I need to include an Eyb project in my client project?
source
share