Ofbiz 9 + MySQL 5 的安装与运行

1.下载安装 JDK1.6,并设置环境变量:JAVA_HOME。

2.下载 MySQL数据库:mysql-5.0.15-win32.rar,解压到 E 盘。

3.下载 Ofbiz:ofbiz-trunk-2009-12-21-v892743.zip.

4.解压到 E 盘,命名为:ofbiz9,目录结构如下:

Ofbiz 9 + MySQL 5 的安装与运行

5.在 MySQL 创建数据库 ofbiz9。

6.更新JDBC驱动,将mysql的jdbc驱动copy到${ofbiz-install-dir}/framework/entity/lib/jdbc 目录下。

7.设置实体引擎( Entity Engine)的缺省数据库为mysql.在修改 ${ofbiz install dir}/framework/entity/config/entityengine.xml文件中修改配置:

   a.修改数据库连接参数:
<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=" gbk"   --字符集
            collate=" gbk_chinese_ci">  --排序方式
        <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/ ofbiz9?
autoReconnect=true"  --数据库名
                jdbc-username=" root--用户名
                jdbc-password=""   --密码
                isolation-level="ReadCommitted"
                pool-minsize="2"
                pool-maxsize="250"
                time-between-eviction-runs-millis="600000"/><!-- ####-->
        <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> -->
    </datasource>

    b. 修改实体引擎的数据库缺省配置如下:将datasource-name的值设置为 localmysql:
<!-- the connection factory class to use, one is needed for obtaining connections/pools for defined resources -->
    <connection-factory class="org.ofbiz.entity.connection.DBCPConnectionFactory"/>

    <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="localmysql"/>
    </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="localmysql"/>
    </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="localmysql"/>
        <group-map group-name="org.ofbiz.olap"
                   datasource-name="localmysql"/>
    </delegator>
   
            <delegator name="other"
               entity-model-reader="main"
               entity-group-reader="main"
               entity-eca-reader="main">
        <group-map group-name="org.ofbiz"
                  datasource-name="localmysql"/>
    </delegator>

8.打开dos并在ofbiz9 目录下执行命令(时间较长):
ant run-install
startofbiz.bat

9.启动成功,可以打开以下界面:
http://localhost:8080/ecommerce;
https://localhost:8443/webtools;

至此,ofbiz9 安装成功。




你可能感兴趣的:(数据结构,mysql,ant,jdbc,dos)