You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by David Jencks <dj...@gluecode.com> on 2004/11/10 17:25:04 UTC

How forgiving should we be about jndi component context names?

The spec seems to indicate fairly clearly that a components jndi 
context is located in

java:comp/env

  or at least

java:comp

However I believe it is popular to misspell this

java:/comp/env

Do we want to support this naming abuse?

thanks
david jencks


Re: How forgiving should we be about jndi component context names?

Posted by Lyndon <sa...@dodo.net.au>.
David Jencks wrote:

> The spec seems to indicate fairly clearly that a components jndi 
> context is located in
>
> java:comp/env
>
>  or at least
>
> java:comp
>
> However I believe it is popular to misspell this
>
> java:/comp/env
>
> Do we want to support this naming abuse?
>
Make it configurable maybe? Is there a strict vs sensible config mode?

> thanks
> david jencks
>
>
>


Re: How forgiving should we be about jndi component context names?

Posted by Jeremy Boynes <jb...@gluecode.com>.
David Jencks wrote:
> We can't detect this until runtime when the name is looked up.  i think 
> printing a warning continually every time someone does a lookup is 
> overkill.
> 
> So, I think we have to allow it silently or prohibit it.
> 

It would depend on where in the java: namespace the component's context 
is located.

If J2EE mandates that it is in the root, then "java:/comp/env" is a 
valid name and we should not throw an exception.

If it does not, then I guess the appserver can bind it to any Context; 
assuming it is at the root would be non-portable but should work if that 
is where the server binds it.

Given we bind at root, then we should allow this.

--
Jeremy

Re: How forgiving should we be about jndi component context names?

Posted by Dain Sundstrom <ds...@gluecode.com>.
I would just say print the warning once and remember you have already 
printed it.

-dain

--
Dain Sundstrom
Chief Architect
Gluecode Software
310.536.8355, ext. 26

On Nov 10, 2004, at 12:33 PM, David Jencks wrote:

> We can't detect this until runtime when the name is looked up.  i 
> think printing a warning continually every time someone does a lookup 
> is overkill.
>
> So, I think we have to allow it silently or prohibit it.
>
> david jencks
>
> On Nov 10, 2004, at 9:29 AM, Erin Mulder wrote:
>
>> David Jencks wrote:
>>> I tend to agree with you, but not supporting it if most other app 
>>> servers do causes the opposite problem, that non-compliant apps that 
>>> run elsewhere won't run on geronimo.  In particular xpetstore seems 
>>> to make use of this non-compliant behavior.
>>
>> Good point.   Why not take the middle approach and support it, but 
>> display a warning?
>>
>> Cheers,
>> Erin
>>


Re: How forgiving should we be about jndi component context names?

Posted by David Jencks <dj...@gluecode.com>.
We can't detect this until runtime when the name is looked up.  i think 
printing a warning continually every time someone does a lookup is 
overkill.

So, I think we have to allow it silently or prohibit it.

david jencks

On Nov 10, 2004, at 9:29 AM, Erin Mulder wrote:

> David Jencks wrote:
>> I tend to agree with you, but not supporting it if most other app 
>> servers do causes the opposite problem, that non-compliant apps that 
>> run elsewhere won't run on geronimo.  In particular xpetstore seems 
>> to make use of this non-compliant behavior.
>
> Good point.   Why not take the middle approach and support it, but 
> display a warning?
>
> Cheers,
> Erin
>


Re: How forgiving should we be about jndi component context names?

Posted by Erin Mulder <me...@alumni.princeton.edu>.
David Jencks wrote:
> I tend to agree with you, but not supporting it if most other app 
> servers do causes the opposite problem, that non-compliant apps that run 
> elsewhere won't run on geronimo.  In particular xpetstore seems to make 
> use of this non-compliant behavior.

Good point.   Why not take the middle approach and support it, but 
display a warning?

Cheers,
Erin

Re: How forgiving should we be about jndi component context names?

Posted by David Jencks <dj...@gluecode.com>.
I tend to agree with you, but not supporting it if most other app 
servers do causes the opposite problem, that non-compliant apps that 
run elsewhere won't run on geronimo.  In particular xpetstore seems to 
make use of this non-compliant behavior.

thanks
david jencks

On Nov 10, 2004, at 8:41 AM, Erin Mulder wrote:

> David Jencks wrote:
>> However I believe it is popular to misspell this
>> java:/comp/env
>> Do we want to support this naming abuse?
>
> It would be convenient, but might cause applications to fail when 
> ported to other app servers.  If the spec is clear on the correct 
> usage, then I think it's better to just detect the problem and display 
> a very specific warning/tip in the log so that the developer can 
> easily find and fix the problem at development time.  (As opposed to 
> having to hunt down a generic lookup failure, or figure out why things 
> suddenly broke months later when moved to a different app server.)
>
> Cheers
> Erin
>


Re: How forgiving should we be about jndi component context names?

Posted by Erin Mulder <me...@alumni.princeton.edu>.
David Jencks wrote:
> However I believe it is popular to misspell this
> 
> java:/comp/env
> 
> Do we want to support this naming abuse?

It would be convenient, but might cause applications to fail when ported 
to other app servers.  If the spec is clear on the correct usage, then I 
think it's better to just detect the problem and display a very specific 
warning/tip in the log so that the developer can easily find and fix the 
problem at development time.  (As opposed to having to hunt down a 
generic lookup failure, or figure out why things suddenly broke months 
later when moved to a different app server.)

Cheers
Erin