jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Ried <FlorianR...@gmx.de>
Subject JackRabbit as Shared J2EE Resource
Date Thu, 09 Jun 2005 16:30:10 GMT
Hi,

I'm trying to depoly Jackrabbit as described in Deploment Model 2 
(Shared J2EE Recource on Tomcat 5.5). After configuring and deploying my 
WebApp I'm able to look up my repository, but the reference to the 
repository is always null.

I think, that the repository resource (config file and repHomeDir) 
specified in the server.xml cannot be found. The server.xml:

    <!-- Global Repository -->
    <Resource name="jcr/globalRepository"
          auth="Container"
          type="javax.jcr.Repository"
          
factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
          configFilePath="D:\repotest/repository.xml"
          repHomeDir="D:\repotest"/>

The (Servlet-)Code:

    InitialContext context = new InitialContext();
    Context environment = (Context) context.lookup("java:comp/env");
    Repository repository = (Repository) 
environment.lookup("jcr/repository");

    writer.println (repository == null); // this is always true!!!

    Session session = repository.login();
    Node rn=session.getRootNode();
   
    writer.println(rn.getPrimaryNodeType().getName());


The First steps example is working perfectly. My aim is to set up a 
repository server as described in model 3.

Sorry for writing to the developer-mailinglist, but I couldn't find a 
user-mailinglist.

Thank you for your answers.
Florian



Mime
View raw message