jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Betty Chang" <bch...@edgenuity.com>
Subject Re: seeking help with jackrabbit-jcr-servlet component
Date Tue, 22 Jul 2008 18:56:48 GMT
Hi --

So, here's what I tried:

I created a servlet that extends ContextRepositoryServlet,  for which the 
init-param "path" is set to the context path of the
source servlet ("/jackrabbit").   In the init() for this servlet, I did a 
Repository rep = new ServletRepository(this).

Then, when I tried a session = rep.login(), I got the following exception:
javax.servlet.ServletException: javax.jcr.RepositoryException: Invalid 
repository: Attribute javax.jcr.Repository in servet context Jackrabbit JCR 
Server is an instance of 
org.apache.jackrabbit.commons.repository.ProxyRepositoryAm I even on the 
right track?



----- Original Message ----- 
From: "Jukka Zitting" <jukka.zitting@gmail.com>
To: <users@jackrabbit.apache.org>
Sent: Tuesday, July 22, 2008 1:47 AM
Subject: Re: seeking help with jackrabbit-jcr-servlet component

> Hi,
> On Tue, Jul 22, 2008 at 3:03 AM, Betty Chang <bchang@edgenuity.com> wrote:
>> I'm trying to write a simple webapp that sits in the same tomcat servlet 
>> container as the jackrabbit server.  I want to
>> use this app to configure some custom nodetypes for the repository.
>> I'm trying to understand the instructions on the local.jsp page about the 
>> jackrabbit-jcr-servlet component.  In particular, it states:
>> "See the jackrabbit-jcr-servlet documentation for more details. "
>> Where is the jackrabbit-jcr-servlet documentation?
> See the org.apache.jackrabbit.servlet javadocs in
> http://jackrabbit.apache.org/api/1.4/.
>> Is it possible for me to use the line of code shown in the local.jsp page 
>> to access
>> a repository in the jackrabbit app if my webapp is on the same container?
> Yes if you your webapp has cross-context access to be able to access
> the repository from the jackrabbit-webapp context. In Tomcat that
> requires a <Context crossContext="true"/> setting.
>> Will I  be able to add custom node types this way?
> Yes if the jackrabbit-api extension interfaces are shared within the
> container. In Tomcat (6.x) that requires moving the jackrabbit-api jar
> file from WEB-INF/lib in jackrabbit-webapp to $CATALINA_HOME/lib.
>> I tried the example, but I ended up with an error about my
>> context missing the "javax.jcr.repository" attribute.
> Are you using the jackrabbit-jcr-servlet classes like
> ServletRepository to access the repository? Then instead of the code
> snippet in local.jsp you should be using the ContextRepositoryServlet
> that copies the repository reference from another context to the
> context of your webapp.
> Another point, the default attribute name is "javax.jcr.Repository" 
> (capital R).
> BR,
> Jukka Zitting

View raw message