geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: How to replicate Tomcat GlobalNamingResource JNDI lookup
Date Sat, 14 Jan 2006 18:04:49 GMT

On Jan 14, 2006, at 2:01 AM, Bob White wrote:

> On another server, in a standalone Tomcat server, I locate a  
> properties file using a JNDI lookup by adding the following entry  
> in my server.xml file.
>
> <!-- Global JNDI resources -->
>     <GlobalNamingResources>
>        <Environment name="Server.properties"
>                     type="java.lang.String"
>            value="/usr/local/tomcat/conf/Server.properties" />
>    </GlobalNamingResources>
>
> I am migrating to Geronimo (WAS-CE, actually) and cannot figure out  
> quite what to put in
>   WEB-INF/web.xml,
>   geronimo-web.xml.
>
> I can guess most of what I have to do, except for how to express  
> the location of the file (which is set in the "value" attribute on  
> the "Environment" element shown above).
>
> What is the analog of that in Geronimo?  Do I need to add a META- 
> INF/context.xml file?
>
> Here are snippets of my web.xml and geronimo-web.xml files:
>
> web.xml
>     <resource-ref>
>         <description>Server Properties</description>
>         <res-ref-name>server/Server.properties</res-ref-name>
>         <res-type>java.lang.String</res-type>
>         <res-sharing-scope>Shareable</res-sharing-scope>
>     </resource-ref>
> geronimo-web.xml
>    <naming:resource-ref>
>        <naming:ref-name>server/Server.properties</naming:ref-name>
>        <naming:resource-link>
>           /srv/www/cops/htdocs/Server.properties
>        </naming:resource-link>
>     </naming:resource-ref>
> I'm guessing that <naming:resource-link> is where I put the path of  
> the file.
>

resource-ref is primarily for connection factories such as jdbc  
DataSources, although you can use it for URLs as well.  For a string,  
you want to use an env-entry in your web.xml:


<env-entry>
    <env-entry-name>server/Server.properties</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>/srv/www/cops/htdocs/Server.properties</env- 
entry-value>
</env-entry>

At the moment there is no way to override this value in the geronimo- 
web.xml plan.

Hope this helps
david jencks


>
> --Bob White-- home:727-490-7363, cell:727-463-6061
> photos: http://polina.70kg.com/ http://nastya.70kg.com/
> blog: http://milkchaser.blogspot.com/
>
> Everything that irritates us about others can lead us to an  
> understanding of ourselves. - Carl Jung
>
> If there must be trouble, let it be in my day, so that
> my children may have peace. - Thomas Paine
>
> There are 10 kinds of people in this world.....those who understand
> binary and those who don't.


Mime
View raw message