users@glassfish.java.net

Re: Multiple instances of Enterpise Application on the same server

From: Sahoo <Sahoo_at_Sun.COM>
Date: Mon, 28 Apr 2008 21:13:16 +0530

glassfish_at_javadesktop.org wrote:
> Yeah, I've assumed that much... I really find it pants, that I would have to rename all my beans
Since renaming is done using deployment descriptor, I don't see any big
problem.
> just because they use the same global name...
>
> To me it seems logical that if you have an EAR, the name should be bound to that:
>
> java:comp/env/ear/bean
>
> Or even better, wouldn't it be more logical to name it thus:
>
> java:comp/env/ear/ejb/bean
>
>
There is a misunderstanding here. java:comp/env is *not* used to specify
the actual JNDI name. It is not what you see when you browse the JNDI
tree in GlassFish. It's a logical namespace available to application
components only. It's scope is per component, which is even smaller than
an application scope. Two EJBs in the same ear will have different view
of java:comp/env. Chapter #5 of the Java EE platform spec nicely
describes this.
> Failing that it would have been nice to have some sort of context isolation in Glassfish, by host, port, etc...
>
>
There must be same reason why GlassFish does not use ear name in the
default JNDI name of an EJB. Some EJB container guy may know the exact
reason. I think it has something to do with appclient looking up an EJB
which is bundled in the same ear without specifying the EJB's JNDI name.
But, I am for you, it would be nice to include the ear name to avoid
unnecessary name collisions.
> I've now had to rethink the use of an EJB module for the backend because it's now not portable enough for me...
>
I think there is a misunderstanding here. By specifying the JNDI name in
sun-ejb-jar, you actually make your code more portable. When you migrate
to some other appserver, you just have to migrate the sun-ejb-jar.xml,
everything else remains same.

Thanks,
Sahoo
> [Message sent by forum member 'the_thunderbird' (the_thunderbird)]
>
> http://forums.java.net/jive/thread.jspa?messageID=271816
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>