You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by neman ould sidahmed <no...@yahoo.fr> on 2009/03/10 16:42:16 UTC
Re : Accessing Jackrabbit over JNDI
Hi,
you can put this code in context declaration of your application :
<ResourceLink global="jcr/globalRepository" name="jcr/repository"
type="javax.jcr.Repository"/>
and get the name (repository) and not global repository
Here an example :
<Context path="/yourContext" docBase="yourDirectory">
<ResourceLink global="jcr/globalRepository" name="jcr/repository"
type="javax.jcr.Repository"/>
</Context>
regards
nould
--- En date de : Mar 10.3.09, Kurz Wolfgang <wo...@gwvs.de> a écrit :
De: Kurz Wolfgang <wo...@gwvs.de>
Objet: Accessing Jackrabbit over JNDI
À: "users@jackrabbit.apache.org" <us...@jackrabbit.apache.org>
Date: Mardi 10 Mars 2009, 16h04
Hello everyone,
i still havent figured this out:-(
I really have no clue whats going wrong. But I am always getting the same exception:
javax.naming.NamingException: Cannot create resource instance
Here is my code:
Server.xml:
<GlobalNamingResources>
<Resource name="jcr/globalRepository"
auth="Container"
type="javax.jcr.Repository"
factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
configFilePath="U:/jackrabbit/repository.xml"
repHomeDir="U:/jackrabbit"/>
</GlobalNamingResources>
And in web.xml I do this:
<resource-env-ref>
<description>Content Repository</description>
<resource-env-ref-name>jcr/globalRepository</resource-env-ref-name>
<resource-env-ref-type>javax.jcr.Repository</resource-env-ref-type>
</resource-env-ref>
And in the code I try this:
InitialContext context = new InitialContext();
Context environment = (Context) context.lookup("java:comp/env");
Repository repository = (Repository) environment.lookup("jcr/globalRepository");
I really need to figure this out cause using jackrabbit over rmi isn't really an option for the productive servers.
If anyone had some hints for me I would really appreciate them:-)
Thx a lot in advance!