Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

connecting from client aplication server to ejb server aplication

  Asked By: Cory    Date: Sep 12    Category: Java    Views: 1334

connecting from client aplication server to ejb server aplication

the ip of my pc where i put server aplication and client aplication is : and i connect by
the name of my jar componen server is pos.jar
the name of my database is POSJ

now i make my client aplication(servlet+JSP) on

what is the code in order to connectiong client aplication from to server aplication on

here is one the code of my client aplication

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import javax.naming.*;
import java.util.*;
import com.pos.*;
import com.pos.customer.*;

public class SchedulerForShoppingCart extends HttpServlet {

protected void doGet(HttpServletRequest request, HttpServletResponse
throws ServletException, IOException {
try {
InitialContext ic = new InitialContext();
ShoppingListHome home = (ShoppingListHome)
ShoppingList remote = home.create();

// Hapus keranjang belanja yang tidak aktif selama dua jam.
// Metode berikut akan menghapus keranjang belanja.
catch (Exception e) {




2 Answers Found

Answer #1    Answered By: Raul Clark     Answered On: Sep 12

generally spoken to have two remote JAVA application communicating
together you have to use RMI/IIOP protocol (you might start with
tutorial at Sun site - http://java.sun.com/docs/books/tutorial/rmi/).
The RMI/IIOP communication happens as well in J2EE world, it is just
provided automatically by your application servers (if configured

So, I do believe that you either add an RMI code to your servlets and
you 'manually' connect to remote ejb  server, or you add your PC into
a cluster (using some administration tool of your application server)
with an EJB application server  and you modify the XML properties of
your client  and ejb applications, making the
application "distributed".

Answer #2    Answered By: Nixie Schmidt     Answered On: Sep 12

what is the meaning of distributed object?