You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Richard Duggan <rd...@ca.ibm.com> on 2005/10/18 17:22:09 UTC

Geronimo M5 JNDI resources

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>                                                                
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            


Thanks in Advance,


Richard K. Duggan
On Demand Development and Incubation
IBM Toronto Laboratory
External: 905-413-2396
Internal: 969-2396


Re: Geronimo M5 JNDI resources

Posted by David Jencks <da...@yahoo.com>.
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.

thanks
david jencks