此代码片段:
Repository repository = JcrUtils.getRepository("http://localhost:8080");
Session session = repository.login(new SimpleCredentials("admin",
"admin".toCharArray()));
给出以下例外:
javax.jcr.LoginException: Login failed: Unknown workspace 'null'.
at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.obtain(RepositoryServiceImpl.java:799)
at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.obtain(RepositoryServiceImpl.java:748)
at org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.obtain(RepositoryServiceImpl.java:309)
at org.apache.jackrabbit.jcr2spi.RepositoryImpl.login(RepositoryImpl.java:151)
at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:144)
当与从源头构建的香草吊索运行时。如果我添加, "default"
到登录调用,它会变成:
javax.jcr.ItemNotFoundException: Not Found
at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:100)
at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:51)
at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:45)
at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.obtain(RepositoryServiceImpl.java:804)
at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.obtain(RepositoryServiceImpl.java:748)
at org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.obtain(RepositoryServiceImpl.java:309)
at org.apache.jackrabbit.jcr2spi.RepositoryImpl.login(RepositoryImpl.java:151)
我应该如何使用来自 JCR 客户端的 sling 存储库?