Advertisement
Guest User

main-method

a guest
Jun 9th, 2014
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. package ubueng1a;
  2.  
  3. import java.util.*;
  4. import javax.ejb.EJB;
  5. import javax.naming.*;
  6. import pack1.NeueSessionBeanRemote;
  7.  
  8. public class Ubueng1a {
  9.  
  10.     @EJB
  11.     protected static NeueSessionBeanRemote hw;
  12.  
  13.     public static void main(String[] args) {
  14.         // TODO code application logic here
  15.         try {
  16.             Properties prop = new Properties();
  17.             prop.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
  18.             InitialContext ic = new InitialContext(prop);
  19.             hw = (NeueSessionBeanRemote) ic.lookup("pack1.NeueSessionBeanRemote");
  20.             System.out.println("Result: " + hw.addiere(5, 6));
  21.  
  22.         } catch (Exception e) {
  23.             e.printStackTrace();
  24.         }
  25.     }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement