You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Neil Corbet <nc...@towerhillservices.com> on 2010/08/06 18:55:54 UTC

JndiRepositoryFactory and BindableRepository.

Hello Everyone,

   I am having a difficult time understanding a problem I am having. I followed 
the instructions for setting up a repo as a shared resource under Tomcat in the 
same manner as the technique here: http://jackrabbit.apache.org/shared-j2ee-
resource-howto.html.

   I am using Jackrabbit 2.1.0.

   I deployed the jcr-explorer war and can login to the repo through 
"java:comp/env/jcr/repository". 


   When I deploy my apps war and try to access the repository through my session 
provider using JcrUtils.getRepository(URI) with the URI as 
"jndi:java:comp/env/jcr/repository" it appropriatly uses the 
JndiRepositoryFactory and parses the URI to "java:comp/env/jcr/repository" but 
it fails saying that the Repository is invalid:


java.security.ProviderException: javax.jcr.RepositoryException: Unable to access 
a repository with the following settings:
    org.apache.jackrabbit.repository.uri: jndi:java:comp/env/jcr/repository
The following RepositoryFactory classes were consulted:
    org.apache.jackrabbit.core.RepositoryFactoryImpl: declined
    org.apache.jackrabbit.commons.JndiRepositoryFactory: failed
        because of RepositoryException: Invalid repository object 
org.apache.jackrabbit.core.jndi.BindableRepository@bfc25c found at 
java:comp/env/jcr/repository in JNDI environment {}
    org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory: failed
        because of RepositoryException: The JNDI resource 
java:comp/env/jcr/repository is not a remote repository stub: 
org.apache.jackrabbit.core.jndi.BindableRepository@bfc25c
Perhaps the repository you are trying to access is not available at the moment.

BindableRepository extends AbstractRepository and implements 
javax.jcr.Repository as does AbstractRepository. Shouldn't the 
JndiRepositoryFactory recognize it as an instanceof Repository? This is where it 
is failing.

Any help or insight would be appreciated. I am wanting to get away from RMI.



Re: JndiRepositoryFactory and BindableRepository.

Posted by Neil Corbet <nc...@towerhillservices.com>.
Neil Corbet <ncorbet <at> towerhillservices.com> writes:

> 
> Fixed!!! 
> 
> Thanks Jukka! My webapp did have an extra copy of the jcr-2.0. jar in it.
> 
> I am not connecting just fine. I appreciate everyones help.
> 
> Thanks,
>    Neil Corbet
> 
> 


LOL!! I meant to say I am connecting just fine. 


Thanks again,
     Neil Corbet


Re: JndiRepositoryFactory and BindableRepository.

Posted by Neil Corbet <nc...@towerhillservices.com>.
> > Make sure that you don't have an extra copy of the JCR API jar in your 
webapp.
> > 
> > BR,
> > 
> > Jukka Zitting
> > 
> > 
> 
> Jukka,
> 
>     Just to clarify, are you meaning the jcr-2.0 jar or the jackrabbit-
> api2.1.0.jar?
> 
> Thanks,
>    Neil
> 
> 

Fixed!!! 

Thanks Jukka! My webapp did have an extra copy of the jcr-2.0. jar in it.

I am not connecting just fine. I appreciate everyones help.


Thanks,
   Neil Corbet



Re: JndiRepositoryFactory and BindableRepository.

Posted by Neil Corbet <nc...@towerhillservices.com>.
Jukka Zitting <jukka.zitting <at> gmail.com> writes:

> 
> Hi,
> 
> On Fri, Aug 6, 2010 at 6:55 PM, Neil Corbet
> <ncorbet <at> towerhillservices.com> wrote:
> >   When I deploy my apps war and try to access the repository through my 
session
> > provider using JcrUtils.getRepository(URI) with the URI as
> > "jndi:java:comp/env/jcr/repository" it appropriatly uses the
> > JndiRepositoryFactory and parses the URI to "java:comp/env/jcr/repository" 
but
> > it fails saying that the Repository is invalid:
> 
> Make sure that you don't have an extra copy of the JCR API jar in your webapp.
> 
> BR,
> 
> Jukka Zitting
> 
> 

Jukka,

    Just to clarify, are you meaning the jcr-2.0 jar or the jackrabbit-
api2.1.0.jar?

Thanks,
   Neil





Re: JndiRepositoryFactory and BindableRepository.

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Fri, Aug 6, 2010 at 6:55 PM, Neil Corbet
<nc...@towerhillservices.com> wrote:
>   When I deploy my apps war and try to access the repository through my session
> provider using JcrUtils.getRepository(URI) with the URI as
> "jndi:java:comp/env/jcr/repository" it appropriatly uses the
> JndiRepositoryFactory and parses the URI to "java:comp/env/jcr/repository" but
> it fails saying that the Repository is invalid:

Make sure that you don't have an extra copy of the JCR API jar in your webapp.

BR,

Jukka Zitting