jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "AJ Chen" <cano...@gmail.com>
Subject Re: model 2 repository startup exception
Date Tue, 18 Sep 2007 05:34:57 GMT
To configure tomcat to provide a common repository to multiple web apps,
Jackrabbit repository is added as a global resource, which requires
jcr-1.0.jar as well as other jackrabbit jars in common/lib. If jcr-1.0 is
not there, tomcat will complain during startup.

Since BinableRepository implements javax.jcr.Repository, it should be fine
to cast BindableRepository to javax.jcr.Repository. It's unclear to me why
the exception is thrown.

I also prefer to keep jackrabbit jars in WEB-INF/lib. In fact, I would like
to run a separate web app to provide jackrabbit repository to multiple web
apps in the same tomcat container. Using this approach, how do I make the
repository available to multiple web apps? The JNDI tree can not be modified
from a web app.

Thanks,
-aj

On 9/16/07, Jukka Zitting <jukka.zitting@gmail.com> wrote:
>
> Hi,
>
> On 9/15/07, AJ Chen <canovaj@gmail.com> wrote:
> > But, it throws an exception: java.lang.ClassCastException:
> > org.apache.jackrabbit.core.jndi.BindableRepository
> >
> > Any idea why?
>
> Do you have the jcr-1.0.jar included in your webapp? That could
> explain the ClassCastException, i.e. if BindableRepository implements
> the javax.jcr.Repository interface loaded from common/lib, but your
> application is trying to cast it to javax.jcr.Repository loaded from
> within your webapp's WEB-INF/lib.
>
> The best practice for JCR webapps is to only include the jcr-1.0.jar
> file in WEB-INF/lib if you also embed the repository implementation in
> your webapp.
>
> BR,
>
> Jukka Zitting
>



-- 
AJ Chen, PhD
Co-Chair, SDForum Semantic Web SIG
http://web2express.org
http://healthline.com

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