OFBiz階段の環境構築(eclipse)

29382 ワード

一、環境準備
1. jdk 1.6
ダウンロード先:http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6 u 45-oth-JPR
2. eclipse
ダウンロード先:
3.mysql
4. navicat for mysql
5.tomcat
二、環境構築
1.jdkを配置し、環境変数を配置する
2.tomcatの配置
3.mysqlデータベースのインストール
    データベースobizを作成して、ユーザobizとパスワードobizを新規に作成し、obizのすべての権限を付与します.
4.obizソースコードをダウンロードする
    ダウンロード先:http://apache.dataguru.cn/ofbiz/apache-ofbiz-12.04.05.zip
5.配置eclipse
    eclipseを開き、obizプロジェクトを導入します.
三、初期化obiz
1.mysqlデータベース配置に切り替える
OfbizのデータベースはDerbyであり、Derbyはテストシステムのデータベースであり、開発には適していません.
 
    1.1 JDBCドライバを更新し、mysqlのjdbcドライバを$
    1.2 修正米ドル{OfbizHome}\frame ework\entity\configでのentityengine.xmlは以下の通りです.
          すべてのdelagatorのmysqlのコメントを削除し、該当するdersbyの設定をコメントしてください.

    <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="localderby"/>

        <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>

        <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/> -->

        <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"/>

        <!-- <group-map group-name="org.ofbiz" datasource-name="localpostnew"/>

        <group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/>

        <group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> -->

    </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="localderby"/>

        <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>

        <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/> -->

        <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"/>

        <!-- <group-map group-name="org.ofbiz" datasource-name="localpostnew"/>

        <group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/>

        <group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/>  -->

    </delegator>



    <!-- be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "ant run-install" before running "ant run-tests" -->

    <delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main">

        <!-- <group-map group-name="org.ofbiz" datasource-name="localderby"/>

        <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>

        <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/> -->

        <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"/>

        <!-- <group-map group-name="org.ofbiz" datasource-name="localpostnew"/>

        <group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/>

        <group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/>  -->

    </delegator>
View Code
          mysqlデータベースのソース情報を修正して、データベースの基本配置情報、文字セット、接続数などを修正することに注意します.

    <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="utf8"

            collate="utf8_general_ci">

        <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="ofbiz"

                isolation-level="ReadCommitted"

                pool-minsize="2"

                pool-maxsize="50"

                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="utf8"

            collate="utf8_general_ci">

        <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/ofbizolap?autoReconnect=true"

                jdbc-username="ofbiz"

                jdbc-password="ofbiz"

                isolation-level="ReadCommitted"

                pool-minsize="2"

                pool-maxsize="50"

                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="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="utf8"

            collate="utf8_general_ci">

        <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/ofbiztenant?autoReconnect=true"

                jdbc-username="ofbiz"

                jdbc-password="ofbiz"

                isolation-level="ReadCommitted"

                pool-minsize="2"

                pool-maxsize="50"

                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="odbcmysql"

            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="utf8"

            collate="utf8_general_ci">

        <read-data reader-name="tenant"/>

        <read-data reader-name="seed"/>

        <inline-jdbc

                jdbc-driver="com.mysql.jdbc.Driver"

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

                jdbc-username="ofbiz"

                jdbc-password="ofbiz"

                isolation-level="ReadCommitted"

                pool-minsize="2"

                pool-maxsize="50"

                time-between-eviction-runs-millis="600000"/>

        <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> -->

    </datasource>
View Code
2.obizの運転
    2.1 OFBIZプレゼンテーションデータのインストール
ant load-demo
    2.2 obizを起動する
ant start
    2.3テスト
http://localhost:8080/ecommerce
https://localhost:8443/webtoolsまたはhttp://localhost:8080/webtools