Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. package javaapplication1;
  2.  
  3. import javax.naming.InitialContext;
  4. import javax.naming.NamingException;
  5.  
  6. import myejb.MyBeanRemote;
  7.  
  8.  
  9. public class MyClient {
  10. public static void main(String[] args) {
  11. try {
  12.  
  13. InitialContext ctx = new InitialContext();
  14.  
  15. MyBeanRemote bean = (MyBeanRemote) ctx.lookup("java:global/EJB_project/EJB_project-ejb/MyBean");
  16.  
  17.  
  18. bean.doHelloWorld();
  19.  
  20. bean.doSomething();
  21.  
  22. } catch (NamingException e) {
  23. e.printStackTrace();
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement