jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jozef Wagner" <jozef.wag...@gmail.com>
Subject jcr2spi spi2dav supplying username and passsword when connecting to remote Jackrabbit
Date Wed, 19 Dec 2007 13:12:04 GMT

Is it possible to supply username and password when connecting to
remote WebDAV enabled Jackrabbit?

When I deploy jackrabbit-webapp in Tomcat and when I modify web.xml
where  uncomment missing-auth-mapping (and change anonymous to
something else) all goes well and I don't need to supply username or

However I have problems with deployment on Glassfish V2. It keeps
throwing repositoryexception with string "unauthorized" whether I
modified web.xml or not.

jozef Wagner

Here is code I use to obtain repository:

    private Repository getMeAJCRRepository(URI uri) throws
        Repository repository = null;
        try {

            final IdFactory idFactory = IdFactoryImpl.getInstance();
            final QValueFactory vFactory = QValueFactoryImpl.getInstance();
            final RepositoryServiceImpl webdavRepoService = new
RepositoryServiceImpl(uri.toString(), idFactory,
NameFactoryImpl.getInstance(), PathFactoryImpl.getInstance(),

            RepositoryConfig config = new AbstractJCRRepositoryConfig() {
                public RepositoryService getRepositoryService() {
                    return webdavRepoService;

                public QValueFactory getQValueFactory() {
                    return vFactory;

                public String getDefaultWorkspaceName() {
                    String name = new String ("default");
                    return name;

            repository = RepositoryImpl.create(config);
        } catch (Exception e) {
            throw new RepositoryStubException(e.toString());
        return repository;

View raw message