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,目录结构如下:
[img]http://dl.iteye.com/upload/attachment/195043/574c799e-b4b0-3ec7-a40e-9e6e42626747.jpg[/img]
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
[color=red]name="localmysql"[/color]
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="[color=red]gbk[/color]" [color=red]--字符集[/color]
collate="[color=red]gbk_chinese_ci[/color]"> [color=red]--排序方式[/color]
<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/[color=red]ofbiz9[/color]?
autoReconnect=true" [color=red]--数据库名[/color]
jdbc-username="[color=red]root[/color]" [color=red]--用户名[/color]
jdbc-password="" [color=red]--密码[/color]
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"
[color=red]datasource-name="localmysql"[/color]/>
<group-map group-name="org.ofbiz.olap"
[color=red]datasource-name="localmysql"[/color]/>
</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"
[color=red]datasource-name="localmysql"[/color]/>
<group-map group-name="org.ofbiz.olap"
[color=red]datasource-name="localmysql"[/color]/>
</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"
[color=red]datasource-name="localmysql"[/color]/>
<group-map group-name="org.ofbiz.olap"
[color=red]datasource-name="localmysql"[/color]/>
</delegator>
<delegator name="other"
entity-model-reader="main"
entity-group-reader="main"
entity-eca-reader="main">
<group-map group-name="org.ofbiz"
[color=red]datasource-name="localmysql"[/color]/>
</delegator>
8.打开dos并在ofbiz9 目录下执行命令(时间较长):
ant run-install
startofbiz.bat
9.启动成功,可以打开以下界面:
http://localhost:8080/ecommerce;
https://localhost:8443/webtools;
至此,ofbiz9 安装成功。
2.下载 MySQL数据库:mysql-5.0.15-win32.rar,解压到 E 盘。
3.下载 Ofbiz:ofbiz-trunk-2009-12-21-v892743.zip.
4.解压到 E 盘,命名为:ofbiz9,目录结构如下:
[img]http://dl.iteye.com/upload/attachment/195043/574c799e-b4b0-3ec7-a40e-9e6e42626747.jpg[/img]
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
[color=red]name="localmysql"[/color]
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="[color=red]gbk[/color]" [color=red]--字符集[/color]
collate="[color=red]gbk_chinese_ci[/color]"> [color=red]--排序方式[/color]
<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/[color=red]ofbiz9[/color]?
autoReconnect=true" [color=red]--数据库名[/color]
jdbc-username="[color=red]root[/color]" [color=red]--用户名[/color]
jdbc-password="" [color=red]--密码[/color]
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"
[color=red]datasource-name="localmysql"[/color]/>
<group-map group-name="org.ofbiz.olap"
[color=red]datasource-name="localmysql"[/color]/>
</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"
[color=red]datasource-name="localmysql"[/color]/>
<group-map group-name="org.ofbiz.olap"
[color=red]datasource-name="localmysql"[/color]/>
</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"
[color=red]datasource-name="localmysql"[/color]/>
<group-map group-name="org.ofbiz.olap"
[color=red]datasource-name="localmysql"[/color]/>
</delegator>
<delegator name="other"
entity-model-reader="main"
entity-group-reader="main"
entity-eca-reader="main">
<group-map group-name="org.ofbiz"
[color=red]datasource-name="localmysql"[/color]/>
</delegator>
8.打开dos并在ofbiz9 目录下执行命令(时间较长):
ant run-install
startofbiz.bat
9.启动成功,可以打开以下界面:
http://localhost:8080/ecommerce;
https://localhost:8443/webtools;
至此,ofbiz9 安装成功。