我正在运行独立服务器并尝试建立连接:
try {
Repository repository = JcrUtils.getRepository("http://localhost:8080/server/");
} catch (RepositoryException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
如:http://wiki.apache.org/jackrabbit/RemoteAccess中所述
但是,我得到:
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.
我用我的网络浏览器浏览 jackrabbit 服务器没有问题。
最佳答案
您的类路径中是否有 jackrabbit-jcr2dav-*.jar
库?
从错误报告来看,所咨询的RepositoryFactory
实例不包括org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory
- 这是理解的工厂实现>http:
URL。
(旁白:您缺少这个库,您还需要添加它的依赖项 - jackrabbit-spi2dav-*.jar
等)
关于java - Apache Jackrabbit,通过WebDAV协议(protocol)连接到本地主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23437583/