You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by pingu1611 <ga...@virgin.net> on 2008/05/20 00:18:57 UTC
Global JNDI and Tomcat
Hi,
Thanks in advance for any help you may be able to give. I've searched the
net for a couple of days now but with no success (even with similar messages
posted on this site).
What I'm trying to do is setup global JNDI on tomcat 5.5 (for use with
jackrabbit and Magnolia CMS) but either it's not working or I have lost the
plot. If I have got the confuguration correct for tomcat and you think it
may be a jacrabbit or magnolia issue then please tell me and I'll try on
another forum.
A previous message on this subject said to include the resource in the
GlobalNamingResources element of server.xml along with the ResourceLink.
This is what I have:
<Resource name="magnoliaAuthor"
auth="Container"
type="javax.jcr.Repository"
factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
configFilePath="C:/msgn-work/magnolia/magnolia-3.5.4/apache-tomcat-5.5.25/webapps/magnoliaAuthor/WEB-INF/config/default/repositories.xml"
repHomeDir="c:/magnoliarepo/magnolia" />
<ResourceLink global="magnoliaAuthorGlobal" name="magnoliaAuthor"
type="javax.jcr.Repository" />
and in web.xml
<resource-env-ref>
<description>Jackrabbit Repository</description>
<resource-env-ref-name>magnoliaAuthor</resource-env-ref-name>
<resource-env-ref-type>javax.jcr.Repository</resource-env-ref-type>
</resource-env-ref>
Using this configuration doesn't appear to work as when I put some debugging
in my servlet the jndi context is empty.
The piece of servlet code is:
Context initContext = new InitialContext ();
Context envContext = (Context)initContext.lookup
("java:/comp/env");
Object o = envContext.lookup ("magnoliaAuthor"); // Should this
be the global name (doesn't work either way).
BindableRepository repo = (BindableRepository) o;
Hope someone can point me in the right direction.
Thanks,
Gareth
--
View this message in context: http://www.nabble.com/Global-JNDI-and-Tomcat-tp17329386p17329386.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Global JNDI and Tomcat
Posted by pingu1611 <ga...@virgin.net>.
Wow, that was quick. Sorry that was a typo, the ResourceLink in in the
context.xml file.
Thanks for the speedy reply.
Gareth
Caldarale, Charles R wrote:
>
>> From: pingu1611 [mailto:gareth.nolan@virgin.net]
>> Subject: Global JNDI and Tomcat
>>
>> A previous message on this subject said to include the resource
>> in the GlobalNamingResources element of server.xml along with the
>> ResourceLink.
>
> To quote from the Tomcat doc:
>
> "Use <ResourceLink> elements to link resources from the global context
> into per-web-application contexts."
>
> The <ResourceLink> element belongs inside the <Context> element for the
> webapp of interest, and that <Context> element should be in the webapp's
> META-INF/context.xml file. Where did you put it?
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Global-JNDI-and-Tomcat-tp17329386p17329588.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Global JNDI and Tomcat
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: pingu1611 [mailto:gareth.nolan@virgin.net]
> Subject: Global JNDI and Tomcat
>
> A previous message on this subject said to include the resource
> in the GlobalNamingResources element of server.xml along with the
> ResourceLink.
To quote from the Tomcat doc:
"Use <ResourceLink> elements to link resources from the global context
into per-web-application contexts."
The <ResourceLink> element belongs inside the <Context> element for the
webapp of interest, and that <Context> element should be in the webapp's
META-INF/context.xml file. Where did you put it?
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org