geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: Geronimo M5 JNDI resources
Date Tue, 18 Oct 2005 16:57:04 GMT

On Oct 18, 2005, at 8:22 AM, Richard Duggan wrote:

> I would like to create some JNDI resources that can be configured as 
> part
> of a configuration file.   Using Tomcat this can be achieved by 
> configuring
> the resource factory in the server.xml file (as shown below).  How is 
> it
> recommended that this be achieved with Geronimo?  I initially had two
> thoughts, either this could be hosted by the embedded Tomcat and 
> configured
> using the geronimo-web.xml file it could be hosted as part of the 
> openejb
> component and configured using the openejb-jar.xml.  Can anyone share 
> some
> advise?
>   <Context ...>
>     ...
>     <Resource name="bean/MyBeanFactory" auth="Container"
>               type="com.mycompany.MyBean"/>
>     <ResourceParams name="bean/MyBeanFactory">
>       <parameter>
>         <name>factory</name>
>         <value>org.apache.naming.factory.BeanFactory</value>
>       </parameter>
>       <parameter>
>         <name>bar</name>
>         <value>23</value>
>       </parameter>
>     </ResourceParams>
>     ...
>   </Context>

On first look, I would say this is not a use of jndi supported by the 
j2ee spec, and that there is no direct support in geronimo for it at 
this time.  I'd be interested in knowing more about what you are trying 
to do here and what the result of the jndi lookup is supposed to be.  
It looks like you are trying to expose a javabean in jndi, each lookup 
returning a new instance?  The configuration of the javabean factory 
could be done easily as a gbean, but there would be no direct way to 
access it in jndi.  We've discussed possible ways of exposing arbitrary 
gbeans through jndi but due to lack of clear use cases and time nothing 
is implemented at the moment.

As workarounds you might be able to use env-entries to let your j2ee 
component construct the javabean itself or you might possibly be able 
to do something by registering a custom URL handler that would create 
the javabean for you.

david jencks

View raw message