Problems with ofbiz and postgreSQL

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems with ofbiz and postgreSQL

stodorov
Hi all,
I need to run the ofbiz on the Postgres DB. Now I am using the
PostgreSQL 8.1.10.
And configured the Entity Engine to use postgres with the following
records in the entityengine.xml:

    <delegator name="default" entity-model-reader="main"
entity-group-reader="main" entity-eca-reader="main"
distributed-cache-clear-enabled="false">
        <group-map group-name="org.ofbiz"
datasource-name="localpostgres"/>
        <group-map group-name="org.ofbiz.olap"
datasource-name="localpostgres"/>
    </delegator>
    <delegator name="default-no-eca" entity-model-reader="main"
entity-group-reader="main" entity-eca-reader="main"
entity-eca-enabled="false" distributed-cache-clear-enabled="false">
        <group-map group-name="org.ofbiz"
datasource-name="localpostgres"/>
        <group-map group-name="org.ofbiz.olap"
datasource-name="localpostgres"/>
    </delegator>

    <!-- be sure that your default delegator (or the one you use) uses
the same datasource for test. You must run "ant run-install" before
running "ant run-tests" -->
    <delegator name="test" entity-model-reader="main"
entity-group-reader="main" entity-eca-reader="main">
        <group-map group-name="org.ofbiz"
datasource-name="localpostgres"/>
        <group-map group-name="org.ofbiz.olap"
datasource-name="localpostgres"/>
    </delegator>
    <delegator name="other" entity-model-reader="main"
entity-group-reader="main" entity-eca-reader="main">
        <group-map group-name="org.ofbiz"
datasource-name="localpostgres"/>        
    </delegator>

And after run-install got errors.

[java] 2008-04-07 13:07:08,871 (main) [
GenericDelegator.java:180:INFO ] Doing database check as requested in
entityengine.xml with addMissing=true
     [java] 2008-04-07 13:07:08,997 (main)
[DBCPConnectionFactory.java:79 :ERROR]
     [java] ---- exception report
----------------------------------------------------------
     [java] Exception: java.lang.ClassNotFoundException
     [java] Message: org.postgresql.Driver
     [java] ---- stack trace
---------------------------------------------------------------
     [java] java.lang.ClassNotFoundException: org.postgresql.Driver
     [java] java.net.URLClassLoader$1.run(URLClassLoader.java:200)
     [java] java.security.AccessController.doPrivileged(Native Method)
     [java] java.net.URLClassLoader.findClass(URLClassLoader.java:188)
     [java] java.lang.ClassLoader.loadClass(ClassLoader.java:306)
     [java]
org.ofbiz.base.util.CachedClassLoader.loadClass(CachedClassLoader.java:179)
     [java]
org.ofbiz.base.util.CachedClassLoader.loadClass(CachedClassLoader.java:154)
     [java]
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
     [java] java.lang.Class.forName0(Native Method)
     [java] java.lang.Class.forName(Class.java:242)
     [java]
org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:77)
     [java]
org.ofbiz.entity.jdbc.ConnectionFactory.getManagedConnection(ConnectionFactory.java:128)
     [java]
org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:92)
     [java]
org.ofbiz.entity.transaction.TransactionFactory.getConnection(TransactionFactory.java:95)
     [java]
org.ofbiz.entity.jdbc.ConnectionFactory.getConnection(ConnectionFactory.java:73)
     [java]
org.ofbiz.entity.jdbc.DatabaseUtil.getConnection(DatabaseUtil.java:98)
     [java]
org.ofbiz.entity.jdbc.DatabaseUtil.getTableNames(DatabaseUtil.java:1056)
     [java]
org.ofbiz.entity.jdbc.DatabaseUtil.checkDb(DatabaseUtil.java:136)
     [java]
org.ofbiz.entity.jdbc.DatabaseUtil.checkDb(DatabaseUtil.java:125)
     [java]
org.ofbiz.entity.datasource.GenericDAO.checkDb(GenericDAO.java:1062)
     [java]
org.ofbiz.entity.datasource.GenericHelperDAO.checkDataSource(GenericHelperDAO.java:195)
     [java]
org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:182)
     [java]
org.ofbiz.entity.GenericDelegator.getGenericDelegator(GenericDelegator.java:118)
     [java]
org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:194)
     [java]
org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:79)
     [java] org.ofbiz.base.start.Start.startStartLoaders(Start.java:261)
     [java] org.ofbiz.base.start.Start.startServer(Start.java:310)
     [java] org.ofbiz.base.start.Start.start(Start.java:314)
     [java] org.ofbiz.base.start.Start.main(Start.java:397)
     [java]
--------------------------------------------------------------------------------
     [java] 2008-04-07 13:07:09,016 (main) [
DatabaseUtil.java:1064:ERROR] Unable to establish a connection with the
database... Error was:org.ofbiz.entity.GenericEntityException:
org.postgresql.Driver (org.postgresql.Driver)
     [java] 2008-04-07 13:07:09,017 (main) [
DatabaseUtil.java:143:ERROR] Could not get table name information from
the database, aborting.

===========================================================================================================================================
     [java] 2008-04-07 13:08:23,944 (main)
[DBCPConnectionFactory.java:79 :ERROR]
     [java] ---- exception report
----------------------------------------------------------
     [java] Exception: java.lang.ClassNotFoundException
     [java] Message: Cached loader got a known bad class name:
org.postgresql.Driver
     [java] ---- stack trace
---------------------------------------------------------------
     [java] java.lang.ClassNotFoundException: Cached loader got a known
bad class name: org.postgresql.Driver
     [java]
org.ofbiz.base.util.CachedClassLoader.loadClass(CachedClassLoader.java:168)
     [java]
org.ofbiz.base.util.CachedClassLoader.loadClass(CachedClassLoader.java:154)
     [java]
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
     [java] java.lang.Class.forName0(Native Method)
     [java] java.lang.Class.forName(Class.java:242)
     [java]
org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:77)
     [java]
org.ofbiz.entity.jdbc.ConnectionFactory.getManagedConnection(ConnectionFactory.java:128)
     [java]
org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:92)
     [java]
org.ofbiz.entity.transaction.TransactionFactory.getConnection(TransactionFactory.java:95)
     [java]
org.ofbiz.entity.jdbc.ConnectionFactory.getConnection(ConnectionFactory.java:73)
     [java]
org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:259)
     [java]
org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:365)
     [java]
org.ofbiz.entity.datasource.GenericDAO.selectCountByCondition(GenericDAO.java:949)
     [java]
org.ofbiz.entity.datasource.GenericHelperDAO.findCountByCondition(GenericHelperDAO.java:149)
     [java]
org.ofbiz.entity.GenericDelegator.findCountByCondition(GenericDelegator.java:2194)
     [java]
org.ofbiz.entity.GenericDelegator.findCountByCondition(GenericDelegator.java:2166)
     [java]
org.ofbiz.entity.GenericDelegator.findCountByAnd(GenericDelegator.java:2161)
     [java]
org.ofbiz.entity.GenericDelegator.findCountByAnd(GenericDelegator.java:2153)
     [java]
org.ofbiz.entity.util.EntityCrypto.<init>(EntityCrypto.java:59)
     [java]
org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:195)
     [java]
org.ofbiz.entity.GenericDelegator.getGenericDelegator(GenericDelegator.java:118)
     [java]
org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:194)
     [java]
org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:79)
     [java] org.ofbiz.base.start.Start.startStartLoaders(Start.java:261)
     [java] org.ofbiz.base.start.Start.startServer(Start.java:310)
     [java] org.ofbiz.base.start.Start.start(Start.java:314)
     [java] org.ofbiz.base.start.Start.main(Start.java:397)
     [java]
--------------------------------------------------------------------------------
     [java] 2008-04-07 13:08:23,947 (main) [
GenericDelegator.java:2200:ERROR]
     [java] ---- exception report
----------------------------------------------------------
     [java] Failure in findListIteratorByCondition operation for entity
[DynamicView]: org.ofbiz.entity.GenericEntityException: Cached loader
got a known bad class name: org.postgresql.Driver (Cached loader got a
known bad class name: org.postgresql.Driver). Rolling back transaction.
     [java] Exception: org.ofbiz.entity.GenericEntityException
     [java] Message: Cached loader got a known bad class name:
org.postgresql.Driver (Cached loader got a known bad class name:
org.postgresql.Driver)
     [java] ---- stack trace
---------------------------------------------------------------
     [java] org.ofbiz.entity.GenericEntityException: Cached loader got a
known bad class name: org.postgresql.Driver (Cached loader got a known
bad class name: org.postgresql.Driver)

I will appreciate all advices about these errors,
Thanks!
Stanimir

Reply | Threaded
Open this post in threaded view
|

Re: Problems with ofbiz and postgreSQL

Mark-2
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Problems with ofbiz and postgreSQL

stodorov
Mark thanks for the fast answer.
Next time I have to read more careful the ofbiz guides.
Thanks, Stanimir!

On Mon, 2008-04-07 at 13:09 +0200, Mark Ellul wrote:

> Have you copied the postgres jar into the correct folder? (<ofbiz
> dir>/framework/entity/lib)?
>
> On Mon, Apr 7, 2008 at 12:42 PM, Stanimir Todorov
> <[hidden email]> wrote:
>         Hi all,
>         I need to run the ofbiz on the Postgres DB. Now I am using the
>         PostgreSQL 8.1.10.
>         And configured the Entity Engine to use postgres with the
>         following
>         records in the entityengine.xml:
>        
>            <delegator name="default" entity-model-reader="main"
>         entity-group-reader="main" entity-eca-reader="main"
>         distributed-cache-clear-enabled="false">
>                <group-map group-name="org.ofbiz"
>         datasource-name="localpostgres"/>
>                <group-map group-name="org.ofbiz.olap"
>         datasource-name="localpostgres"/>
>            </delegator>
>            <delegator name="default-no-eca" entity-model-reader="main"
>         entity-group-reader="main" entity-eca-reader="main"
>         entity-eca-enabled="false"
>         distributed-cache-clear-enabled="false">
>                <group-map group-name="org.ofbiz"
>         datasource-name="localpostgres"/>
>                <group-map group-name="org.ofbiz.olap"
>         datasource-name="localpostgres"/>
>            </delegator>
>        
>            <!-- be sure that your default delegator (or the one you
>         use) uses
>         the same datasource for test. You must run "ant run-install"
>         before
>         running "ant run-tests" -->
>            <delegator name="test" entity-model-reader="main"
>         entity-group-reader="main" entity-eca-reader="main">
>                <group-map group-name="org.ofbiz"
>         datasource-name="localpostgres"/>
>                <group-map group-name="org.ofbiz.olap"
>         datasource-name="localpostgres"/>
>            </delegator>
>            <delegator name="other" entity-model-reader="main"
>         entity-group-reader="main" entity-eca-reader="main">
>                <group-map group-name="org.ofbiz"
>         datasource-name="localpostgres"/>
>            </delegator>
>        
>         And after run-install got errors.
>        
>         [java] 2008-04-07 13:07:08,871 (main) [
>         GenericDelegator.java:180:INFO ] Doing database check as
>         requested in
>         entityengine.xml with addMissing=true
>             [java] 2008-04-07 13:07:08,997 (main)
>         [DBCPConnectionFactory.java:79 :ERROR]
>             [java] ---- exception report
>         ----------------------------------------------------------
>             [java] Exception: java.lang.ClassNotFoundException
>             [java] Message: org.postgresql.Driver
>             [java] ---- stack trace
>         ---------------------------------------------------------------
>             [java] java.lang.ClassNotFoundException:
>         org.postgresql.Driver
>             [java] java.net.URLClassLoader
>         $1.run(URLClassLoader.java:200)
>             [java] java.security.AccessController.doPrivileged(Native
>         Method)
>             [java]
>         java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>             [java]
>         java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>             [java]
>         org.ofbiz.base.util.CachedClassLoader.loadClass(CachedClassLoader.java:179)
>             [java]
>         org.ofbiz.base.util.CachedClassLoader.loadClass(CachedClassLoader.java:154)
>             [java]
>         java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>             [java] java.lang.Class.forName0(Native Method)
>             [java] java.lang.Class.forName(Class.java:242)
>             [java]
>         org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:77)
>             [java]
>         org.ofbiz.entity.jdbc.ConnectionFactory.getManagedConnection(ConnectionFactory.java:128)
>             [java]
>         org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:92)
>             [java]
>         org.ofbiz.entity.transaction.TransactionFactory.getConnection(TransactionFactory.java:95)
>             [java]
>         org.ofbiz.entity.jdbc.ConnectionFactory.getConnection(ConnectionFactory.java:73)
>             [java]
>         org.ofbiz.entity.jdbc.DatabaseUtil.getConnection(DatabaseUtil.java:98)
>             [java]
>         org.ofbiz.entity.jdbc.DatabaseUtil.getTableNames(DatabaseUtil.java:1056)
>             [java]
>         org.ofbiz.entity.jdbc.DatabaseUtil.checkDb(DatabaseUtil.java:136)
>             [java]
>         org.ofbiz.entity.jdbc.DatabaseUtil.checkDb(DatabaseUtil.java:125)
>             [java]
>         org.ofbiz.entity.datasource.GenericDAO.checkDb(GenericDAO.java:1062)
>             [java]
>         org.ofbiz.entity.datasource.GenericHelperDAO.checkDataSource(GenericHelperDAO.java:195)
>             [java]
>         org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:182)
>             [java]
>         org.ofbiz.entity.GenericDelegator.getGenericDelegator(GenericDelegator.java:118)
>             [java]
>         org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:194)
>             [java]
>         org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:79)
>             [java]
>         org.ofbiz.base.start.Start.startStartLoaders(Start.java:261)
>             [java]
>         org.ofbiz.base.start.Start.startServer(Start.java:310)
>             [java] org.ofbiz.base.start.Start.start(Start.java:314)
>             [java] org.ofbiz.base.start.Start.main(Start.java:397)
>             [java]
>         --------------------------------------------------------------------------------
>             [java] 2008-04-07 13:07:09,016 (main) [
>         DatabaseUtil.java:1064:ERROR] Unable to establish a connection
>         with the
>         database... Error was:org.ofbiz.entity.GenericEntityException:
>         org.postgresql.Driver (org.postgresql.Driver)
>             [java] 2008-04-07 13:07:09,017 (main) [
>         DatabaseUtil.java:143:ERROR] Could not get table name
>         information from
>         the database, aborting.
>        
>         ===========================================================================================================================================
>             [java] 2008-04-07 13:08:23,944 (main)
>         [DBCPConnectionFactory.java:79 :ERROR]
>             [java] ---- exception report
>         ----------------------------------------------------------
>             [java] Exception: java.lang.ClassNotFoundException
>             [java] Message: Cached loader got a known bad class name:
>         org.postgresql.Driver
>             [java] ---- stack trace
>         ---------------------------------------------------------------
>             [java] java.lang.ClassNotFoundException: Cached loader got
>         a known
>         bad class name: org.postgresql.Driver
>             [java]
>         org.ofbiz.base.util.CachedClassLoader.loadClass(CachedClassLoader.java:168)
>             [java]
>         org.ofbiz.base.util.CachedClassLoader.loadClass(CachedClassLoader.java:154)
>             [java]
>         java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>             [java] java.lang.Class.forName0(Native Method)
>             [java] java.lang.Class.forName(Class.java:242)
>             [java]
>         org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:77)
>             [java]
>         org.ofbiz.entity.jdbc.ConnectionFactory.getManagedConnection(ConnectionFactory.java:128)
>             [java]
>         org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:92)
>             [java]
>         org.ofbiz.entity.transaction.TransactionFactory.getConnection(TransactionFactory.java:95)
>             [java]
>         org.ofbiz.entity.jdbc.ConnectionFactory.getConnection(ConnectionFactory.java:73)
>             [java]
>         org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:259)
>             [java]
>         org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:365)
>             [java]
>         org.ofbiz.entity.datasource.GenericDAO.selectCountByCondition(GenericDAO.java:949)
>             [java]
>         org.ofbiz.entity.datasource.GenericHelperDAO.findCountByCondition(GenericHelperDAO.java:149)
>             [java]
>         org.ofbiz.entity.GenericDelegator.findCountByCondition(GenericDelegator.java:2194)
>             [java]
>         org.ofbiz.entity.GenericDelegator.findCountByCondition(GenericDelegator.java:2166)
>             [java]
>         org.ofbiz.entity.GenericDelegator.findCountByAnd(GenericDelegator.java:2161)
>             [java]
>         org.ofbiz.entity.GenericDelegator.findCountByAnd(GenericDelegator.java:2153)
>             [java]
>         org.ofbiz.entity.util.EntityCrypto.<init>(EntityCrypto.java:59)
>             [java]
>         org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:195)
>             [java]
>         org.ofbiz.entity.GenericDelegator.getGenericDelegator(GenericDelegator.java:118)
>             [java]
>         org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:194)
>             [java]
>         org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:79)
>             [java]
>         org.ofbiz.base.start.Start.startStartLoaders(Start.java:261)
>             [java]
>         org.ofbiz.base.start.Start.startServer(Start.java:310)
>             [java] org.ofbiz.base.start.Start.start(Start.java:314)
>             [java] org.ofbiz.base.start.Start.main(Start.java:397)
>             [java]
>         --------------------------------------------------------------------------------
>             [java] 2008-04-07 13:08:23,947 (main) [
>         GenericDelegator.java:2200:ERROR]
>             [java] ---- exception report
>         ----------------------------------------------------------
>             [java] Failure in findListIteratorByCondition operation
>         for entity
>         [DynamicView]: org.ofbiz.entity.GenericEntityException: Cached
>         loader
>         got a known bad class name: org.postgresql.Driver (Cached
>         loader got a
>         known bad class name: org.postgresql.Driver). Rolling back
>         transaction.
>             [java] Exception: org.ofbiz.entity.GenericEntityException
>             [java] Message: Cached loader got a known bad class name:
>         org.postgresql.Driver (Cached loader got a known bad class
>         name:
>         org.postgresql.Driver)
>             [java] ---- stack trace
>         ---------------------------------------------------------------
>             [java] org.ofbiz.entity.GenericEntityException: Cached
>         loader got a
>         known bad class name: org.postgresql.Driver (Cached loader got
>         a known
>         bad class name: org.postgresql.Driver)
>        
>         I will appreciate all advices about these errors,
>         Thanks!
>         Stanimir
>        
>