Okay, I found the reason. The repository.xml is perfectly correct. I just messed up the startup of the standalone server. I would have been nice if it had told me which configuration file it was using then I would have noticed the problem a lot earlier.
Thank you for your help. 2012/3/8 Stefan Hahn <[email protected]> > Hi! > > Here is my repositoy.xml used to create the repository by the java > application. Again, everything is working fine. > > <?xml version="1.0" encoding="UTF-8"?><!-- Licensed to the Apache Software > Foundation (ASF) under one or more contributor license agreements. See the > NOTICE file > distributed with this work for additional information regarding > copyright ownership. The ASF licenses this file to You under > the Apache License, Version 2.0 (the "License"); you may not use this > file except in compliance with the License. You may > obtain a copy of the License at > http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable > law or agreed to > in writing, software distributed under the License is distributed on > an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF > ANY KIND, either express or implied. See the License for the specific > language governing permissions and limitations under > the License. --><!DOCTYPE Repository PUBLIC "-//The Apache Software > Foundation//DTD Jackrabbit 2.0//EN" " > http://jackrabbit.apache.org/dtd/repository-2.0.dtd"> > <!-- Example Repository Configuration File Used by - > org.apache.jackrabbit.core.config.RepositoryConfigTest.java - > --><Repository> > <DataSources> > <DataSource name="ds"> > <param name="driver" value="org.postgresql.Driver"/> > <param name="url" > value="jdbc:postgresql://localhost:5432/repos"/> > <param name="user" value="user"/> > <param name="password" value="password"/> > <param name="databaseType" value="postgresql"/> > </DataSource> > </DataSources> > <!-- virtual file system where the repository stores global state > (e.g. registered namespaces, custom node types, etc.) --> > <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> > <param name="dataSourceName" value="ds"/> > <param name="schema" value="postgresql"/> > <param name="schemaObjectPrefix" value="rep_fs_"/> > </FileSystem> > > <!-- data store configuration --> > <DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/> > > <!-- security configuration --> > <Security appName="Jackrabbit"> > <!-- security manager: class: FQN of class implementing the > JackrabbitSecurityManager interface --> > <SecurityManager > class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager" > workspaceName="security"> > <!-- workspace access: class: FQN of class implementing the > WorkspaceAccessManager interface --> > <!-- <WorkspaceAccessManager class="..."/> --> > <!-- <param name="config" value="${rep.home}/security.xml"/> > --> > </SecurityManager> > > <!-- access manager: class: FQN of class implementing the > AccessManager interface --> > <AccessManager > class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager"> > <!-- <param name="config" value="${rep.home}/access.xml"/> --> > </AccessManager> > > <LoginModule > class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule"> > <!-- anonymous user name ('anonymous' is the default value) --> > <param name="anonymousId" value="anonymous"/> > <!-- administrator user id (default value if param is missing > is 'admin') --> > <param name="adminId" value="admin"/> > </LoginModule> > </Security> > > <!-- location of workspaces root directory and name of default > workspace --> > <Workspaces defaultWorkspace="default" > rootPath="${rep.home}/workspaces"/> > <!-- workspace configuration template: used to create the initial > workspace if there's no workspace yet --> > <Workspace name="${wsp.name}"> > <!-- virtual file system of the workspace: class: FQN of class > implementing the FileSystem interface --> > <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> > <param name="dataSourceName" value="ds"/> > </FileSystem> > <!-- persistence manager of the workspace: class: FQN of class > implementing the PersistenceManager interface --> > <PersistenceManager > class="org.apache.jackrabbit.core.persistence.pool.PostgreSQLPersistenceManager"> > <param name="dataSourceName" value="ds"/> > <param name="schemaObjectPrefix" value="rep_${wsp.name}_"/> > </PersistenceManager> > <!-- Search index and the file system it uses. class: FQN of class > implementing the QueryHandler interface --> > <SearchIndex > class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> > <param name="path" value="${wsp.home}/index"/> > <param name="supportHighlighting" value="true"/> > </SearchIndex> > </Workspace> > > <!-- Configures the versioning --> > <Versioning rootPath="${rep.home}/version"> > <!-- Configures the filesystem to use for versioning for the > respective persistence manager --> > <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> > <param name="dataSourceName" value="ds"/> > </FileSystem> > > <!-- Configures the persistence manager to be used for persisting > version state. Please note that the current versioning > implementation is based on a 'normal' persistence manager, but > this could change in future implementations. --> > <PersistenceManager > class="org.apache.jackrabbit.core.persistence.pool.PostgreSQLPersistenceManager"> > <param name="dataSourceName" value="ds"/> > <param name="schemaObjectPrefix" value="rep_version_"/> > </PersistenceManager> > </Versioning> > > <!-- Search index for content that is shared repository wide > (/jcr:system tree, contains mainly versions) --> > <SearchIndex > class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> > <param name="path" value="${rep.home}/repository/index"/> > <param name="supportHighlighting" value="true"/> > </SearchIndex> > </Repository> > > Using this exact same file with the standalone server ends up in the > following exception: > > Caused by: javax.jcr.RepositoryException: DataSource with logicalName ds > has not been configured > at > org.apache.jackrabbit.core.util.db.ConnectionFactory.getDataBaseType(ConnectionFactory.java:138) > ~[jackrabbit-standalone.jar:na] > at > org.apache.jackrabbit.core.fs.db.DbFileSystem.getDataSource(DbFileSystem.java:228) > ~[jackrabbit-standalone.jar:na] > at > org.apache.jackrabbit.core.fs.db.DatabaseFileSystem.init(DatabaseFileSystem.java:187) > ~[jackrabbit-standalone.jar:na] > > As you can see right at the top of repository.xml it has been configured. > And it is working using the java application, just not in the standalone > server. > > > > > 2012/3/7 Mark Herman <[email protected]> > >> >> Stefan Hahn wrote >> > >> > Ok, is this too obvious or too difficult? >> > >> >> Not clear enough. >> >> I've never used JR with PostgreSQL, so I may not be able to help you >> specifically, but you didn't provide enough information for anyone to >> help. >> Specifically, you said: >> >> Stefan Hahn wrote >> > >> > Well, it HAS been configured. >> > >> >> Then explain exactly what you did to configure it, because apparently >> something didn't take. >> >> See also [1] for an example on how to configure it... >> >> [1] http://sling.apache.org/site/jackrabbit-persistence.html >> >> >> -- >> View this message in context: >> http://jackrabbit.510166.n4.nabble.com/Problems-connecting-to-external-Repository-tp4452428p4453481.html >> Sent from the Jackrabbit - Users mailing list archive at Nabble.com. >> > >
