Hello everyone,
I really have no clue whats going wrong. But I am always getting the same
exception:
javax.naming.NamingException: Cannot create resource instance
at
org.apache.naming.factory.ResourceEnvFactory.getObjectInstance(ResourceEnvFactory.java:116)
at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.apache.naming.NamingContext.lookup(NamingContext.java:798)
Here is my code:
I am using tomcat 7.0.4 and
*$tomcat_home$\conf\server.xml*:
<GlobalNamingResources>
<Resource name="jcr/repository"
auth="Container"
type="javax.jcr.Repository"
factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
configFilePath="c:/jackrabbit/repository.xml"
repHomeDir="c:/jackrabbit"/>
</GlobalNamingResources>
And in *web.xml* I do this:
<resource-env-ref>
<description>Content Repository</description>
<resource-env-ref-name>jcr/repository</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/repository");
Session session = repository.login();
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!
--
View this message in context:
http://jackrabbit.510166.n4.nabble.com/Accessing-Jackrabbit-over-JNDI-tp4661192.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.