DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Eli has posted 1 posts at DZone. View Full User Profile

Connection the Client Application to the EJB's on the server

  • submit to reddit
IZASTickets ticketBean = null;
    public ListDemo() {
        super(new BorderLayout());
        try {
            Properties props = new Properties();
        props.setProperty("org.omg.CORBA.ORBInitialHost", "");
        props.setProperty("org.omg.CORBA.ORBInitialPort", "8080");
            InitialContext init = new InitialContext(props);
            ticketBean = (IZASTickets) init.lookup(IZASTickets.class.getName());

        } catch (NamingException e) {

I have developed an EJB(with a remote interface and a session bean) and an client application that will connect to the EJBs.

The EJB's will be deployed on the server and the client application will be installed on different machines.

I am having difficulties in writing the code that will allow the application client to locate the EJB's on the server.  Anyone with an idea of how i can do this.