jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neman ould sidahmed <nould...@yahoo.fr>
Subject Re : Accessing Jackrabbit over JNDI
Date Tue, 10 Mar 2009 15:42:16 GMT
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 <wolfgang.kurz@gwvs.de> a écrit :

De: Kurz Wolfgang <wolfgang.kurz@gwvs.de>
Objet: Accessing Jackrabbit over JNDI
À: "users@jackrabbit.apache.org" <users@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!




      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message