Reputation: 86
I am running the standalone server and trying to make a connection:
try {
Repository repository = JcrUtils.getRepository("http://localhost:8080/server/");
} catch (RepositoryException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
As stated in: http://wiki.apache.org/jackrabbit/RemoteAccess
However, I am getting:
javax.jcr.RepositoryException: Unable to access a repository with the following settings: org.apache.jackrabbit.repository.uri: "the locla host"
The following RepositoryFactory classes were consulted:
org.apache.jackrabbit.core.RepositoryFactoryImpl: declined
org.apache.jackrabbit.commons.JndiRepositoryFactory: declined
Perhaps the repository you are trying to access is not available at the moment.
I have no problem browsing the jackrabbit server with my webrowser.
Upvotes: 1
Views: 2132
Reputation: 648
Do you have the jackrabbit-jcr2dav-*.jar
library in your class-path?
From the error report it looks like the RepositoryFactory
instances consulted do not include org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory
- which is the factory implementation that understands http:
URLs.
(aside: You you were missing this library, you'll also need to add in it's dependencies - jackrabbit-spi2dav-*.jar
, etc.)
Upvotes: 2
Reputation: 16364
Make sure you are using the correct URI to the WebDAV server entry as in you stacktrace it seems not to be the case:
Unable to access a repository with the following settings: org.apache.jackrabbit.repository.uri: "the locla host"
You should use "http://localhost:8080/server"
.
Upvotes: 0