cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco + PostgreSQL installation

melkor_kp
Champ in-the-making
Champ in-the-making
I installed the alfresco 2.0 preview with the default database version.
At the beginning I experienced some problems with alfresco (in a debian based).
After installing the jdk 1.5 on a creating the deb java package, defining
a the JAVA_HOME system variable and adding the java programs to the system path
everything works fine.

I have a problem now because I have to change the default database to a postgres
one. I followed the wiki instructions but the database migration is not working.
In the alfresco.log I receive a message of unauthorized schema.

Does anybody knows what is happening?
15 REPLIES 15

kevinr
Star Contributor
Star Contributor
For MySQL you need to execute commands to give access to the schema from the server machine i.e. something like this:

grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;
grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;

Can you execute the equivilent commands for PostgreSQL?

Thanks,

Kevin

melkor_kp
Champ in-the-making
Champ in-the-making
I solved this using the postgres query:

grant all on database alfresco to alfresco;

At the moment the alfresco.log is showing another error:

ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schemaBootst
rap' defined in class path resource [alfresco/bootstrap-context.xml]: Can't resolve reference to bea
n '&sessionFactory' while setting property 'localSessionFactory'; nested exception is org.springfram
ework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in
class path resource [alfresco/hibernate-context.xml]: Initialization of bean failed; nested excepti
on is org.hibernate.HibernateException: Dialect class not found: org.hibernate.dialect.PostgreSQLDia
lect
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto
ry' defined in class path resource [alfresco/hibernate-context.xml]: Initialization of bean failed;
nested exception is org.hibernate.HibernateException: Dialect class not found: org.hibernate.dialect
.PostgreSQLDialect

derek
Star Contributor
Star Contributor
Post a copy of the contents of your renamed custom-hibernate-dialect.properties.sample, please.  Make sure there are no spaces before or after the property values.

Regards

melkor_kp
Champ in-the-making
Champ in-the-making
This is the file /usr/local/alfresco/tomcat/shared/classes/alfresco/extension/custom-hibernate-dialect.properties

#
# PostgresSQL dialect

#
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect


#

But this is errors are from version 1.4 only the first post was 2.0 preview.
If I make the version 1.4 working I will move to preview 2.0 and 2.0 because
we are very interested in the pair alfresco + postgres.

derek
Star Contributor
Star Contributor
Was there an extra space after the dialect class in the properties file?

melkor_kp
Champ in-the-making
Champ in-the-making
This is all my custom-hibernate-dialect.properties

hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect

The problem is still unsolved.
When I access the tomcat alfresco resource http://localhost:8080/alfresco/  I get:

The resource is not available

derek
Star Contributor
Star Contributor
Hi,

    What version of Tomcat are you using?
    Exactly which file did you use to install Alfresco (filename and downloaded from)?
    Can you double check that there is exactly one Hibernate jar present in the installation and that it is in the alfresco web application WEB-INF/lib.
    What version of the jar is it, i.e. what does it say in the manifest file?
    Is the PostgreSQLDialect in the jar?

melkor_kp
Champ in-the-making
Champ in-the-making
I installed alfresco using                                                                      AlfrescoCommunity-1.4-Linux-x86-Install downloaded from alfresco webpage.
the tomcat version is built in this binary, I guess is version 5.0 but I am not sure.
Here is the only hibernate file that I found.
/usr/local/alfresco/tomcat/webapps/alfresco/WEB-INF/lib/hibernate-3.1.3.jar
The manifest file is the following and it is stored in
/usr/local/alfresco/openoffice.org2.0/share/dtd/officedocument/1_0/Manifest.dtd:

<!–

    OpenOffice.org - a multi-platform office productivity suite

    $RCSfile: Manifest.dtd,v $

    $Revision: 1.9 $

    last change: $Author: rt $ $Date: 2005/09/08 15:53:54 $

    The Contents of this file are made available subject to
    the terms of GNU Lesser General Public License Version 2.1.


      GNU Lesser General Public License Version 2.1
      =============================================
      Copyright 2005 by Sun Microsystems, Inc.
      901 San Antonio Road, Palo Alto, CA 94303, USA

      This library is free software; you can redistribute it and/or
      modify it under the terms of the GNU Lesser General Public
      License version 2.1, as published by the Free Software Foundation.

      This library is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      Lesser General Public License for more details.

      You should have received a copy of the GNU Lesser General Public
      License along with this library; if not, write to the Free Software
      Foundation, Inc., 59 Temple Place, Suite 330, Boston,
      MA  02111-1307  USA

–>
<!ELEMENT manifest:manifest (manifest:file-entry+)>
<!ATTLIST manifest:manifest xmlns:manifest CDATA #FIXED "http://openoffice.org/2001/manifest">

<!ELEMENT manifest:file-entry (manifest:encryption-data?)>
<!– manifest:size is usually only specified for encrypted entries –>
<!ATTLIST manifest:file-entry
        manifest:full-path CDATA #REQUIRED
        manifest:size CDATA #IMPLIED
        manifest:media-type CDATA #REQUIRED
>

<!ELEMENT manifest:encryption-data (manifest:algoritm,manifest:key-derivation)>
<!ATTLIST manifest:encryption-data
        manifest:checksum-type CDATA #REQUIRED
        manifest:checksum CDATA #REQUIRED >
<!– algoritm-name specifies the name of the algoritm used to encrypt
         the stream, for example Blowfish
         manifest:initialisation-vector is stored encoded in Base64 –>
<!ELEMENT manifest:algoritm EMPTY>
<!ATTLIST manifest:algoritm
        manifest:algoritm-name CDATA #REQUIRED
        manifest:initialisation-vector CDATA #REQUIRED>

<!ELEMENT manifest:key-derivation EMPTY>
<!– manifest:key-derivation-name specifies the name of the algoritm used to derive
         the key, for example PBKDF2 (see rfc 2898 )
         manifest:salt is stored encoded in Base64 –>
<!ATTLIST manifest:key-derivation
        manifest:key-derivation-name CDATA #REQUIRED
        manifest:salt CDATA #REQUIRED
        manifest:iteration-count CDATA #REQUIRED>
I changed the word algoritm in the manifest file because the right one is
considered spam in this forum. The right file has the word written properly.
Here is the jar file
/usr/local/alfresco/tomcat/common/lib/postgresql-8.1-408.jdbc3.jar
I am using the postgres version 8.1.4.
If you need more data just ask me.

derek
Star Contributor
Star Contributor
Hi,

Also, which flavour of linux are you using?
http://forums.alfresco.com/viewtopic.php?t=5051&view=next.

Did you check if the PostgreSQLDialect class was in the Hibernate jar?

Regards