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", "");
        props.setProperty("org.omg.CORBA.ORBInitialPort", "8080");
            InitialContext init = new InitialContext(props);
            ticketBean = (IZASTickets) init.lookup(IZASTickets.class.getName());

        } catch (NamingException e) {

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

{{ parent.tldr }}

{{ parent.urlSource.name }}