2017-04-18 96 views
0

我嘗試使用this tutorial將Apache OFBiz從derby遷移到mysql。在entityengine.xml進行更改之前,我使用defaultData執行了ofbiz,並將數據從webtools導出到xml文件中。之後,我完成了所有這些更改,創建了工作數據庫模式和用戶。但是,當我這些更改後運行ofbiz的,我得到消息將Apache OFBiz從Derby遷移到MySQL

`invalid delegator name!` 

爲什麼是個例外?我目前使用16.011版本的OFBiz。下面是我的委託和數據源看起來怎麼樣

<datasource name="localmysql" 
      helper-class="org.apache.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"/> 
     <read-data reader-name="ext-test"/> 
     <read-data reader-name="ext-demo"/> 
     <inline-jdbc 
       jdbc-driver="com.mysql.jdbc.Driver" 
       jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true" 
       jdbc-username="ofbiz" 
       jdbc-password="ofbiz" 
       isolation-level="ReadCommitted" 
       pool-minsize="2" 
       pool-maxsize="250" 
       time-between-eviction-runs-millis="600000"/><!-- Please note that at least one person has experienced a problem with this value with MySQL 
       and had to set it to -1 in order to avoid this issue. 
       For more look at http://markmail.org/thread/5sivpykv7xkl66px and http://commons.apache.org/dbcp/configuration.html--> 
     <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> --> 
    </datasource> 
    <datasource name="localmysqlolap" 
      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="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="ofbizolap" 
       jdbc-password="ofbizolap" 
       isolation-level="ReadCommitted" 
       pool-minsize="2" 
       pool-maxsize="250" 
       time-between-eviction-runs-millis="600000"/> 
    </datasource> 

    <datasource name="localmysqltenant" 
      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="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="ofbiztenant" 
       jdbc-password="ofbiztenant" 
       isolation-level="ReadCommitted" 
       pool-minsize="2" 
       pool-maxsize="250" 
       time-between-eviction-runs-millis="600000"/> 
    </datasource> 

和委託者

<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"/> 
     <group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/> 
     <group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/> 
    </delegator> 

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

    <delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main"> 
     <group-map group-name="org.ofbiz" datasource-name="localmysql"/> 
     <group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/> 
     <group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/> 
    </delegator> 

回答

0

最近阿帕奇OFBiz的包裝結構改變,提到tuturial沒有完全跟上時代的。我改變了「org.ofbiz」。條目到「org.apache.ofbiz」。在教程中。

請重試並報告萬事萬物現在是否適合您。

0

(我用OFBiz的版本02年11月16日,在這個時候最新的版本)

數據庫中創建用戶:

create database ofbiz; 
create database ofbizolap; 
create database ofbiztenant; 
use mysql; 
select database(); 
create user [email protected]; 
create user [email protected]; 
create user [email protected]; 

UPDATE mysql.user 
    SET authentication_string = PASSWORD('ofbiz'), password_expired = 'N' 
    WHERE User = 'ofbiz' AND Host = 'localhost'; 
FLUSH PRIVILEGES; 

UPDATE mysql.user 
    SET authentication_string = PASSWORD('ofbizolap'), password_expired = 'N' 
    WHERE User = 'ofbizolap' AND Host = 'localhost'; 
FLUSH PRIVILEGES; 

UPDATE mysql.user 
    SET authentication_string = PASSWORD('ofbiztenant'), password_expired = 'N' 
    WHERE User = 'ofbiztenant' AND Host = 'localhost'; 
FLUSH PRIVILEGES; 

grant all privileges on *.* to 'ofbiz'@localhost identified by 'ofbiz'; 
grant all privileges on *.* to 'ofbizolap'@localhost identified by 'ofbizolap'; 
grant all privileges on *.* to 'ofbiztenant'@localhost identified by 'ofbiztenant'; 

使用的端口號,默認爲3306

jdbc-uri="jdbc:mysql://127.0.0.1:3306/ofbiz?autoReconnect=true" 

查找單詞derby,將其更改爲mysql

然後

gradlew cleanAll --info 
gradlew loadDefault --info 
gradlew ofbiz --info