1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
package client_test;
import java.rmi.RemoteException;
import interfaces.InterfaceBean;
import javax.ejb.CreateException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class Client_test {
public static void main(String[] args) throws RemoteException, CreateException {
try {
Context context = new InitialContext();
InterfaceBean beanRemote = (InterfaceBean)context.lookup("Server/Bean/remote");
System.out.println(beanRemote.message("Mon ejb 3 me renvoit le message"));
} catch (NamingException e) {
e.printStackTrace();
}
}
} |
Partager