jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto González <robe...@ardan.es>
Subject Question about Jackrabbit/JNDI/Apache
Date Wed, 18 Nov 2009 13:04:00 GMT

I'm starting with Jackrabbit, and I'm having some problems with 
communications beetween my application and the Jackrabbit server.

I have a Tomcat6 where I deployed Jackrabbit, and on the same server, an 
console application wich I want to use Jackrabbit.

My question is: Can I connect my application with the server ussing 
JNDI? According with documentation, it should be possible:

      /Accessing the repository through JNDI/

/ By default the repository is only made available in a dummy JNDI 
directory local to this web application. However, you can make the 
repository globally available if your servlet container allows a web 
application to modify the global JNDI directory or you are using some 
other JNDI directory that can manage unserializable Java objects. /

/ To bind the the repository to such a JNDI directory, you need to 
modify the |java.naming| parameters in either the /WEB-INF/web.xml 
deployment descriptor or the jackrabbit/bootstrap.properties file. You 
need to redeploy this web application to activate the changes. /

/ Use the following code to access a repository bound in a JNDI directory: /

/*import* javax.jcr.Repository;
*import* javax.naming.Context;
*import* javax.naming.InitialContext;

Context context = *new* InitialContext(...);
Repository repository = (Repository) context.lookup(...);/

How should I configure the web.xml deployment file? What should I put instead of the ... on
the last two lines?

Can anyone send me an example?

Thank you
Roberto González

Thank you!

View raw message