Hi David,

Thanks for the reply. I put it on the tomcat list as well in case I was
being stupid with my tomcat configuration. I have to admit this is a first
attempt to simply try out magnolia. It will be used on two apps for the
present (a third fairly soon) so I wanted to share the repository across
each app by using a global jndi rather than a backend database. There is an
existing message along similar lines but I'm struggling to get it to work.
This is the message:

Hi,
magnolia always tries to get the repository object via JNDI.

But sharing JNDI object at container level can only be achieved by sharing
jndi context implementation between web applications. 

magnolia configuration allows you to define context factory and jndi name so
you can use any third party factory implementation. 

jackrabbit do not provide JNDI factory as a separate implementation so
either you need to extract JNDI library from jackrabbit jars or use magnolia
EE which comes with the 
jndi context factory implementation.

Hope this helps,

Regards,

Sameer Charles
Magnolia International Ltd.




Magnolia - User mailing list wrote:
> 
> I just saw this post over on the tomcat user list.  Have you tried to 
> set this up in a simpler config w/ each webapp having a local repository 
> with db back-end?  Otherwise I don't know as I've never even tried such 
> weird setup and can't for the life of me think of why you'd create a 
> global resource that's only used on one webapp.
> 
> --David
> 
> pingu1611 wrote:
>> Hi, 
>>
>> Resending cos I'm getting a pending message still.
>>
>> 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.
>>
>> 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. I am trying to just get the magnolia test case up and running but
>> either complains about a lock on the repository or it cannot find the
>> context in JNDI.
>>
>> A previous message on this subject said to include the resource in the
>> GlobalNamingResources element of server.xml along with the ResourceLink
>> in
>> context.xml. 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" /> 
>>
>> in context.xml
>>
>> <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
>>
>>   
> 
> 
> -- 
> David Smith
> Network Operations Supervisor
> Department of Entomology
> Cornell University
> 2132 Comstock Hall
> Ithaca, NY 14853
> Phone: (607) 255-9571
> Fax: (607) 255-0940
> 
> 
> ----------------------------------------------------------------
> for list details see
> http://documentation.magnolia.info/
> ----------------------------------------------------------------
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Shared-JNDI-with-Tomcat-tp17329549p17330619.html
Sent from the Magnolia - User mailing list archive at Nabble.com.


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------

Reply via email to