geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From axiez <>
Subject Re: ejb client
Date Mon, 29 Dec 2008 06:57:27 GMT

I added Modified code is given below:
Properties p = new Properties();
p.load(new FileInputStream(""));
InitialContext ctx = new InitialContext(p);
ShoppingCart cart = (ShoppingCart) ctx.lookup("ShoppingCartBean/remote");
I compiled the java files and am planning to create a jar file "a.jar" and
deploy it. In the lookup method given above, I simply mentioned the bean
class name. Nowhere did I mention jar file/module name. Is this correct?

axiez wrote:
> I want to run sample code to understand ejb 3.0 basics. I am new to ejb. I
> have the following java files:,
> and The file has the following code:
> import javax.naming.InitialContext;
> public class Client {
>     public static void main(String[] args) throws Exception {
>         InitialContext ctx = new InitialContext();
>         ShoppingCart cart = (ShoppingCart)
> ctx.lookup("ShoppingCartBean/remote");
>         ...
>     }
>     My plan is to have client on a different JVM than ejb container. I
> wonder how the client can execute bean method without even knowing IP
> address etc of the JVM that has the other code on ejb container.

View this message in context:
Sent from the Apache Geronimo - Users mailing list archive at

View raw message