jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patricio Echag├╝e <patric...@gmail.com>
Subject Exposing(binding) a repository object through JNDI in Tomcat 6.
Date Thu, 15 Oct 2009 18:57:10 GMT
Hi all, I have a problem I cannot sort out.

I deployed the jackrabbit webapp in tomcat with MySQL according to the steps
in the wiki. (so far so good).
This webapp has a servlet called: RepositoryStartupServlet which I'm using
to bind the repository (created by it) to JNDI so that another webapp can do
a lookup, get the repo and use it.

After configuring ALL the parameters in tomcat to link the resource name
with the context, I get this exception when tomcat starts up:

Caused by: javax.naming.NameNotFoundException: Name jcr is not bound in this
    at org.apache.naming.NamingContext.bind(NamingContext.java:843)
    at org.apache.naming.NamingContext.bind(NamingContext.java:171)
    at org.apache.naming.NamingContext.bind(NamingContext.java:187)
    at org.apache.naming.SelectorContext.bind(SelectorContext.java:171)
    at javax.naming.InitialContext.bind(Unknown Source)
    ... 29 more

As you can see there, the error is when the servlet executes the bind()
method. Apparently, the InitialContext is read correctly.

Does anyone has clue?
Basically, these are the configuration files I have set up:

  # RMI Settings
  # If the URI is not specified, it's composed as follows:

  # JNDI Settings
  # all properties starting with 'java.naming.' will go into the
  # environment of the initial context
  # if the name is not specified, it's initialized with the repository.name

META-INF -->* context.xml *(in my webapp)

<?xml version="1.0" encoding="UTF-8"?>

  <ResourceLink name="jcr/local"  global="jcr/local"
type="javax.jcr.Repository" />


    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users

    <Resource name="jcr/local" auth="Container"
              description="local repository"

factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory" />

     <!-- I tried with and without the factory attribute -->


I have tried to create a simple String and do a lookup from another webapp
and it works fine. But in that case, tomcat is instantiating the object.
In my case, I want jackrabbit servlet to create the repository and bind it
to the JNDI context.

Note: I works fine with JBoss though



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