Hi Javier,

in the default installation the database connection is configured using 
the JNDI datasource that is used in Jahia.
Its name is configured as 'datasource.name' in the jahia.properties 
file. If it is specified, other settings have no influence in this case. 
The same datasource is used across all Jahia services.
Its configuration is located in the 
<TOMCAT_HOME>/conf/Catalina/localhost/jahia.xml file (in the default 
installation).

You need to change the datasource configuration in the jahia.xml file 
from HSQL to PostgreSQL, i.e.:

<Context path="/jahia" docBase="jahia" crossContext="true">

    <Manager pathname=""/>

    <Resource name="jdbc/jetspeed" auth="Container"
            factory="org.apache.commons.dbcp.BasicDataSourceFactory"
            type="javax.sql.DataSource" username="jahia_user" 
password="jahia_pass"
            driverClassName="org.postgresql.Driver" 
url="jdbc:postgresql://192.168.1.5:5432/jahia" defaultAutoCommit="true"
            maxActive="100" maxIdle="30" maxWait="10000"/>

    <Resource name="jdbc/jetspeedNonTx" auth="Container"
            factory="org.apache.commons.dbcp.BasicDataSourceFactory"
            type="javax.sql.DataSource" username="jahia_user" 
password="jahia_pass"
            driverClassName="org.postgresql.Driver" 
url="jdbc:postgresql://192.168.1.5:5432/jahia" defaultAutoCommit="true"
            maxActive="20" maxIdle="30" maxWait="10000"/>

</Context>


Kind regards
Sergiy Shyrkov

Javier Turégano wrote:
> Hi all,
>
> We are trying to migrate our actual instalation of Jahia 5 from HSQL to
> Postgresql. After some difficulties we were able to load the hsqldb into
> postgresql.
>
> Then actualized the jahia.properties file this way:
>
> db_script                                              =   postgresql.script
> db_driver                                              =  
> org.postgresql.Driver
> db_url                                                   =   
> jdbc\:postgresql\://192.168.1.5\:5432/jahia
> db_username                                            =   jahia_user
> db_password                                            =   jahia_pass
> db_transactions                                        =   false
> db_support_embedded_select_statement                    =  true
> db_starthsqlserver                                     =   false
>
> And restarted jahia. Also tried the db_url withouth \ . But the jahia host
> is unable to connect to the postgres host. Looked in the lists for that
> kind of problems and we only find one unresolved question about the same
> problem. We have checked that there are no network issues: we were able to
> ask the postgresql server for data from the command line in the jahia
> host.
>
> We found in the catalina.out log surprising things like this:
>
> - dbLocation=/WEB-INF/var/dbdata/hsqldbjahia
> - realPath = /var/jahia/tomcat/webapps/ROOT/WEB-INF/var/dbdata/hsqldbjahia
> - jahia.config=/WEB-INF/etc/config/jahia.properties
> - HSQL server will not be started.
>
> It looks like Jahia still has info about the old hsql database. Any other
> configuration file or parameter we should change?
>
> The errors we can find in the log:
>
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'PlatformConfigurator' defined in ServletContext resource
> [/WEB-INF/etc/jetspeed/conf/assembly/boot/datasource.xml]: Initialization
> of bean failed; nested exception is
> org.apache.ojb.broker.metadata.MetadataException: Could not get the
> metadata from the given datasource
> org.apache.ojb.broker.metadata.MetadataException: Could not get the
> metadata from the given datasource
>         at
> org.apache.ojb.broker.metadata.JdbcMetadataUtils.fillJCDFromDataSource(JdbcMetadataUtils.java:277)
>
> Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create
> PoolableConnectionFactory (socket creation error)
>
> Caused by: java.sql.SQLException: socket creation error
>
>    491 [main] ERROR org.apache.jetspeed.engine.JetspeedEngine.start:130 -
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'PlatformConfigurator' defined in ServletContext
> resource [/WEB-INF/etc/jetspeed/conf/assembly/boot/datasource.xml]:
> Initialization of bean failed; nested exception is
> org.apache.ojb.broker.metadata.MetadataException: Could not get the
> metadata from the given datasource
>    491 [2007-11-12 13:30:49,081]
> [org.apache.jetspeed.engine.JetspeedEngine] ERROR -
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'PlatformConfigurator' defined in ServletContext
> resource [/WEB-INF/etc/jetspeed/conf/assembly/boot/datasource.xml]:
> Initialization of bean failed; nested exception is
> org.apache.ojb.broker.metadata.MetadataException: Could not get the
> metadata from the given datasource
>    493 [2007-11-12 13:30:49,083] [org.jahia.bin.JahiaJetspeedServlet]
> FATAL - Jetspeed: init() failed:
> org.apache.jetspeed.exception.JetspeedException: Jetspeed Initialization
> exception!
>
> Any idea or sugestion to find the problem? If you need more information
> about the instalation just ask for it.
>
> Thank you.
>
> ---------------------------------
> Javier Turégano Molina
> Andago Ingeniería
> www.andago.com
>
>
> _______________________________________________
> install_list mailing list
> [email protected]
> http://lists.jahia.org/cgi-bin/mailman/listinfo/install_list
>
>   

_______________________________________________
install_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/install_list

Reply via email to