Hello everyone,
I have been a long time member of tek-tips, but am fairly new to the J2EE forum.
I am trying to access a Java bean deployed using Sun Application server from outside the container (ie. an external client Java program). There are no jsp pages, just an application client and 1 bean (with home, object, and bean components) The code I am using is below, but it does not seem to work:
InitialContext initialContext = new InitialContext();
String url = "rmi://localhost";
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory"
p.put(Context.PROVIDER_URL, url);
ctx = new InitialContext(p);
// lookup InterestCalculator EJB
Object homeObject =
initialContext.lookup( "java:comp/env/ejb/InterestCalculator"
I was wondering if anybody has a solution to this problem or could provide me with some code.
thanks
Narjit
I have been a long time member of tek-tips, but am fairly new to the J2EE forum.
I am trying to access a Java bean deployed using Sun Application server from outside the container (ie. an external client Java program). There are no jsp pages, just an application client and 1 bean (with home, object, and bean components) The code I am using is below, but it does not seem to work:
InitialContext initialContext = new InitialContext();
String url = "rmi://localhost";
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory"
p.put(Context.PROVIDER_URL, url);
ctx = new InitialContext(p);
// lookup InterestCalculator EJB
Object homeObject =
initialContext.lookup( "java:comp/env/ejb/InterestCalculator"
I was wondering if anybody has a solution to this problem or could provide me with some code.
thanks
Narjit