You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Hansen, Richard" <Ri...@westgroup.com> on 2003/01/16 15:34:37 UTC

org.apache.naming.factory.BeanFactory bugs (and fixes)

In trying to define my own JNDI resources using BeanFactory I came across a
number of bugs.

Bugs:
1) The howto examples used the newer <resource-env-ref> inplace of
<resource-ref>. Problem is that BeanFactory does not work with
<resource-env-ref>. It just returns null.

2) BeanFactory checks for instances of a ResourceRef object, if the object
passed isn't one BeanFactory just returns null. No error is logged or
exception thrown. This made debugging more difficult than it should have
been. It later casts the object to a Reference not a ResourceRef.

3) BeanFactory tries to put the value from <description> element into the
object as a parameter. If it can't find a setDescription method it throws a
NamingException.

Fixes:
1) BeanFactory should be checking for instances of Reference not
ResourceRef. ResourceRef and ResourceEnvRef both subclass Reference.
2) BeanFactory should throw a NamingException if the object is not an
instanceof Reference.
3) Description parameter should be ignored.

I have attached a fixed BeanFactory.java. There are quite a few messages in
the archive that relate to BeanFactory problems and the howto examples do
not work, so I hope someone will add this to the source tree.

Rick Hansen


Re: org.apache.naming.factory.BeanFactory bugs (and fixes)

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 16 Jan 2003, Hansen, Richard wrote:

> Date: Thu, 16 Jan 2003 08:34:37 -0600
> From: "Hansen, Richard" <Ri...@westgroup.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: "Tomcat Users List (E-mail)" <to...@jakarta.apache.org>
> Subject: org.apache.naming.factory.BeanFactory bugs (and fixes)
>
> In trying to define my own JNDI resources using BeanFactory I came across a
> number of bugs.
>

Rick,

Thanks for doing the investigation and patches for these problems!  Could
you do me a favor, and post this as a bug report:

  http://nagoya.apache.org/bugzilla/

and add the patches as attachments?  That way, it will stay in front of
the developers until it is dealt with.  Things in mailing lists sometimes
get lost in the volume.

Thanks!

Craig



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>