Over a million developers have joined DZone.

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

·

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.

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

        } catch (NamingException e) {
            System.out.println(e.getMessage());
        }
Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}