Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将ApacheOfBiz从Derby迁移到MySQL_Mysql_Derby_Ofbiz - Fatal编程技术网

将ApacheOfBiz从Derby迁移到MySQL

将ApacheOfBiz从Derby迁移到MySQL,mysql,derby,ofbiz,Mysql,Derby,Ofbiz,我尝试使用将apacheofbiz从derby迁移到mysql。在对entityengine.xml进行更改之前,我使用defaultData执行了ofbiz,并将数据从webtools导出到xml文件中。在那之后,我做了所有的更改,创建了工作数据库模式和用户。但是当我在这些更改之后运行ofbiz时,我得到一个异常消息 `invalid delegator name!` 为什么呢?我目前正在使用16.011版本的OFBiz。下面是我的委托人和数据源的样子 <datasource name

我尝试使用将apacheofbiz从
derby
迁移到
mysql
。在对
entityengine.xml
进行更改之前,我使用
defaultData
执行了ofbiz,并将数据从webtools导出到xml文件中。在那之后,我做了所有的更改,创建了工作数据库模式和用户。但是当我在这些更改之后运行ofbiz时,我得到一个异常消息

`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>

ApacheOfBiz包结构最近发生了变化,提到的tuturial不是完全最新的。我已经将教程中的“org.ofbiz.”条目更改为“org.apache.ofbiz.”

请再试一次并报告您现在是否一切正常。

(我使用的是BIZ版本16.11.02,目前的最新版本)

为数据库创建用户:

create database ofbiz;
create database ofbizolap;
create database ofbiztenant;
use mysql;
select database();
create user ofbiz@localhost;
create user ofbizolap@localhost;
create user ofbiztenant@localhost;

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"
找到word
derby
,将其更改为
mysql

然后

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