Getting Started using MySQL

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

Getting Started using MySQL

Ron Wheeler
It appears that there is a missing step in the description about how to
run OfBiz with a database other than Derby.
https://cwiki.apache.org/confluence/display/OFBTECH/Apache+OFBiz+Technical+Production+Setup+Guide

talks about changing the "default" delegator but it does not mention
anywhere that I can find, how you tell OfBiz that  you want to use the
delegator associated with My SQL.

I am getting a null pointer which I think is caused by OfBiz still
trying to use Derby which no longer has a delegator sice it is commented
out and the MySQL one is uncommented.

What is the secret step tat I need to to to make the instructions work?

Ron

--
Ron Wheeler
President
Artifact Software Inc
email: [hidden email]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started using MySQL

Adrian Crum-3
The correct steps are there:

Modify an existing datasource (near the bottom of the file) or create a
new one by copying one of the sample datasources already there and
giving it a new unique name

     If using the default OFBiz transaction manager and connection pool,
update the data URI, username and password in the inline-jdbc tag
     If you want your OFBiz tables in a special schema first create that
schema in your database, then set the schema-name attribute on the
datasource tag
     Find the "default" delegator near the top of the file and change
the datasource-name attribute value in the group-map tag under it to the
name of the data source you modified or created.


Adrian Crum
Sandglass Software
www.sandglass-software.com

On 6/2/2014 1:01 PM, Ron Wheeler wrote:

> It appears that there is a missing step in the description about how to
> run OfBiz with a database other than Derby.
> https://cwiki.apache.org/confluence/display/OFBTECH/Apache+OFBiz+Technical+Production+Setup+Guide
>
>
> talks about changing the "default" delegator but it does not mention
> anywhere that I can find, how you tell OfBiz that  you want to use the
> delegator associated with My SQL.
>
> I am getting a null pointer which I think is caused by OfBiz still
> trying to use Derby which no longer has a delegator sice it is commented
> out and the MySQL one is uncommented.
>
> What is the secret step tat I need to to to make the instructions work?
>
> Ron
>
Reply | Threaded
Open this post in threaded view
|

Re: Getting Started using MySQL

Ron Wheeler
In  entityengine.xml, I removed the databases that I am not using just
to make it clearer.
As OfBiz is distributed there seems to be several group-map entries that
are active and some commented out.
There seemed to be several different group-names in use.
Did I understand the instructions incorrectly or have I screwed up
somewhere else?
The ofbiz database exists and the ofbiz user has all privs on it.
A null pointer usually means that I promised to provide an object and I
didn't rather than a database security error.
I have not touched any other configuration files.

     <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="localmysql"/>
     </delegator>
.
.
.

   <datasource name="localmysql"
helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
             field-type-name="mysql"
             check-on-start="true"
             add-missing-on-start="true"
             check-pks-on-start="false"
             use-foreign-keys="true"
             join-style="ansi-no-parenthesis"
             alias-view-columns="false"
             drop-fk-use-foreign-key-keyword="true"
             table-type="InnoDB"
             character-set="latin1"
             collate="latin1_general_cs">
         <read-data reader-name="tenant"/>
         <read-data reader-name="seed"/>
         <read-data reader-name="seed-initial"/>
         <read-data reader-name="demo"/>
         <read-data reader-name="ext"/>
         <inline-jdbc
                 jdbc-driver="com.mysql.jdbc.Driver"
jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true"
                 jdbc-username="ofbiz"
                 jdbc-password="mylittlesecret"
                 isolation-level="ReadCommitted"
                 pool-minsize="2"
                 pool-maxsize="250"
                 time-between-eviction-runs-millis="600000"/>
     </datasource>

Gives me:
     [java] 2014-06-02 17:14:05,843 (main) [
ModelViewEntity.java:551:WARN ] [ExampleStatusDetail]: Conversion for
complex-alias needs to be implemented for cache and in-memory eval stuff
to work correctly, will not work for alias: statusDelay
      [java] 2014-06-02 17:14:06,202 (main) [ ModelReader.java:436:INFO
] FINISHED LOADING ENTITIES - ALL FILES; #Entities=863 #ViewEntities=300
#Fields=9049 #Relationships=2961 #AutoRelationships=2186
      [java] 2014-06-02 17:14:06,297 (main) [
GenericDelegator.java:234:INFO ] Doing entity definition check...
      [java] 2014-06-02 17:14:06,317 (main) [
ModelEntityChecker.java:508:INFO ] [initReservedWords] array length=1023
      [java] java.lang.NullPointerException
      [java]     at
org.ofbiz.entity.GenericDelegator.getEntityFieldType(GenericDelegator.java:541)
      [java]     at
org.ofbiz.entity.model.ModelEntityChecker.checkEntities(ModelEntityChecker.java:107)
      [java]     at
org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:235)
      [java]     at
org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:33)
      [java]     at
org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:25)
      [java]     at
org.ofbiz.base.util.UtilObject.getObjectFromFactory(UtilObject.java:202)
      [java]     at
org.ofbiz.entity.DelegatorFactory.getDelegator(DelegatorFactory.java:51)
      [java]     at
org.ofbiz.entityext.data.EntityDataLoadContainer.loadContainer(EntityDataLoadContainer.java:272)
      [java]     at
org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:236)
      [java]     at
org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:230)
      [java]     at
org.ofbiz.base.start.Start.startStartLoaders(Start.java:362)
      [java]     at org.ofbiz.base.start.Start.start(Start.java:337)
      [java]     at org.ofbiz.base.start.Start.main(Start.java:139)
      [java] 2014-06-02 17:14:07,337 (Thread-0) [
ContainerLoader.java:246:INFO ] Shutting down containers
      [java] Java Result: 99

BUILD SUCCESSFUL
Total time: 31 seconds



On 02/06/2014 4:26 PM, Adrian Crum wrote:

> The correct steps are there:
>
> Modify an existing datasource (near the bottom of the file) or create
> a new one by copying one of the sample datasources already there and
> giving it a new unique name
>
>     If using the default OFBiz transaction manager and connection
> pool, update the data URI, username and password in the inline-jdbc tag
>     If you want your OFBiz tables in a special schema first create
> that schema in your database, then set the schema-name attribute on
> the datasource tag
>     Find the "default" delegator near the top of the file and change
> the datasource-name attribute value in the group-map tag under it to
> the name of the data source you modified or created.
>
>
> Adrian Crum
> Sandglass Software
> www.sandglass-software.com
>
> On 6/2/2014 1:01 PM, Ron Wheeler wrote:
>> It appears that there is a missing step in the description about how to
>> run OfBiz with a database other than Derby.
>> https://cwiki.apache.org/confluence/display/OFBTECH/Apache+OFBiz+Technical+Production+Setup+Guide 
>>
>>
>>
>> talks about changing the "default" delegator but it does not mention
>> anywhere that I can find, how you tell OfBiz that  you want to use the
>> delegator associated with My SQL.
>>
>> I am getting a null pointer which I think is caused by OfBiz still
>> trying to use Derby which no longer has a delegator sice it is commented
>> out and the MySQL one is uncommented.
>>
>> What is the secret step tat I need to to to make the instructions work?
>>
>> Ron
>>
>


--
Ron Wheeler
President
Artifact Software Inc
email: [hidden email]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started using MySQL

Adrian Crum-3
Here is what I recommend:

1. Restore the original file.

2. Modify the "localmysql" datasource element to connect to your database.

3. Modify the "default" delegator element:
     Change
         <group-map group-name="org.ofbiz" datasource-name="localderby"/>
     to
         <group-map group-name="org.ofbiz" datasource-name="localmysql"/>

The OLAP and Tenant data sources will still use Derby. If you want to
change those to use MySQL also, then:

1. Modify the "localmysqlolap" datasource element to connect to your
OLAP database.

2. Modify the "localmysqltenant" datasource element to connect to your
Tenant database.

3. Modify the "default" delegator element:
     Change
         <group-map group-name="org.ofbiz.olap"
datasource-name="localderbyolap"/>
     to
         <group-map group-name="org.ofbiz.olap"
datasource-name="localmysqlolap"/>
     Change
         <group-map group-name="org.ofbiz.tenant"
datasource-name="localderbytenant"/>
     to
         <group-map group-name="org.ofbiz.tenant"
datasource-name="localmysqltenant"/>

Finally, run:

ant load-demo

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 6/2/2014 2:26 PM, Ron Wheeler wrote:

> In  entityengine.xml, I removed the databases that I am not using just
> to make it clearer.
> As OfBiz is distributed there seems to be several group-map entries that
> are active and some commented out.
> There seemed to be several different group-names in use.
> Did I understand the instructions incorrectly or have I screwed up
> somewhere else?
> The ofbiz database exists and the ofbiz user has all privs on it.
> A null pointer usually means that I promised to provide an object and I
> didn't rather than a database security error.
> I have not touched any other configuration files.
>
>      <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="localmysql"/>
>      </delegator>
> .
> .
> .
>
>    <datasource name="localmysql"
> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>              field-type-name="mysql"
>              check-on-start="true"
>              add-missing-on-start="true"
>              check-pks-on-start="false"
>              use-foreign-keys="true"
>              join-style="ansi-no-parenthesis"
>              alias-view-columns="false"
>              drop-fk-use-foreign-key-keyword="true"
>              table-type="InnoDB"
>              character-set="latin1"
>              collate="latin1_general_cs">
>          <read-data reader-name="tenant"/>
>          <read-data reader-name="seed"/>
>          <read-data reader-name="seed-initial"/>
>          <read-data reader-name="demo"/>
>          <read-data reader-name="ext"/>
>          <inline-jdbc
>                  jdbc-driver="com.mysql.jdbc.Driver"
> jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true"
>                  jdbc-username="ofbiz"
>                  jdbc-password="mylittlesecret"
>                  isolation-level="ReadCommitted"
>                  pool-minsize="2"
>                  pool-maxsize="250"
>                  time-between-eviction-runs-millis="600000"/>
>      </datasource>
>
> Gives me:
>      [java] 2014-06-02 17:14:05,843 (main) [
> ModelViewEntity.java:551:WARN ] [ExampleStatusDetail]: Conversion for
> complex-alias needs to be implemented for cache and in-memory eval stuff
> to work correctly, will not work for alias: statusDelay
>       [java] 2014-06-02 17:14:06,202 (main) [ ModelReader.java:436:INFO
> ] FINISHED LOADING ENTITIES - ALL FILES; #Entities=863 #ViewEntities=300
> #Fields=9049 #Relationships=2961 #AutoRelationships=2186
>       [java] 2014-06-02 17:14:06,297 (main) [
> GenericDelegator.java:234:INFO ] Doing entity definition check...
>       [java] 2014-06-02 17:14:06,317 (main) [
> ModelEntityChecker.java:508:INFO ] [initReservedWords] array length=1023
>       [java] java.lang.NullPointerException
>       [java]     at
> org.ofbiz.entity.GenericDelegator.getEntityFieldType(GenericDelegator.java:541)
>
>       [java]     at
> org.ofbiz.entity.model.ModelEntityChecker.checkEntities(ModelEntityChecker.java:107)
>
>       [java]     at
> org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:235)
>       [java]     at
> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:33)
>
>       [java]     at
> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:25)
>
>       [java]     at
> org.ofbiz.base.util.UtilObject.getObjectFromFactory(UtilObject.java:202)
>       [java]     at
> org.ofbiz.entity.DelegatorFactory.getDelegator(DelegatorFactory.java:51)
>       [java]     at
> org.ofbiz.entityext.data.EntityDataLoadContainer.loadContainer(EntityDataLoadContainer.java:272)
>
>       [java]     at
> org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:236)
>
>       [java]     at
> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:230)
>       [java]     at
> org.ofbiz.base.start.Start.startStartLoaders(Start.java:362)
>       [java]     at org.ofbiz.base.start.Start.start(Start.java:337)
>       [java]     at org.ofbiz.base.start.Start.main(Start.java:139)
>       [java] 2014-06-02 17:14:07,337 (Thread-0) [
> ContainerLoader.java:246:INFO ] Shutting down containers
>       [java] Java Result: 99
>
> BUILD SUCCESSFUL
> Total time: 31 seconds
>
>
>
> On 02/06/2014 4:26 PM, Adrian Crum wrote:
>> The correct steps are there:
>>
>> Modify an existing datasource (near the bottom of the file) or create
>> a new one by copying one of the sample datasources already there and
>> giving it a new unique name
>>
>>     If using the default OFBiz transaction manager and connection
>> pool, update the data URI, username and password in the inline-jdbc tag
>>     If you want your OFBiz tables in a special schema first create
>> that schema in your database, then set the schema-name attribute on
>> the datasource tag
>>     Find the "default" delegator near the top of the file and change
>> the datasource-name attribute value in the group-map tag under it to
>> the name of the data source you modified or created.
>>
>>
>> Adrian Crum
>> Sandglass Software
>> www.sandglass-software.com
>>
>> On 6/2/2014 1:01 PM, Ron Wheeler wrote:
>>> It appears that there is a missing step in the description about how to
>>> run OfBiz with a database other than Derby.
>>> https://cwiki.apache.org/confluence/display/OFBTECH/Apache+OFBiz+Technical+Production+Setup+Guide
>>>
>>>
>>>
>>> talks about changing the "default" delegator but it does not mention
>>> anywhere that I can find, how you tell OfBiz that  you want to use the
>>> delegator associated with My SQL.
>>>
>>> I am getting a null pointer which I think is caused by OfBiz still
>>> trying to use Derby which no longer has a delegator sice it is commented
>>> out and the MySQL one is uncommented.
>>>
>>> What is the secret step tat I need to to to make the instructions work?
>>>
>>> Ron
>>>
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Getting Started using MySQL

Deepak Dixit-2
One more step:

Don’t forgot to put the mySql drive.
Use “./ant download-mySQL-JDBC" to download the mysql driver.

Thanks & Regards

Deepak Dixit

On Jun 3, 2014, at 3:10 AM, Adrian Crum <[hidden email]> wrote:

> Here is what I recommend:
>
> 1. Restore the original file.
>
> 2. Modify the "localmysql" datasource element to connect to your database.
>
> 3. Modify the "default" delegator element:
>    Change
>        <group-map group-name="org.ofbiz" datasource-name="localderby"/>
>    to
>        <group-map group-name="org.ofbiz" datasource-name="localmysql"/>
>
> The OLAP and Tenant data sources will still use Derby. If you want to change those to use MySQL also, then:
>
> 1. Modify the "localmysqlolap" datasource element to connect to your OLAP database.
>
> 2. Modify the "localmysqltenant" datasource element to connect to your Tenant database.
>
> 3. Modify the "default" delegator element:
>    Change
>        <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
>    to
>        <group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/>
>    Change
>        <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/>
>    to
>        <group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/>
>
> Finally, run:
>
> ant load-demo
>
> Adrian Crum
> Sandglass Software
> www.sandglass-software.com
>
> On 6/2/2014 2:26 PM, Ron Wheeler wrote:
>> In  entityengine.xml, I removed the databases that I am not using just
>> to make it clearer.
>> As OfBiz is distributed there seems to be several group-map entries that
>> are active and some commented out.
>> There seemed to be several different group-names in use.
>> Did I understand the instructions incorrectly or have I screwed up
>> somewhere else?
>> The ofbiz database exists and the ofbiz user has all privs on it.
>> A null pointer usually means that I promised to provide an object and I
>> didn't rather than a database security error.
>> I have not touched any other configuration files.
>>
>>     <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="localmysql"/>
>>     </delegator>
>> .
>> .
>> .
>>
>>   <datasource name="localmysql"
>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>             field-type-name="mysql"
>>             check-on-start="true"
>>             add-missing-on-start="true"
>>             check-pks-on-start="false"
>>             use-foreign-keys="true"
>>             join-style="ansi-no-parenthesis"
>>             alias-view-columns="false"
>>             drop-fk-use-foreign-key-keyword="true"
>>             table-type="InnoDB"
>>             character-set="latin1"
>>             collate="latin1_general_cs">
>>         <read-data reader-name="tenant"/>
>>         <read-data reader-name="seed"/>
>>         <read-data reader-name="seed-initial"/>
>>         <read-data reader-name="demo"/>
>>         <read-data reader-name="ext"/>
>>         <inline-jdbc
>>                 jdbc-driver="com.mysql.jdbc.Driver"
>> jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true"
>>                 jdbc-username="ofbiz"
>>                 jdbc-password="mylittlesecret"
>>                 isolation-level="ReadCommitted"
>>                 pool-minsize="2"
>>                 pool-maxsize="250"
>>                 time-between-eviction-runs-millis="600000"/>
>>     </datasource>
>>
>> Gives me:
>>     [java] 2014-06-02 17:14:05,843 (main) [
>> ModelViewEntity.java:551:WARN ] [ExampleStatusDetail]: Conversion for
>> complex-alias needs to be implemented for cache and in-memory eval stuff
>> to work correctly, will not work for alias: statusDelay
>>      [java] 2014-06-02 17:14:06,202 (main) [ ModelReader.java:436:INFO
>> ] FINISHED LOADING ENTITIES - ALL FILES; #Entities=863 #ViewEntities=300
>> #Fields=9049 #Relationships=2961 #AutoRelationships=2186
>>      [java] 2014-06-02 17:14:06,297 (main) [
>> GenericDelegator.java:234:INFO ] Doing entity definition check...
>>      [java] 2014-06-02 17:14:06,317 (main) [
>> ModelEntityChecker.java:508:INFO ] [initReservedWords] array length=1023
>>      [java] java.lang.NullPointerException
>>      [java]     at
>> org.ofbiz.entity.GenericDelegator.getEntityFieldType(GenericDelegator.java:541)
>>
>>      [java]     at
>> org.ofbiz.entity.model.ModelEntityChecker.checkEntities(ModelEntityChecker.java:107)
>>
>>      [java]     at
>> org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:235)
>>      [java]     at
>> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:33)
>>
>>      [java]     at
>> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:25)
>>
>>      [java]     at
>> org.ofbiz.base.util.UtilObject.getObjectFromFactory(UtilObject.java:202)
>>      [java]     at
>> org.ofbiz.entity.DelegatorFactory.getDelegator(DelegatorFactory.java:51)
>>      [java]     at
>> org.ofbiz.entityext.data.EntityDataLoadContainer.loadContainer(EntityDataLoadContainer.java:272)
>>
>>      [java]     at
>> org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:236)
>>
>>      [java]     at
>> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:230)
>>      [java]     at
>> org.ofbiz.base.start.Start.startStartLoaders(Start.java:362)
>>      [java]     at org.ofbiz.base.start.Start.start(Start.java:337)
>>      [java]     at org.ofbiz.base.start.Start.main(Start.java:139)
>>      [java] 2014-06-02 17:14:07,337 (Thread-0) [
>> ContainerLoader.java:246:INFO ] Shutting down containers
>>      [java] Java Result: 99
>>
>> BUILD SUCCESSFUL
>> Total time: 31 seconds
>>
>>
>>
>> On 02/06/2014 4:26 PM, Adrian Crum wrote:
>>> The correct steps are there:
>>>
>>> Modify an existing datasource (near the bottom of the file) or create
>>> a new one by copying one of the sample datasources already there and
>>> giving it a new unique name
>>>
>>>    If using the default OFBiz transaction manager and connection
>>> pool, update the data URI, username and password in the inline-jdbc tag
>>>    If you want your OFBiz tables in a special schema first create
>>> that schema in your database, then set the schema-name attribute on
>>> the datasource tag
>>>    Find the "default" delegator near the top of the file and change
>>> the datasource-name attribute value in the group-map tag under it to
>>> the name of the data source you modified or created.
>>>
>>>
>>> Adrian Crum
>>> Sandglass Software
>>> www.sandglass-software.com
>>>
>>> On 6/2/2014 1:01 PM, Ron Wheeler wrote:
>>>> It appears that there is a missing step in the description about how to
>>>> run OfBiz with a database other than Derby.
>>>> https://cwiki.apache.org/confluence/display/OFBTECH/Apache+OFBiz+Technical+Production+Setup+Guide
>>>>
>>>>
>>>>
>>>> talks about changing the "default" delegator but it does not mention
>>>> anywhere that I can find, how you tell OfBiz that  you want to use the
>>>> delegator associated with My SQL.
>>>>
>>>> I am getting a null pointer which I think is caused by OfBiz still
>>>> trying to use Derby which no longer has a delegator sice it is commented
>>>> out and the MySQL one is uncommented.
>>>>
>>>> What is the secret step tat I need to to to make the instructions work?
>>>>
>>>> Ron
>>>>
>>>
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started using MySQL

Ron Wheeler
In reply to this post by Adrian Crum-3
Worked like a charm.
This needs to be added to the docs.

Thanks

Ron


On 02/06/2014 5:40 PM, Adrian Crum wrote:

> Here is what I recommend:
>
> 1. Restore the original file.
>
> 2. Modify the "localmysql" datasource element to connect to your
> database.
>
> 3. Modify the "default" delegator element:
>     Change
>         <group-map group-name="org.ofbiz" datasource-name="localderby"/>
>     to
>         <group-map group-name="org.ofbiz" datasource-name="localmysql"/>
>
> The OLAP and Tenant data sources will still use Derby. If you want to
> change those to use MySQL also, then:
>
> 1. Modify the "localmysqlolap" datasource element to connect to your
> OLAP database.
>
> 2. Modify the "localmysqltenant" datasource element to connect to your
> Tenant database.
>
> 3. Modify the "default" delegator element:
>     Change
>         <group-map group-name="org.ofbiz.olap"
> datasource-name="localderbyolap"/>
>     to
>         <group-map group-name="org.ofbiz.olap"
> datasource-name="localmysqlolap"/>
>     Change
>         <group-map group-name="org.ofbiz.tenant"
> datasource-name="localderbytenant"/>
>     to
>         <group-map group-name="org.ofbiz.tenant"
> datasource-name="localmysqltenant"/>
>
> Finally, run:
>
> ant load-demo
>
> Adrian Crum
> Sandglass Software
> www.sandglass-software.com
>
> On 6/2/2014 2:26 PM, Ron Wheeler wrote:
>> In  entityengine.xml, I removed the databases that I am not using just
>> to make it clearer.
>> As OfBiz is distributed there seems to be several group-map entries that
>> are active and some commented out.
>> There seemed to be several different group-names in use.
>> Did I understand the instructions incorrectly or have I screwed up
>> somewhere else?
>> The ofbiz database exists and the ofbiz user has all privs on it.
>> A null pointer usually means that I promised to provide an object and I
>> didn't rather than a database security error.
>> I have not touched any other configuration files.
>>
>>      <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="localmysql"/>
>>      </delegator>
>> .
>> .
>> .
>>
>>    <datasource name="localmysql"
>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>              field-type-name="mysql"
>>              check-on-start="true"
>>              add-missing-on-start="true"
>>              check-pks-on-start="false"
>>              use-foreign-keys="true"
>>              join-style="ansi-no-parenthesis"
>>              alias-view-columns="false"
>>              drop-fk-use-foreign-key-keyword="true"
>>              table-type="InnoDB"
>>              character-set="latin1"
>>              collate="latin1_general_cs">
>>          <read-data reader-name="tenant"/>
>>          <read-data reader-name="seed"/>
>>          <read-data reader-name="seed-initial"/>
>>          <read-data reader-name="demo"/>
>>          <read-data reader-name="ext"/>
>>          <inline-jdbc
>>                  jdbc-driver="com.mysql.jdbc.Driver"
>> jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true"
>>                  jdbc-username="ofbiz"
>>                  jdbc-password="mylittlesecret"
>>                  isolation-level="ReadCommitted"
>>                  pool-minsize="2"
>>                  pool-maxsize="250"
>>                  time-between-eviction-runs-millis="600000"/>
>>      </datasource>
>>
>> Gives me:
>>      [java] 2014-06-02 17:14:05,843 (main) [
>> ModelViewEntity.java:551:WARN ] [ExampleStatusDetail]: Conversion for
>> complex-alias needs to be implemented for cache and in-memory eval stuff
>> to work correctly, will not work for alias: statusDelay
>>       [java] 2014-06-02 17:14:06,202 (main) [ ModelReader.java:436:INFO
>> ] FINISHED LOADING ENTITIES - ALL FILES; #Entities=863 #ViewEntities=300
>> #Fields=9049 #Relationships=2961 #AutoRelationships=2186
>>       [java] 2014-06-02 17:14:06,297 (main) [
>> GenericDelegator.java:234:INFO ] Doing entity definition check...
>>       [java] 2014-06-02 17:14:06,317 (main) [
>> ModelEntityChecker.java:508:INFO ] [initReservedWords] array length=1023
>>       [java] java.lang.NullPointerException
>>       [java]     at
>> org.ofbiz.entity.GenericDelegator.getEntityFieldType(GenericDelegator.java:541)
>>
>>
>>       [java]     at
>> org.ofbiz.entity.model.ModelEntityChecker.checkEntities(ModelEntityChecker.java:107)
>>
>>
>>       [java]     at
>> org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:235)
>>       [java]     at
>> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:33)
>>
>>
>>       [java]     at
>> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:25)
>>
>>
>>       [java]     at
>> org.ofbiz.base.util.UtilObject.getObjectFromFactory(UtilObject.java:202)
>>       [java]     at
>> org.ofbiz.entity.DelegatorFactory.getDelegator(DelegatorFactory.java:51)
>>       [java]     at
>> org.ofbiz.entityext.data.EntityDataLoadContainer.loadContainer(EntityDataLoadContainer.java:272)
>>
>>
>>       [java]     at
>> org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:236)
>>
>>
>>       [java]     at
>> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:230)
>>       [java]     at
>> org.ofbiz.base.start.Start.startStartLoaders(Start.java:362)
>>       [java]     at org.ofbiz.base.start.Start.start(Start.java:337)
>>       [java]     at org.ofbiz.base.start.Start.main(Start.java:139)
>>       [java] 2014-06-02 17:14:07,337 (Thread-0) [
>> ContainerLoader.java:246:INFO ] Shutting down containers
>>       [java] Java Result: 99
>>
>> BUILD SUCCESSFUL
>> Total time: 31 seconds
>>
>>
>>
>> On 02/06/2014 4:26 PM, Adrian Crum wrote:
>>> The correct steps are there:
>>>
>>> Modify an existing datasource (near the bottom of the file) or create
>>> a new one by copying one of the sample datasources already there and
>>> giving it a new unique name
>>>
>>>     If using the default OFBiz transaction manager and connection
>>> pool, update the data URI, username and password in the inline-jdbc tag
>>>     If you want your OFBiz tables in a special schema first create
>>> that schema in your database, then set the schema-name attribute on
>>> the datasource tag
>>>     Find the "default" delegator near the top of the file and change
>>> the datasource-name attribute value in the group-map tag under it to
>>> the name of the data source you modified or created.
>>>
>>>
>>> Adrian Crum
>>> Sandglass Software
>>> www.sandglass-software.com
>>>
>>> On 6/2/2014 1:01 PM, Ron Wheeler wrote:
>>>> It appears that there is a missing step in the description about
>>>> how to
>>>> run OfBiz with a database other than Derby.
>>>> https://cwiki.apache.org/confluence/display/OFBTECH/Apache+OFBiz+Technical+Production+Setup+Guide 
>>>>
>>>>
>>>>
>>>>
>>>> talks about changing the "default" delegator but it does not mention
>>>> anywhere that I can find, how you tell OfBiz that  you want to use the
>>>> delegator associated with My SQL.
>>>>
>>>> I am getting a null pointer which I think is caused by OfBiz still
>>>> trying to use Derby which no longer has a delegator sice it is
>>>> commented
>>>> out and the MySQL one is uncommented.
>>>>
>>>> What is the secret step tat I need to to to make the instructions
>>>> work?
>>>>
>>>> Ron
>>>>
>>>
>>
>>
>


--
Ron Wheeler
President
Artifact Software Inc
email: [hidden email]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started using MySQL

Ron Wheeler
In reply to this post by Deepak Dixit-2
There is a description about how to add the database connector but it is
different and more complicated.

If necessary, put the correct JDBC driver in:
${ofbiz install dir}/framework/entity/lib/jdbc
replacing the old or incorrect version of the driver there (ie copy in
with same name to avoid problems with update restoring the old driver later)


On 03/06/2014 12:31 AM, Deepak Dixit wrote:

> One more step:
>
> Don’t forgot to put the mySql drive.
> Use “./ant download-mySQL-JDBC" to download the mysql driver.
>
> Thanks & Regards
> —
> Deepak Dixit
>
> On Jun 3, 2014, at 3:10 AM, Adrian Crum <[hidden email]> wrote:
>
>> Here is what I recommend:
>>
>> 1. Restore the original file.
>>
>> 2. Modify the "localmysql" datasource element to connect to your database.
>>
>> 3. Modify the "default" delegator element:
>>     Change
>>         <group-map group-name="org.ofbiz" datasource-name="localderby"/>
>>     to
>>         <group-map group-name="org.ofbiz" datasource-name="localmysql"/>
>>
>> The OLAP and Tenant data sources will still use Derby. If you want to change those to use MySQL also, then:
>>
>> 1. Modify the "localmysqlolap" datasource element to connect to your OLAP database.
>>
>> 2. Modify the "localmysqltenant" datasource element to connect to your Tenant database.
>>
>> 3. Modify the "default" delegator element:
>>     Change
>>         <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
>>     to
>>         <group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/>
>>     Change
>>         <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/>
>>     to
>>         <group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/>
>>
>> Finally, run:
>>
>> ant load-demo
>>
>> Adrian Crum
>> Sandglass Software
>> www.sandglass-software.com
>>
>> On 6/2/2014 2:26 PM, Ron Wheeler wrote:
>>> In  entityengine.xml, I removed the databases that I am not using just
>>> to make it clearer.
>>> As OfBiz is distributed there seems to be several group-map entries that
>>> are active and some commented out.
>>> There seemed to be several different group-names in use.
>>> Did I understand the instructions incorrectly or have I screwed up
>>> somewhere else?
>>> The ofbiz database exists and the ofbiz user has all privs on it.
>>> A null pointer usually means that I promised to provide an object and I
>>> didn't rather than a database security error.
>>> I have not touched any other configuration files.
>>>
>>>      <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="localmysql"/>
>>>      </delegator>
>>> .
>>> .
>>> .
>>>
>>>    <datasource name="localmysql"
>>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>              field-type-name="mysql"
>>>              check-on-start="true"
>>>              add-missing-on-start="true"
>>>              check-pks-on-start="false"
>>>              use-foreign-keys="true"
>>>              join-style="ansi-no-parenthesis"
>>>              alias-view-columns="false"
>>>              drop-fk-use-foreign-key-keyword="true"
>>>              table-type="InnoDB"
>>>              character-set="latin1"
>>>              collate="latin1_general_cs">
>>>          <read-data reader-name="tenant"/>
>>>          <read-data reader-name="seed"/>
>>>          <read-data reader-name="seed-initial"/>
>>>          <read-data reader-name="demo"/>
>>>          <read-data reader-name="ext"/>
>>>          <inline-jdbc
>>>                  jdbc-driver="com.mysql.jdbc.Driver"
>>> jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true"
>>>                  jdbc-username="ofbiz"
>>>                  jdbc-password="mylittlesecret"
>>>                  isolation-level="ReadCommitted"
>>>                  pool-minsize="2"
>>>                  pool-maxsize="250"
>>>                  time-between-eviction-runs-millis="600000"/>
>>>      </datasource>
>>>
>>> Gives me:
>>>      [java] 2014-06-02 17:14:05,843 (main) [
>>> ModelViewEntity.java:551:WARN ] [ExampleStatusDetail]: Conversion for
>>> complex-alias needs to be implemented for cache and in-memory eval stuff
>>> to work correctly, will not work for alias: statusDelay
>>>       [java] 2014-06-02 17:14:06,202 (main) [ ModelReader.java:436:INFO
>>> ] FINISHED LOADING ENTITIES - ALL FILES; #Entities=863 #ViewEntities=300
>>> #Fields=9049 #Relationships=2961 #AutoRelationships=2186
>>>       [java] 2014-06-02 17:14:06,297 (main) [
>>> GenericDelegator.java:234:INFO ] Doing entity definition check...
>>>       [java] 2014-06-02 17:14:06,317 (main) [
>>> ModelEntityChecker.java:508:INFO ] [initReservedWords] array length=1023
>>>       [java] java.lang.NullPointerException
>>>       [java]     at
>>> org.ofbiz.entity.GenericDelegator.getEntityFieldType(GenericDelegator.java:541)
>>>
>>>       [java]     at
>>> org.ofbiz.entity.model.ModelEntityChecker.checkEntities(ModelEntityChecker.java:107)
>>>
>>>       [java]     at
>>> org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:235)
>>>       [java]     at
>>> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:33)
>>>
>>>       [java]     at
>>> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:25)
>>>
>>>       [java]     at
>>> org.ofbiz.base.util.UtilObject.getObjectFromFactory(UtilObject.java:202)
>>>       [java]     at
>>> org.ofbiz.entity.DelegatorFactory.getDelegator(DelegatorFactory.java:51)
>>>       [java]     at
>>> org.ofbiz.entityext.data.EntityDataLoadContainer.loadContainer(EntityDataLoadContainer.java:272)
>>>
>>>       [java]     at
>>> org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:236)
>>>
>>>       [java]     at
>>> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:230)
>>>       [java]     at
>>> org.ofbiz.base.start.Start.startStartLoaders(Start.java:362)
>>>       [java]     at org.ofbiz.base.start.Start.start(Start.java:337)
>>>       [java]     at org.ofbiz.base.start.Start.main(Start.java:139)
>>>       [java] 2014-06-02 17:14:07,337 (Thread-0) [
>>> ContainerLoader.java:246:INFO ] Shutting down containers
>>>       [java] Java Result: 99
>>>
>>> BUILD SUCCESSFUL
>>> Total time: 31 seconds
>>>
>>>
>>>
>>> On 02/06/2014 4:26 PM, Adrian Crum wrote:
>>>> The correct steps are there:
>>>>
>>>> Modify an existing datasource (near the bottom of the file) or create
>>>> a new one by copying one of the sample datasources already there and
>>>> giving it a new unique name
>>>>
>>>>     If using the default OFBiz transaction manager and connection
>>>> pool, update the data URI, username and password in the inline-jdbc tag
>>>>     If you want your OFBiz tables in a special schema first create
>>>> that schema in your database, then set the schema-name attribute on
>>>> the datasource tag
>>>>     Find the "default" delegator near the top of the file and change
>>>> the datasource-name attribute value in the group-map tag under it to
>>>> the name of the data source you modified or created.
>>>>
>>>>
>>>> Adrian Crum
>>>> Sandglass Software
>>>> www.sandglass-software.com
>>>>
>>>> On 6/2/2014 1:01 PM, Ron Wheeler wrote:
>>>>> It appears that there is a missing step in the description about how to
>>>>> run OfBiz with a database other than Derby.
>>>>> https://cwiki.apache.org/confluence/display/OFBTECH/Apache+OFBiz+Technical+Production+Setup+Guide
>>>>>
>>>>>
>>>>>
>>>>> talks about changing the "default" delegator but it does not mention
>>>>> anywhere that I can find, how you tell OfBiz that  you want to use the
>>>>> delegator associated with My SQL.
>>>>>
>>>>> I am getting a null pointer which I think is caused by OfBiz still
>>>>> trying to use Derby which no longer has a delegator sice it is commented
>>>>> out and the MySQL one is uncommented.
>>>>>
>>>>> What is the secret step tat I need to to to make the instructions work?
>>>>>
>>>>> Ron
>>>>>
>>>
>


--
Ron Wheeler
President
Artifact Software Inc
email: [hidden email]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started using MySQL

geodude
This is what I always use and it's very easy to follow.

http://lj4newbies.blogspot.com/2008/06/setup-mysql-with-ofbiz.html


Regards,
Sergio



On Tue, Jun 3, 2014 at 3:54 AM, Ron Wheeler <[hidden email]>
wrote:

> There is a description about how to add the database connector but it is
> different and more complicated.
>
> If necessary, put the correct JDBC driver in:
> ${ofbiz install dir}/framework/entity/lib/jdbc
> replacing the old or incorrect version of the driver there (ie copy in
> with same name to avoid problems with update restoring the old driver later)
>
>
>
> On 03/06/2014 12:31 AM, Deepak Dixit wrote:
>
>> One more step:
>>
>> Don't forgot to put the mySql drive.
>> Use "./ant download-mySQL-JDBC" to download the mysql driver.
>>
>> Thanks & Regards
>> --
>> Deepak Dixit
>>
>> On Jun 3, 2014, at 3:10 AM, Adrian Crum <adrian.crum@sandglass-
>> software.com> wrote:
>>
>>  Here is what I recommend:
>>>
>>> 1. Restore the original file.
>>>
>>> 2. Modify the "localmysql" datasource element to connect to your
>>> database.
>>>
>>> 3. Modify the "default" delegator element:
>>>     Change
>>>         <group-map group-name="org.ofbiz" datasource-name="localderby"/>
>>>     to
>>>         <group-map group-name="org.ofbiz" datasource-name="localmysql"/>
>>>
>>> The OLAP and Tenant data sources will still use Derby. If you want to
>>> change those to use MySQL also, then:
>>>
>>> 1. Modify the "localmysqlolap" datasource element to connect to your
>>> OLAP database.
>>>
>>> 2. Modify the "localmysqltenant" datasource element to connect to your
>>> Tenant database.
>>>
>>> 3. Modify the "default" delegator element:
>>>     Change
>>>         <group-map group-name="org.ofbiz.olap" datasource-name="
>>> localderbyolap"/>
>>>     to
>>>         <group-map group-name="org.ofbiz.olap" datasource-name="
>>> localmysqlolap"/>
>>>     Change
>>>         <group-map group-name="org.ofbiz.tenant" datasource-name="
>>> localderbytenant"/>
>>>     to
>>>         <group-map group-name="org.ofbiz.tenant" datasource-name="
>>> localmysqltenant"/>
>>>
>>> Finally, run:
>>>
>>> ant load-demo
>>>
>>> Adrian Crum
>>> Sandglass Software
>>> www.sandglass-software.com
>>>
>>> On 6/2/2014 2:26 PM, Ron Wheeler wrote:
>>>
>>>> In  entityengine.xml, I removed the databases that I am not using just
>>>> to make it clearer.
>>>> As OfBiz is distributed there seems to be several group-map entries that
>>>> are active and some commented out.
>>>> There seemed to be several different group-names in use.
>>>> Did I understand the instructions incorrectly or have I screwed up
>>>> somewhere else?
>>>> The ofbiz database exists and the ofbiz user has all privs on it.
>>>> A null pointer usually means that I promised to provide an object and I
>>>> didn't rather than a database security error.
>>>> I have not touched any other configuration files.
>>>>
>>>>      <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="localmysql"/>
>>>>      </delegator>
>>>> .
>>>> .
>>>> .
>>>>
>>>>    <datasource name="localmysql"
>>>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>              field-type-name="mysql"
>>>>              check-on-start="true"
>>>>              add-missing-on-start="true"
>>>>              check-pks-on-start="false"
>>>>              use-foreign-keys="true"
>>>>              join-style="ansi-no-parenthesis"
>>>>              alias-view-columns="false"
>>>>              drop-fk-use-foreign-key-keyword="true"
>>>>              table-type="InnoDB"
>>>>              character-set="latin1"
>>>>              collate="latin1_general_cs">
>>>>          <read-data reader-name="tenant"/>
>>>>          <read-data reader-name="seed"/>
>>>>          <read-data reader-name="seed-initial"/>
>>>>          <read-data reader-name="demo"/>
>>>>          <read-data reader-name="ext"/>
>>>>          <inline-jdbc
>>>>                  jdbc-driver="com.mysql.jdbc.Driver"
>>>> jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true"
>>>>                  jdbc-username="ofbiz"
>>>>                  jdbc-password="mylittlesecret"
>>>>                  isolation-level="ReadCommitted"
>>>>                  pool-minsize="2"
>>>>                  pool-maxsize="250"
>>>>                  time-between-eviction-runs-millis="600000"/>
>>>>      </datasource>
>>>>
>>>> Gives me:
>>>>      [java] 2014-06-02 17:14:05,843 (main) [
>>>> ModelViewEntity.java:551:WARN ] [ExampleStatusDetail]: Conversion for
>>>> complex-alias needs to be implemented for cache and in-memory eval stuff
>>>> to work correctly, will not work for alias: statusDelay
>>>>       [java] 2014-06-02 17:14:06,202 (main) [ ModelReader.java:436:INFO
>>>> ] FINISHED LOADING ENTITIES - ALL FILES; #Entities=863 #ViewEntities=300
>>>> #Fields=9049 #Relationships=2961 #AutoRelationships=2186
>>>>       [java] 2014-06-02 17:14:06,297 (main) [
>>>> GenericDelegator.java:234:INFO ] Doing entity definition check...
>>>>       [java] 2014-06-02 17:14:06,317 (main) [
>>>> ModelEntityChecker.java:508:INFO ] [initReservedWords] array
>>>> length=1023
>>>>       [java] java.lang.NullPointerException
>>>>       [java]     at
>>>> org.ofbiz.entity.GenericDelegator.getEntityFieldType(
>>>> GenericDelegator.java:541)
>>>>
>>>>       [java]     at
>>>> org.ofbiz.entity.model.ModelEntityChecker.checkEntities(
>>>> ModelEntityChecker.java:107)
>>>>
>>>>       [java]     at
>>>> org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:235)
>>>>       [java]     at
>>>> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(
>>>> DelegatorFactoryImpl.java:33)
>>>>
>>>>       [java]     at
>>>> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(
>>>> DelegatorFactoryImpl.java:25)
>>>>
>>>>       [java]     at
>>>> org.ofbiz.base.util.UtilObject.getObjectFromFactory(
>>>> UtilObject.java:202)
>>>>       [java]     at
>>>> org.ofbiz.entity.DelegatorFactory.getDelegator(
>>>> DelegatorFactory.java:51)
>>>>       [java]     at
>>>> org.ofbiz.entityext.data.EntityDataLoadContainer.loadContainer(
>>>> EntityDataLoadContainer.java:272)
>>>>
>>>>       [java]     at
>>>> org.ofbiz.entityext.data.EntityDataLoadContainer.start(
>>>> EntityDataLoadContainer.java:236)
>>>>
>>>>       [java]     at
>>>> org.ofbiz.base.container.ContainerLoader.start(
>>>> ContainerLoader.java:230)
>>>>       [java]     at
>>>> org.ofbiz.base.start.Start.startStartLoaders(Start.java:362)
>>>>       [java]     at org.ofbiz.base.start.Start.start(Start.java:337)
>>>>       [java]     at org.ofbiz.base.start.Start.main(Start.java:139)
>>>>       [java] 2014-06-02 17:14:07,337 (Thread-0) [
>>>> ContainerLoader.java:246:INFO ] Shutting down containers
>>>>       [java] Java Result: 99
>>>>
>>>> BUILD SUCCESSFUL
>>>> Total time: 31 seconds
>>>>
>>>>
>>>>
>>>> On 02/06/2014 4:26 PM, Adrian Crum wrote:
>>>>
>>>>> The correct steps are there:
>>>>>
>>>>> Modify an existing datasource (near the bottom of the file) or create
>>>>> a new one by copying one of the sample datasources already there and
>>>>> giving it a new unique name
>>>>>
>>>>>     If using the default OFBiz transaction manager and connection
>>>>> pool, update the data URI, username and password in the inline-jdbc tag
>>>>>     If you want your OFBiz tables in a special schema first create
>>>>> that schema in your database, then set the schema-name attribute on
>>>>> the datasource tag
>>>>>     Find the "default" delegator near the top of the file and change
>>>>> the datasource-name attribute value in the group-map tag under it to
>>>>> the name of the data source you modified or created.
>>>>>
>>>>>
>>>>> Adrian Crum
>>>>> Sandglass Software
>>>>> www.sandglass-software.com
>>>>>
>>>>> On 6/2/2014 1:01 PM, Ron Wheeler wrote:
>>>>>
>>>>>> It appears that there is a missing step in the description about how
>>>>>> to
>>>>>> run OfBiz with a database other than Derby.
>>>>>> https://cwiki.apache.org/confluence/display/OFBTECH/
>>>>>> Apache+OFBiz+Technical+Production+Setup+Guide
>>>>>>
>>>>>>
>>>>>>
>>>>>> talks about changing the "default" delegator but it does not mention
>>>>>> anywhere that I can find, how you tell OfBiz that  you want to use the
>>>>>> delegator associated with My SQL.
>>>>>>
>>>>>> I am getting a null pointer which I think is caused by OfBiz still
>>>>>> trying to use Derby which no longer has a delegator sice it is
>>>>>> commented
>>>>>> out and the MySQL one is uncommented.
>>>>>>
>>>>>> What is the secret step tat I need to to to make the instructions
>>>>>> work?
>>>>>>
>>>>>> Ron
>>>>>>
>>>>>>
>>>>
>>
>
> --
> Ron Wheeler
> President
> Artifact Software Inc
> email: [hidden email]
> skype: ronaldmwheeler
> phone: 866-970-2435, ext 102
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Getting Started using MySQL

Ron Wheeler
The screenshots would make a nice addition to the instructions that
Adrian supplied.
They worked very well and I am now trying to get my head around the
actual functionality.

It appears that everyone likes writing new documentation rather than
fixing the "official" docs.

Ron


On 03/06/2014 6:52 PM, Sergio G Barreros wrote:

> This is what I always use and it's very easy to follow.
>
> http://lj4newbies.blogspot.com/2008/06/setup-mysql-with-ofbiz.html
>
>
> Regards,
> Sergio
>
>
>
> On Tue, Jun 3, 2014 at 3:54 AM, Ron Wheeler
> <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     There is a description about how to add the database connector but
>     it is different and more complicated.
>
>     If necessary, put the correct JDBC driver in:
>     ${ofbiz install dir}/framework/entity/lib/jdbc
>     replacing the old or incorrect version of the driver there (ie
>     copy in with same name to avoid problems with update restoring the
>     old driver later)
>
>
>
>     On 03/06/2014 12:31 AM, Deepak Dixit wrote:
>
>         One more step:
>
>         Don't forgot to put the mySql drive.
>         Use "./ant download-mySQL-JDBC" to download the mysql driver.
>
>         Thanks & Regards
>         ---
>         Deepak Dixit
>
>         On Jun 3, 2014, at 3:10 AM, Adrian Crum
>         <[hidden email]
>         <mailto:[hidden email]>> wrote:
>
>             Here is what I recommend:
>
>             1. Restore the original file.
>
>             2. Modify the "localmysql" datasource element to connect
>             to your database.
>
>             3. Modify the "default" delegator element:
>                 Change
>                     <group-map group-name="org.ofbiz"
>             datasource-name="localderby"/>
>                 to
>                     <group-map group-name="org.ofbiz"
>             datasource-name="localmysql"/>
>
>             The OLAP and Tenant data sources will still use Derby. If
>             you want to change those to use MySQL also, then:
>
>             1. Modify the "localmysqlolap" datasource element to
>             connect to your OLAP database.
>
>             2. Modify the "localmysqltenant" datasource element to
>             connect to your Tenant database.
>
>             3. Modify the "default" delegator element:
>                 Change
>                     <group-map group-name="org.ofbiz.olap"
>             datasource-name="localderbyolap"/>
>                 to
>                     <group-map group-name="org.ofbiz.olap"
>             datasource-name="localmysqlolap"/>
>                 Change
>                     <group-map group-name="org.ofbiz.tenant"
>             datasource-name="localderbytenant"/>
>                 to
>                     <group-map group-name="org.ofbiz.tenant"
>             datasource-name="localmysqltenant"/>
>
>             Finally, run:
>
>             ant load-demo
>
>             Adrian Crum
>             Sandglass Software
>             www.sandglass-software.com <http://www.sandglass-software.com>
>
>             On 6/2/2014 2:26 PM, Ron Wheeler wrote:
>
>                 In  entityengine.xml, I removed the databases that I
>                 am not using just
>                 to make it clearer.
>                 As OfBiz is distributed there seems to be several
>                 group-map entries that
>                 are active and some commented out.
>                 There seemed to be several different group-names in use.
>                 Did I understand the instructions incorrectly or have
>                 I screwed up
>                 somewhere else?
>                 The ofbiz database exists and the ofbiz user has all
>                 privs on it.
>                 A null pointer usually means that I promised to
>                 provide an object and I
>                 didn't rather than a database security error.
>                 I have not touched any other configuration files.
>
>                      <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="localmysql"/>
>                      </delegator>
>                 .
>                 .
>                 .
>
>                    <datasource name="localmysql"
>                 helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>                              field-type-name="mysql"
>                              check-on-start="true"
>                              add-missing-on-start="true"
>                              check-pks-on-start="false"
>                              use-foreign-keys="true"
>                              join-style="ansi-no-parenthesis"
>                              alias-view-columns="false"
>                              drop-fk-use-foreign-key-keyword="true"
>                              table-type="InnoDB"
>                              character-set="latin1"
>                              collate="latin1_general_cs">
>                          <read-data reader-name="tenant"/>
>                          <read-data reader-name="seed"/>
>                          <read-data reader-name="seed-initial"/>
>                          <read-data reader-name="demo"/>
>                          <read-data reader-name="ext"/>
>                          <inline-jdbc
>                                  jdbc-driver="com.mysql.jdbc.Driver"
>                 jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true
>                 <http://127.0.0.1/ofbiz?autoReconnect=true>"
>                                  jdbc-username="ofbiz"
>                                  jdbc-password="mylittlesecret"
>                                  isolation-level="ReadCommitted"
>                                  pool-minsize="2"
>                                  pool-maxsize="250"
>                                
>                  time-between-eviction-runs-millis="600000"/>
>                      </datasource>
>
>                 Gives me:
>                      [java] 2014-06-02 17:14:05,843 (main) [
>                 ModelViewEntity.java:551:WARN ] [ExampleStatusDetail]:
>                 Conversion for
>                 complex-alias needs to be implemented for cache and
>                 in-memory eval stuff
>                 to work correctly, will not work for alias: statusDelay
>                       [java] 2014-06-02 17:14:06,202 (main) [
>                 ModelReader.java:436:INFO
>                 ] FINISHED LOADING ENTITIES - ALL FILES; #Entities=863
>                 #ViewEntities=300
>                 #Fields=9049 #Relationships=2961 #AutoRelationships=2186
>                       [java] 2014-06-02 17:14:06,297 (main) [
>                 GenericDelegator.java:234:INFO ] Doing entity
>                 definition check...
>                       [java] 2014-06-02 17:14:06,317 (main) [
>                 ModelEntityChecker.java:508:INFO ] [initReservedWords]
>                 array length=1023
>                       [java] java.lang.NullPointerException
>                       [java]     at
>                 org.ofbiz.entity.GenericDelegator.getEntityFieldType(GenericDelegator.java:541)
>
>                       [java]     at
>                 org.ofbiz.entity.model.ModelEntityChecker.checkEntities(ModelEntityChecker.java:107)
>
>                       [java]     at
>                 org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:235)
>                       [java]     at
>                 org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:33)
>
>                       [java]     at
>                 org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:25)
>
>                       [java]     at
>                 org.ofbiz.base.util.UtilObject.getObjectFromFactory(UtilObject.java:202)
>                       [java]     at
>                 org.ofbiz.entity.DelegatorFactory.getDelegator(DelegatorFactory.java:51)
>                       [java]     at
>                 org.ofbiz.entityext.data.EntityDataLoadContainer.loadContainer(EntityDataLoadContainer.java:272)
>
>                       [java]     at
>                 org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:236)
>
>                       [java]     at
>                 org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:230)
>                       [java]     at
>                 org.ofbiz.base.start.Start.startStartLoaders(Start.java:362)
>                       [java]     at
>                 org.ofbiz.base.start.Start.start(Start.java:337)
>                       [java]     at
>                 org.ofbiz.base.start.Start.main(Start.java:139)
>                       [java] 2014-06-02 17:14:07,337 (Thread-0) [
>                 ContainerLoader.java:246:INFO ] Shutting down containers
>                       [java] Java Result: 99
>
>                 BUILD SUCCESSFUL
>                 Total time: 31 seconds
>
>
>
>                 On 02/06/2014 4:26 PM, Adrian Crum wrote:
>
>                     The correct steps are there:
>
>                     Modify an existing datasource (near the bottom of
>                     the file) or create
>                     a new one by copying one of the sample datasources
>                     already there and
>                     giving it a new unique name
>
>                         If using the default OFBiz transaction manager
>                     and connection
>                     pool, update the data URI, username and password
>                     in the inline-jdbc tag
>                         If you want your OFBiz tables in a special
>                     schema first create
>                     that schema in your database, then set the
>                     schema-name attribute on
>                     the datasource tag
>                         Find the "default" delegator near the top of
>                     the file and change
>                     the datasource-name attribute value in the
>                     group-map tag under it to
>                     the name of the data source you modified or created.
>
>
>                     Adrian Crum
>                     Sandglass Software
>                     www.sandglass-software.com
>                     <http://www.sandglass-software.com>
>
>                     On 6/2/2014 1:01 PM, Ron Wheeler wrote:
>
>                         It appears that there is a missing step in the
>                         description about how to
>                         run OfBiz with a database other than Derby.
>                         https://cwiki.apache.org/confluence/display/OFBTECH/Apache+OFBiz+Technical+Production+Setup+Guide
>
>
>
>                         talks about changing the "default" delegator
>                         but it does not mention
>                         anywhere that I can find, how you tell OfBiz
>                         that  you want to use the
>                         delegator associated with My SQL.
>
>                         I am getting a null pointer which I think is
>                         caused by OfBiz still
>                         trying to use Derby which no longer has a
>                         delegator sice it is commented
>                         out and the MySQL one is uncommented.
>
>                         What is the secret step tat I need to to to
>                         make the instructions work?
>
>                         Ron
>
>
>
>
>
>     --
>     Ron Wheeler
>     President
>     Artifact Software Inc
>     email: [hidden email]
>     <mailto:[hidden email]>
>     skype: ronaldmwheeler
>     phone: 866-970-2435, ext 102 <tel:866-970-2435%2C%20ext%20102>
>
>


--
Ron Wheeler
President
Artifact Software Inc
email: [hidden email]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started using MySQL

Jacques Le Roux
Administrator
You are welcome to help... Rants never do...

Jacques

Le 04/06/2014 07:01, Ron Wheeler a écrit :

> The screenshots would make a nice addition to the instructions that Adrian supplied.
> They worked very well and I am now trying to get my head around the actual functionality.
>
> It appears that everyone likes writing new documentation rather than fixing the "official" docs.
>
> Ron
>
>
> On 03/06/2014 6:52 PM, Sergio G Barreros wrote:
>> This is what I always use and it's very easy to follow.
>>
>> http://lj4newbies.blogspot.com/2008/06/setup-mysql-with-ofbiz.html
>>
>>
>> Regards,
>> Sergio
>>
>>
>>
>> On Tue, Jun 3, 2014 at 3:54 AM, Ron Wheeler <[hidden email] <mailto:[hidden email]>> wrote:
>>
>>     There is a description about how to add the database connector but
>>     it is different and more complicated.
>>
>>     If necessary, put the correct JDBC driver in:
>>     ${ofbiz install dir}/framework/entity/lib/jdbc
>>     replacing the old or incorrect version of the driver there (ie
>>     copy in with same name to avoid problems with update restoring the
>>     old driver later)
>>
>>
>>
>>     On 03/06/2014 12:31 AM, Deepak Dixit wrote:
>>
>>         One more step:
>>
>>         Don't forgot to put the mySql drive.
>>         Use "./ant download-mySQL-JDBC" to download the mysql driver.
>>
>>         Thanks & Regards
>>         ---
>>         Deepak Dixit
>>
>>         On Jun 3, 2014, at 3:10 AM, Adrian Crum
>>         <[hidden email]
>>         <mailto:[hidden email]>> wrote:
>>
>>             Here is what I recommend:
>>
>>             1. Restore the original file.
>>
>>             2. Modify the "localmysql" datasource element to connect
>>             to your database.
>>
>>             3. Modify the "default" delegator element:
>>                 Change
>>                     <group-map group-name="org.ofbiz"
>>             datasource-name="localderby"/>
>>                 to
>>                     <group-map group-name="org.ofbiz"
>>             datasource-name="localmysql"/>
>>
>>             The OLAP and Tenant data sources will still use Derby. If
>>             you want to change those to use MySQL also, then:
>>
>>             1. Modify the "localmysqlolap" datasource element to
>>             connect to your OLAP database.
>>
>>             2. Modify the "localmysqltenant" datasource element to
>>             connect to your Tenant database.
>>
>>             3. Modify the "default" delegator element:
>>                 Change
>>                     <group-map group-name="org.ofbiz.olap"
>>             datasource-name="localderbyolap"/>
>>                 to
>>                     <group-map group-name="org.ofbiz.olap"
>>             datasource-name="localmysqlolap"/>
>>                 Change
>>                     <group-map group-name="org.ofbiz.tenant"
>>             datasource-name="localderbytenant"/>
>>                 to
>>                     <group-map group-name="org.ofbiz.tenant"
>>             datasource-name="localmysqltenant"/>
>>
>>             Finally, run:
>>
>>             ant load-demo
>>
>>             Adrian Crum
>>             Sandglass Software
>>             www.sandglass-software.com <http://www.sandglass-software.com>
>>
>>             On 6/2/2014 2:26 PM, Ron Wheeler wrote:
>>
>>                 In  entityengine.xml, I removed the databases that I
>>                 am not using just
>>                 to make it clearer.
>>                 As OfBiz is distributed there seems to be several
>>                 group-map entries that
>>                 are active and some commented out.
>>                 There seemed to be several different group-names in use.
>>                 Did I understand the instructions incorrectly or have
>>                 I screwed up
>>                 somewhere else?
>>                 The ofbiz database exists and the ofbiz user has all
>>                 privs on it.
>>                 A null pointer usually means that I promised to
>>                 provide an object and I
>>                 didn't rather than a database security error.
>>                 I have not touched any other configuration files.
>>
>>                      <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="localmysql"/>
>>                      </delegator>
>>                 .
>>                 .
>>                 .
>>
>>                    <datasource name="localmysql"
>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>                              field-type-name="mysql"
>>                              check-on-start="true"
>>                              add-missing-on-start="true"
>>                              check-pks-on-start="false"
>>                              use-foreign-keys="true"
>>                              join-style="ansi-no-parenthesis"
>>                              alias-view-columns="false"
>> drop-fk-use-foreign-key-keyword="true"
>>                              table-type="InnoDB"
>>                              character-set="latin1"
>>                              collate="latin1_general_cs">
>>                          <read-data reader-name="tenant"/>
>>                          <read-data reader-name="seed"/>
>>                          <read-data reader-name="seed-initial"/>
>>                          <read-data reader-name="demo"/>
>>                          <read-data reader-name="ext"/>
>>                          <inline-jdbc
>> jdbc-driver="com.mysql.jdbc.Driver"
>> jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true
>> <http://127.0.0.1/ofbiz?autoReconnect=true>"
>>                                  jdbc-username="ofbiz"
>>                                  jdbc-password="mylittlesecret"
>>                                  isolation-level="ReadCommitted"
>>                                  pool-minsize="2"
>>                                  pool-maxsize="250"
>> time-between-eviction-runs-millis="600000"/>
>>                      </datasource>
>>
>>                 Gives me:
>>                      [java] 2014-06-02 17:14:05,843 (main) [
>>                 ModelViewEntity.java:551:WARN ] [ExampleStatusDetail]:
>>                 Conversion for
>>                 complex-alias needs to be implemented for cache and
>>                 in-memory eval stuff
>>                 to work correctly, will not work for alias: statusDelay
>>                       [java] 2014-06-02 17:14:06,202 (main) [
>>                 ModelReader.java:436:INFO
>>                 ] FINISHED LOADING ENTITIES - ALL FILES; #Entities=863
>>                 #ViewEntities=300
>>                 #Fields=9049 #Relationships=2961 #AutoRelationships=2186
>>                       [java] 2014-06-02 17:14:06,297 (main) [
>>                 GenericDelegator.java:234:INFO ] Doing entity
>>                 definition check...
>>                       [java] 2014-06-02 17:14:06,317 (main) [
>>                 ModelEntityChecker.java:508:INFO ] [initReservedWords]
>>                 array length=1023
>>                       [java] java.lang.NullPointerException
>>                       [java]     at
>> org.ofbiz.entity.GenericDelegator.getEntityFieldType(GenericDelegator.java:541)
>>
>>                       [java]     at
>> org.ofbiz.entity.model.ModelEntityChecker.checkEntities(ModelEntityChecker.java:107)
>>
>>                       [java]     at
>> org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:235)
>>                       [java]     at
>> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:33)
>>
>>                       [java]     at
>> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:25)
>>
>>                       [java]     at
>> org.ofbiz.base.util.UtilObject.getObjectFromFactory(UtilObject.java:202)
>>                       [java]     at
>> org.ofbiz.entity.DelegatorFactory.getDelegator(DelegatorFactory.java:51)
>>                       [java]     at
>> org.ofbiz.entityext.data.EntityDataLoadContainer.loadContainer(EntityDataLoadContainer.java:272)
>>
>>                       [java]     at
>> org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:236)
>>
>>                       [java]     at
>> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:230)
>>                       [java]     at
>> org.ofbiz.base.start.Start.startStartLoaders(Start.java:362)
>>                       [java]     at
>>                 org.ofbiz.base.start.Start.start(Start.java:337)
>>                       [java]     at
>>                 org.ofbiz.base.start.Start.main(Start.java:139)
>>                       [java] 2014-06-02 17:14:07,337 (Thread-0) [
>>                 ContainerLoader.java:246:INFO ] Shutting down containers
>>                       [java] Java Result: 99
>>
>>                 BUILD SUCCESSFUL
>>                 Total time: 31 seconds
>>
>>
>>
>>                 On 02/06/2014 4:26 PM, Adrian Crum wrote:
>>
>>                     The correct steps are there:
>>
>>                     Modify an existing datasource (near the bottom of
>>                     the file) or create
>>                     a new one by copying one of the sample datasources
>>                     already there and
>>                     giving it a new unique name
>>
>>                         If using the default OFBiz transaction manager
>>                     and connection
>>                     pool, update the data URI, username and password
>>                     in the inline-jdbc tag
>>                         If you want your OFBiz tables in a special
>>                     schema first create
>>                     that schema in your database, then set the
>>                     schema-name attribute on
>>                     the datasource tag
>>                         Find the "default" delegator near the top of
>>                     the file and change
>>                     the datasource-name attribute value in the
>>                     group-map tag under it to
>>                     the name of the data source you modified or created.
>>
>>
>>                     Adrian Crum
>>                     Sandglass Software
>>                     www.sandglass-software.com
>>                     <http://www.sandglass-software.com>
>>
>>                     On 6/2/2014 1:01 PM, Ron Wheeler wrote:
>>
>>                         It appears that there is a missing step in the
>>                         description about how to
>>                         run OfBiz with a database other than Derby.
>> https://cwiki.apache.org/confluence/display/OFBTECH/Apache+OFBiz+Technical+Production+Setup+Guide
>>
>>
>>
>>                         talks about changing the "default" delegator
>>                         but it does not mention
>>                         anywhere that I can find, how you tell OfBiz
>>                         that  you want to use the
>>                         delegator associated with My SQL.
>>
>>                         I am getting a null pointer which I think is
>>                         caused by OfBiz still
>>                         trying to use Derby which no longer has a
>>                         delegator sice it is commented
>>                         out and the MySQL one is uncommented.
>>
>>                         What is the secret step tat I need to to to
>>                         make the instructions work?
>>
>>                         Ron
>>
>>
>>
>>
>>
>>     --     Ron Wheeler
>>     President
>>     Artifact Software Inc
>>     email: [hidden email]
>>     <mailto:[hidden email]>
>>     skype: ronaldmwheeler
>>     phone: 866-970-2435, ext 102 <tel:866-970-2435%2C%20ext%20102>
>>
>>
>
>

--