Problem with entity engine (trunk)

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

Problem with entity engine (trunk)

Fabian Gorsler-2
Hi,

we're just evaluating OFBiz for a bigger project. First of all: OFBiz seems to be fantastic, but please, care for more documentation. I'd like to help you, but actually I don't know where to start, because our project has a higher priority and I don't think I know already enough about OFBiz... I hope our training DVDs will arrive soon.

But now to my problem: I'm using OFBiz from trunk (last update yesterday / 2006-07-06), having a Postgres-DB connected to it and trying to learn and use OFBiz. I've created a new project in hot-deploy and have defined three entities, one service in minilang and created two widgets. Up to now this is not much, but there are some errors with the entities and I have no idea how to handle them. I've checked everything twice, but I think I'm lost between all of those XML-files. ;)

All other entities defined by the OFBiz default distribution are created and managed properly. After deleting the my tables from the database they are recreated without any problems. So there must be an error in the internal entity management. Did I miss a parameter? Or is there anything else?

TIA

Best regards,
Fabian.

PS: If you need more log- or config-files, I'll send them.

---- From console.log: ----
*snip*
4570  (main) [            UtilXml.java:263:DEBUG] XML Read 0.015s: D:/dev/eclipse_workspace/ofbiz/hot-deploy/srm/entitydef/entitymodel.xm
*snip*
5348  (main) [            UtilXml.java:263:DEBUG] XML Read 0.0s: D:/dev/eclipse_workspace/ofbiz/hot-deploy/srm/entitydef/entitygroup.xml
*snip*
5783  (main) [   GenericDelegator.java:176:INFO ] Delegator "default" initializing helper "localpostgres" for entity group "org.ofbiz".
5799  (main) [   GenericDelegator.java:193:INFO ] Doing database check as requested in entityengine.xml with addMissing=true
6560  (main) [       DatabaseUtil.java:765:INFO ] Database Product Name is PostgreSQL
6560  (main) [       DatabaseUtil.java:766:INFO ] Database Product Version is 8.1.4
6560  (main) [       DatabaseUtil.java:774:INFO ] Database Driver Name is PostgreSQL Native Driver
6576  (main) [       DatabaseUtil.java:775:INFO ] Database Driver Version is PostgreSQL 8.1 JDBC3 with SSL (build 405)
6576  (main) [       DatabaseUtil.java:776:INFO ] Database Driver JDBC Version is 3.0
6576  (main) [       DatabaseUtil.java:786:INFO ] Database Setting/Support Information (those with a * should be true):
6576  (main) [       DatabaseUtil.java:787:INFO ] - supports transactions    [true]*
6576  (main) [       DatabaseUtil.java:788:INFO ] - isolation None           [false]
6576  (main) [       DatabaseUtil.java:789:INFO ] - isolation ReadCommitted  [true]
6576  (main) [       DatabaseUtil.java:790:INFO ] - isolation ReadUncommitted[true]
6576  (main) [       DatabaseUtil.java:791:INFO ] - isolation RepeatableRead [true]
6592  (main) [       DatabaseUtil.java:792:INFO ] - isolation Serializable   [true]
6592  (main) [       DatabaseUtil.java:793:INFO ] - default fetchsize        [0]
6592  (main) [       DatabaseUtil.java:794:INFO ] - forward only type        [true]
6592  (main) [       DatabaseUtil.java:795:INFO ] - scroll sensitive type    [false]
6592  (main) [       DatabaseUtil.java:796:INFO ] - scroll insensitive type  [true]
6592  (main) [       DatabaseUtil.java:797:INFO ] - is case sensitive        [false]
6592  (main) [       DatabaseUtil.java:798:INFO ] - stores LowerCase         [true]
6592  (main) [       DatabaseUtil.java:799:INFO ] - stores MixedCase         [false]
6592  (main) [       DatabaseUtil.java:800:INFO ] - stores UpperCase         [false]
6669  (main) [       DatabaseUtil.java:801:INFO ] - max table name length    [63]
6669  (main) [       DatabaseUtil.java:802:INFO ] - max column name length   [63]
6669  (main) [       DatabaseUtil.java:803:INFO ] - max schema name length   [63]
6669  (main) [       DatabaseUtil.java:804:INFO ] - concurrent connections   [8192]
6669  (main) [       DatabaseUtil.java:805:INFO ] - concurrent statements    [1]
6669  (main) [       DatabaseUtil.java:806:INFO ] - ANSI SQL92 Entry         [true]
6669  (main) [       DatabaseUtil.java:807:INFO ] - ANSI SQL92 Itermediate   [false]
6669  (main) [       DatabaseUtil.java:808:INFO ] - ANSI SQL92 Full          [false]
6669  (main) [       DatabaseUtil.java:809:INFO ] - ODBC SQL Grammar Core    [false]
6669  (main) [       DatabaseUtil.java:810:INFO ] - ODBC SQL Grammar Extended[false]
6669  (main) [       DatabaseUtil.java:811:INFO ] - ODBC SQL Grammar Minimum [true]
6669  (main) [       DatabaseUtil.java:812:INFO ] - outer joins              [true]*
6669  (main) [       DatabaseUtil.java:813:INFO ] - limited outer joins      [true]
6669  (main) [       DatabaseUtil.java:814:INFO ] - full outer joins         [true]
6669  (main) [       DatabaseUtil.java:815:INFO ] - group by                 [true]*
6669  (main) [       DatabaseUtil.java:816:INFO ] - group by not in select   [true]
6669  (main) [       DatabaseUtil.java:817:INFO ] - column aliasing          [true]
6669  (main) [       DatabaseUtil.java:818:INFO ] - order by not in select   [true]
6669  (main) [       DatabaseUtil.java:820:INFO ] - alter table add column   [true]*
6669  (main) [       DatabaseUtil.java:821:INFO ] - non-nullable column      [true]*
6669  (main) [       DatabaseUtil.java:858:INFO ] Getting Table Info From Database
6809  (main) [       DatabaseUtil.java:993:INFO ] Getting Column Info From Database
*snip*
8582  (main) [       DatabaseUtil.java:356:WARN ] Entity [SrmUserDetails] has no table in the database
8613  (main) [       DatabaseUtil.java:364:ERROR] Could not create table [srm.SRM_USER_DETAILS]: SQL Exception while executing the following:
CREATE TABLE srm.SRM_USER_DETAILS (USER_ID VARCHAR(20) NOT NULL, USER_DETAIL_ID VARCHAR(20) NOT NULL, USER_TYPE_ID VARCHAR(20), USER_FIRST_NAME VARCHAR(60), USER_LAST_NAME VARCHAR(60), USER_PHONE VARCHAR(60), LAST_UPDATED_STAMP TIMESTAMPTZ, LAST_UPDATED_TX_STAMP TIMESTAMPTZ, CREATED_STAMP TIMESTAMPTZ, CREATED_TX_STAMP TIMESTAMPTZ, CONSTRAINT PK_SRM_USER_DETAILS PRIMARY KEY (USER_ID, USER_DETAIL_ID))
Error was: org.postgresql.util.PSQLException: ERROR: relation "srm_user_details" already exists
8613  (main) [       DatabaseUtil.java:356:WARN ] Entity [SrmUserLogins] has no table in the database
8613  (main) [       DatabaseUtil.java:364:ERROR] Could not create table [srm.SRM_USER_LOGINS]: SQL Exception while executing the following:
CREATE TABLE srm.SRM_USER_LOGINS (USER_ID VARCHAR(20) NOT NULL, USER_TYPE_ID VARCHAR(20), USER_LOGIN VARCHAR(60), USER_PASSWORD VARCHAR(60), LAST_UPDATED_STAMP TIMESTAMPTZ, LAST_UPDATED_TX_STAMP TIMESTAMPTZ, CREATED_STAMP TIMESTAMPTZ, CREATED_TX_STAMP TIMESTAMPTZ, CONSTRAINT PK_SRM_USER_LOGINS PRIMARY KEY (USER_ID))
Error was: org.postgresql.util.PSQLException: ERROR: relation "srm_user_logins" already exists
8613  (main) [       DatabaseUtil.java:356:WARN ] Entity [SrmUserTypes] has no table in the database
8613  (main) [       DatabaseUtil.java:364:ERROR] Could not create table [srm.SRM_USER_TYPES]: SQL Exception while executing the following:
CREATE TABLE srm.SRM_USER_TYPES (USER_TYPE_ID VARCHAR(20) NOT NULL, USER_TYPE_NAME VARCHAR(60), USER_TYPE_DESC VARCHAR(255), LAST_UPDATED_STAMP TIMESTAMPTZ, LAST_UPDATED_TX_STAMP TIMESTAMPTZ, CREATED_STAMP TIMESTAMPTZ, CREATED_TX_STAMP TIMESTAMPTZ, CONSTRAINT PK_SRM_USER_TYPES PRIMARY KEY (USER_TYPE_ID))
Error was: org.postgresql.util.PSQLException: ERROR: relation "srm_user_types" already exists
8690  (main) [       DatabaseUtil.java:383:WARN ] Table named [SRM_USER_DETAILS] exists in the database but has no corresponding entity
8690  (main) [       DatabaseUtil.java:383:WARN ] Table named [SRM_USER_LOGINS] exists in the database but has no corresponding entity
8690  (main) [       DatabaseUtil.java:383:WARN ] Table named [SRM_USER_TYPES] exists in the database but has no corresponding entity

---- From ofbiz-component.xml: ---
<?xml version="1.0" encoding="UTF-8"?>
<ofbiz-component name="srm"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ofbiz-component.xsd">
    <resource-loader name="main" type="component"/>
         <classpath type="dir" location="config"/>
         <classpath type="dir" location="script"/>

    <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
    <entity-resource type="group" reader-name="main" loader="main" location="entitydef/entitygroup.xml"/>
    <service-resource type="model" loader="main" location="servicedef/services.xml"/>

    <webapp name="srm"
        title="Die ersten Versuche mit Widgets"
        server="default-server"
        location="webapp/srm"
        base-permission=""
        mount-point="/srm"/>
</ofbiz-component>

---- From entitymodel.xml: ----
<?xml version="1.0" encoding="UTF-8"?>
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitymodel.xsd">
        <title>srm</title>
        <version>1.0</version>
        <entity entity-name="SrmUserTypes" package-name="org.ofbiz"
                title="Example for some kinds of users">
                <field name="userTypeId" type="id-ne"/>
                <field name="userTypeName" type="short-varchar"/>
                <field name="userTypeDesc" type="long-varchar"/>
                <prim-key field="userTypeId"/>
        </entity>
        <entity entity-name="SrmUserLogins" package-name="org.ofbiz"
                title="Example for logins an passwords">
                <field name="userId" type="id-ne"/>
                <field name="userTypeId" type="id-ne"/>
                <field name="userLogin" type="short-varchar"/>
                <field name="userPassword" type="short-varchar"/>
                <prim-key field="userId"/>
                <relation rel-entity-name="SrmUserTypes" type="one">
                        <key-map field-name="userTypeId"/>
                </relation>
        </entity>
        <entity entity-name="SrmUserDetails" package-name="org.ofbiz"
                title="Some details, multiple times per user">
                <field name="userId" type="id-ne"/>
                <field name="userDetailId" type="id-ne"/>
                <field name="userTypeId" type="id-ne"/>
                <field name="userFirstName" type="short-varchar"/>
                <field name="userLastName" type="short-varchar"/>
                <field name="userPhone" type="short-varchar"/>
                <prim-key field="userId"/>
                <prim-key field="userDetailId"/>
                <relation type="one" rel-entity-name="SrmUserLogins">
                        <key-map field-name="userId"/>
                </relation>
                <relation rel-entity-name="SrmUserTypes" type="one">
                        <key-map field-name="userTypeId"/>
                </relation>
        </entity>
</entitymodel>

---- From entitygroup.xml ----
<?xml version="1.0" encoding="UTF-8"?>
<entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitygroup.xsd">
        <entity-group group="org.ofbiz" entity="SrmUserTypes"/>
        <entity-group group="org.ofbiz" entity="SrmUserLogins"/>
        <entity-group group="org.ofbiz" entity="SrmUserDetails"/>
</entitygroup>
Reply | Threaded
Open this post in threaded view
|

Re: Problem with entity engine (trunk)

Fabian Gorsler
Oh, this mail arrived the list, too. Sorry, I though subscribing was
needed to post here, because this mail didn't appear. ;-)

Please ignore it, the discussion is a few threads earlier.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with entity engine (trunk)

Christian Geisert
Fabian Gorsler schrieb:
> Oh, this mail arrived the list, too. Sorry, I though subscribing was
> needed to post here, because this mail didn't appear. ;-)

If you're not subscribed to the mailing list the mail will show up in
the inbox of the list moderator(s) and then he/she can approve the mail.

--
Christian
Reply | Threaded
Open this post in threaded view
|

Re: Problem with entity engine (trunk)

Fabian Gorsler
Thanks for the hint, I've supposed it's that way on this list. ;)