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 <[email protected]> a écrit : De: Kurz Wolfgang <[email protected]> Objet: Accessing Jackrabbit over JNDI À: "[email protected]" <[email protected]> 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!
