ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Wheeler <rwhee...@artifact-software.com>
Subject Re: Getting Started using MySQL
Date Tue, 03 Jun 2014 06:50:11 GMT
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: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


Mime
View raw message