Hello again, I fixed the problem with jackrabbit and Postgres seems to be working properly and saving data properly.
Thanks & Regards, Meenakshi On Tue, Aug 24, 2010 at 2:45 PM, Meenakshi Khatri <[email protected]>wrote: > Hi Thomas, > > Thanks for your reply. Could you please also help me with the second > problem, which is that why it doesnt create tables in the Postgres database? > > Is there some work around it? I have actually spend few days trying to get > this working and it is becomign very tricky to create tables in the postgres > database. > > Thanks and Regards, > Meenakshi > > On Tue, Aug 24, 2010 at 1:33 PM, Thomas Müller > <[email protected]>wrote: > >> Hi, >> >> I think you can ignore this warning. It looks like the reason is that >> PostgreSQL is not supported in ConnectionFactory.guessValidationQuery, >> which should also contain: >> >> } else if (url.contains("postgresql")) { >> return "select 1"; >> >> Regards, >> Thomas >> >> On Fri, Aug 20, 2010 at 3:37 PM, Meenakshi Khatri <[email protected]> >> wrote: >> > Hi Thomas, >> > >> > Thanks for your reply. I did made those changes, and one of the error >> > disappeared. [ERROR: type "varbinary" does not exist] But I still get a >> > warning message: >> > >> > WARN [org.apache.jackrabbit.core.util.db.ConnectionFactory] (main) >> Failed >> > to guess validation query for URL >> jdbc:postgresql://localhost:5432/database >> > >> > In my postgres-ds.xml file which is inside jboss/server/default/deploy >> > folder, My settings are as follows: >> > >> >> >> >> <datasources> >> >> <local-tx-datasource> >> >> <jndi-name>DefaultDS</jndi-name> >> >> >> >> >> <connection-url>jdbc:postgresql://localhost:5432/database</connection-url> >> >> <driver-class>org.postgresql.Driver</driver-class> >> >> <user-name>username</user-name> >> >> <password>password</password> >> >> <new-connection-sql>select 1</new-connection-sql> >> >> <check-valid-connection-sql>select 1</check-valid-connection-sql> >> >> <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml >> >> (optional) --> >> >> <metadata> >> >> <type-mapping>PostgreSQL 8.0</type-mapping> >> >> </metadata> >> >> </local-tx-datasource> >> >> </datasources> >> > >> > I assume that when we switch from derby to postgres, Jackrabbit's >> repository >> > file should automatically create the tables in the database. But, I dont >> see >> > any tables in my database. I do see that jackrabbit connects to Postgres >> > properly >> > >> >> >> >> WARN [ConnectionFactory] Failed to guess validation query for URL >> >> jdbc:postgresql://localhost:5432/factsheet >> >> INFO [NodeTypeRegistry] no custom node type definitions found >> >> INFO [DatabasePersistenceManager] Database: PostgreSQL / 8.4.4 >> >> INFO [DatabasePersistenceManager] Driver: PostgreSQL Native Driver / >> >> PostgreSQL 8.4 JDBC4 (build 701) >> >> INFO [RepositoryImpl] initializing workspace 'default'... >> >> INFO [DatabasePersistenceManager] Database: PostgreSQL / 8.4.4 >> >> INFO [DatabasePersistenceManager] Driver: PostgreSQL Native Driver / >> >> PostgreSQL 8.4 JDBC4 (build 701) >> >> INFO [LocalFileSystem] LocalFileSystem initialized at path >> >> \jackrabbit\workspaces\default\blobs >> >> INFO [SearchIndex] Index initialized: /jackrabbit/repository/index >> >> Version: 3 >> >> INFO [SearchIndex] Index initialized: >> >> \jackrabbit\workspaces\default/index Version: 3 >> >> INFO [RepositoryImpl] workspace 'default' initialized >> >> INFO [RepositoryImpl] Repository started >> >> INFO [TransientRepository] Transient repository initialized >> >> INFO [RepositoryImpl] initializing workspace 'security'... >> >> INFO [DatabasePersistenceManager] Database: PostgreSQL / 8.4.4 >> >> INFO [DatabasePersistenceManager] Driver: PostgreSQL Native Driver / >> >> PostgreSQL 8.4 JDBC4 (build 701) >> >> INFO [LocalFileSystem] LocalFileSystem initialized at path >> >> \jackrabbit\workspaces\security\blobs >> >> INFO [SearchIndex] Index initialized: >> >> \jackrabbit\workspaces\security/index Version: 3 >> >> INFO [RepositoryImpl] workspace 'security' initialized >> > >> > I think that my <param name="schemaObjectPrefix" value="public" /> field >> is >> > not defined properly. >> > >> > Could you please help me on this? >> > >> > Thanks & Regards, >> > Meenakshi >> > >> > On Thu, Aug 19, 2010 at 10:19 AM, Thomas Müller <[email protected] >> > >> > wrote: >> >> >> >> Hi, >> >> >> >> In the FileSystem entry, you need add: >> >> <param name="schema" value="postgresql"/> >> >> >> >> Regards, >> >> Thomas >> >> >> >> On Wed, Aug 18, 2010 at 5:54 PM, Meenakshi Khatri < >> [email protected]> >> >> wrote: >> >> > Hello everyone, >> >> > >> >> > I am a beginner with Jackrabbit and am currently replacing Derby with >> >> > Postgres 8.4 >> >> > >> >> > I was initially facing errors with Jboss but after making the change, >> >> > Jboss >> >> > is able to set the Postgres JNDI name properly. >> >> > >> >> > I was searching thru the mailing list of Jackrabbit but I hardly came >> >> > across >> >> > any dicsussion which might help me solve this problem. >> >> > >> >> > I have made the necessary changes in my repository.xml file but I get >> >> > the >> >> > following error when I run my application with Jboss. >> >> > >> >> > >> >> >> INFO [org.apache.jackrabbit.core.RepositoryImpl] (main) Starting >> >> >> repository... >> >> >> *WARN [org.apache.jackrabbit.core.util.db.ConnectionFactory] (main) >> >> >> Failed to guess validation query for URL >> >> >> jdbc:postgresql://localhost:5432/database* >> >> > >> >> > * ERROR [org.apache.jackrabbit.core.util.db.ConnectionHelper] (main) >> >> > Failed >> >> >> to execute SQL (stacktrace on DEBUG log level) >> >> >> org.postgresql.util.PSQLException: ERROR: type "varbinary" does not >> >> >> exist* >> >> >> Position: 98 >> >> >> at >> >> >> >> >> >> >> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) >> >> >> at >> >> >> >> >> >> >> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795) >> >> >> at >> >> >> >> >> >> >> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) >> >> >> at >> >> >> >> >> >> >> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479) >> >> >> at >> >> >> >> >> >> >> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353) >> >> >> at >> >> >> >> >> >> >> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:345) >> >> >> at >> >> >> >> >> >> >> org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) >> >> >> at >> >> >> >> >> >> >> org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) >> >> > >> >> > ..... >> >> > >> >> > I have made the following changes in the repository.xml file to >> replace >> >> > Derby with Postgres. >> >> > >> >> >> <Repository> >> >> >> <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> >> >> >> <param name="driver" value="org.postgresql.Driver"/> >> >> >> <param name="url" >> value="jdbc:postgresql://localhost:5432/database"/> >> >> >> <param name="user" value="username"/> >> >> >> <param name="password" value="password"/> >> >> >> </FileSystem> >> >> >> >> >> >> <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore"> >> >> >> <param name="driver" value="org.postgresql.Driver"/> >> >> >> <param name="url" >> value="jdbc:postgresql://localhost:5432/database"/> >> >> >> <param name="user" value="username"/> >> >> >> <param name="password" value="password"/> >> >> >> <param name="databaseType" value="postgresql"/> >> >> >> </DataStore> >> >> >> >> >> >> <SecurityManager >> >> >> >> >> >> >> class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager" >> >> >> workspaceName="security"> >> >> >> </SecurityManager> >> >> >> >> >> >> <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"> >> >> >> <param name="anonymousId" value="anonymous"/> >> >> >> <param name="adminId" value="admin"/> >> >> >> </LoginModule> >> >> >> </Security> >> >> >> >> >> >> <Workspaces rootPath="${rep.home}/workspaces" >> >> >> defaultWorkspace="default"/> >> >> >> <Workspace name="${wsp.name}"> >> >> >> <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> >> >> >> <param name="driver" value="org.postgresql.Driver"/> >> >> >> <param name="url" >> value="jdbc:postgresql://localhost:5432/database"/> >> >> >> <param name="user" value="username"/> >> >> >> <param name="password" value="password"/> >> >> >> </FileSystem> >> >> >> >> >> > <PersistenceManager >> >> >> >> >> >> >> class="org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager"> >> >> >> <param name="driver" value="org.postgresql.Driver"/> >> >> >> <param name="url" >> value="jdbc:postgresql://localhost:5432/database"/> >> >> >> <param name="user" value="username"/> >> >> >> <param name="password" value="password"/> >> >> >> <param name="schema" value="postgresql"/> >> >> >> <param name="schemaObjectPrefix" value="public" /> >> >> >> <param name="externalBLOBs" value="false"/> >> >> >> </PersistenceManager> >> >> >> >> >> >> <SearchIndex >> >> >> class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> >> >> >> <param name="path" value="${wsp.home}/index"/> >> >> >> <param name="supportHighlighting" value="true"/> >> >> >> </SearchIndex> >> >> >> </Workspace> >> >> >> >> >> >> <Versioning rootPath="${rep.home}/version"> >> >> >> <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> >> >> >> <param name="driver" value="org.postgresql.Driver"/> >> >> >> <param name="url" >> value="jdbc:postgresql://localhost:5432/database"/> >> >> >> <param name="user" value="username"/> >> >> >> <param name="password" value="password"/> >> >> >> </FileSystem> >> >> >> >> >> >> <PersistenceManager >> >> >> >> >> >> >> class="org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager"> >> >> >> <param name="driver" value="org.postgresql.Driver"/> >> >> >> <param name="url" >> value="jdbc:postgresql://localhost:5432/database"/> >> >> >> <param name="user" value="username"/> >> >> >> <param name="password" value="password"/> >> >> >> <param name="schema" value="postgresql"/> >> >> >> <param name="schemaObjectPrefix" value="public" /> >> >> >> <param name="externalBLOBs" value="false"/> >> >> >> </PersistenceManager> >> >> >> >> >> >> </Versioning> >> >> >> >> >> >> <SearchIndex >> >> >> class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> >> >> >> <param name="path" value="${rep.home}/repository/index"/> >> >> >> <param name="supportHighlighting" value="true"/> >> >> >> </SearchIndex> >> >> >> </Repository> >> >> >> >> >> > >> >> > Also, I read somewhere in one of the mailing list that I need to >> change >> >> > even >> >> > workspace.xml file so my workspace.xml file inside /workspace/default >> >> > folder >> >> > and /workspace/security folder looks like this >> >> > >> >> > >> >> >> <?xml version="1.0" encoding="UTF-8"?> >> >> >> <Workspace name="default"> >> >> >> >> >> >> <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> >> >> >> <param name="driver" value="org.postgresql.Driver"/> >> >> >> <param name="url" >> value="jdbc:postgresql://localhost:5432/database"/> >> >> >> <param name="user" value="username"/> >> >> >> <param name="password" value="password"/> >> >> >> </FileSystem> >> >> >> >> >> >> <PersistenceManager >> >> >> >> >> >> >> class="org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager"> >> >> >> <param name="driver" value="org.postgresql.Driver"/> >> >> >> <param name="url" >> value="jdbc:postgresql://localhost:5432/database"/> >> >> >> <param name="user" value="username"/> >> >> >> <param name="password" value="password"/> >> >> >> <param name="schema" value="postgresql"/> >> >> >> </PersistenceManager> >> >> >> >> >> >> <SearchIndex >> >> >> class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> >> >> >> <param name="path" value="${wsp.home}/index"/> >> >> >> <param name="extractorPoolSize" value="2"/> >> >> >> <param name="supportHighlighting" value="true"/> >> >> >> </SearchIndex> >> >> >> </Workspace> >> >> >> >> >> > >> >> > Can someone please help me and guide me on how to solve this problem? >> >> > What >> >> > am I missing ? >> >> > >> >> > Thanks in advace, >> >> > >> >> > Meenakshi >> >> > >> > >> > >> > >
