一、 环境准备

1. jdk1.6

下载地址:http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR

2. eclipse

下载地址:

3. mysql

4. navicat for mysql

5. tomcat

二、 环境搭建

1. 配置jdk,配置环境变量

2. 配置tomcat

3. 安装mysql数据库

建立数据库ofbiz,新建用户ofbiz和密码ofbiz,并且赋予ofbiz全部权限。

4. 下载ofbiz源代码

下载地址:http://apache.dataguru.cn/ofbiz/apache-ofbiz-12.04.05.zip

5. 配置eclipse

打开eclipse,并导入ofbiz项目。

三、初始化ofbiz

1. 改用mysql数据库配置

Ofbiz自带的数据库是Derby,Derby是测试系统的数据库,不适合开发用。

1.1 更新JDBC驱动,将mysql的jdbc驱动拷贝到${Ofbiz_Home}\framework\entity\lib\jdbc 目录下。

1.2 修改${Ofbiz_Home}\framework\entity\config下的entityengine.xml,如下:

把所有的delagator 的mysql的注释去掉,然后把相应的derby的设置注释掉。

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

修改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>

2. 运行ofbiz

2.1 安装OFBIZ演示数据

ant load-demo

2.2 启动ofbiz

ant start

2.3 测试

http://localhost:8080/ecommerce

https://localhost:8443/webtools或者http://localhost:8080/webtools

OFBiz进阶之环境搭建(eclipse)的更多相关文章

  1. gradle ofbiz 16 开发环境搭建

    原 gradle ofbiz 16 开发环境搭建 2017年02月13日 10:59:19 阅读数:2702 1.安装jdk 2.配置jdk环境变量 3.eclipse 安装svn 插件 4.svn下 ...

  2. NDK学习一: 环境搭建Eclipse篇

    下载NDK 国内的一个镜像站点 下载速度比较快 http://wear.techbrood.com/tools/sdk/ndk/#Installing 网上搭建环境的方案有很多 1. Eclipse ...

  3. Python介绍、环境搭建(Eclipse插件)、第一个程序

    Python介绍 特点 优雅.明白.简单. 适合领域 1. Web站点和各种网络服务 2. 系统工具和脚本 3. 作为"胶水"语言把其它语言开发的模块包装起来方便使用 和其它语言对 ...

  4. JavaWeb开发环境搭建Eclipse配置Tomcat

    转载请标明出处:http://blog.csdn.net/wu_wxc/article/details/48651251本文出自[吴孝城的CSDN博客] 工具: Eclipse官网下载:http:// ...

  5. javaEE环境搭建-eclipse

    1.       javaEE环境搭建: (1)     JDK1.8 (2)     eclipse-JavaEE (3)     tomcat-7.0.90 下载地址: https://tomca ...

  6. GWT环境搭建--eclipse

    上面下来需求,需要用到GWT,以前没接触过,搭个开发环境研究研究 安装软件我放在百度云盘里了(其他版本自己找,我的版本 eclipse4.4 luna  gwt2.7) 链接:http://pan.b ...

  7. android开发1:安卓开发环境搭建(eclipse+jdk+sdk)

    计划折腾折腾安卓开发了,从0开始的确很痛苦,不过相信上手应该也不会太慢.哈哈 一.Android简介 Android 是基于Linux内核的软件平台和操作系统. Android构架主要由3部分组成,l ...

  8. windows8.1下android开发环境搭建(Eclipse+Android sdk+ADT+Genymotion)

    一.基本jdk.eclipse环境 二.android sdk 1.下载安装:https://developer.android.com/sdk/installing/index.html?pkg=t ...

  9. JAVA开发环境搭建 - Eclipse基本配置

    Eclipse设置的内容包括许多方面,不同的开发人员,不同的项目需要,可能对Eclipse的设置不尽相同.如下内容仅是对本人的一些基本设置做一些记录,以作备忘.后期会逐渐对相关内容进行更新,仅供参考. ...

随机推荐

  1. JAVA_HttpClientUtils

    package org.mobiletrain.utils; import java.io.BufferedInputStream; import java.io.BufferedOutputStre ...

  2. Java中处理Linux信号量

    为了防止无良网站的爬虫抓取文章,特此标识,转载请注明文章出处.LaplaceDemon/ShiJiaqi. http://www.cnblogs.com/shijiaqi1066/p/5976361. ...

  3. mongodb学习相关网址

    1.MongoDB官网 https://www.mongodb.org 2.MongoDB教程 http://www.yiibai.com/mongodb 3.MongoDB教程http://www. ...

  4. 目前电脑的硬件尺寸参数,计划弄个小一些的ATX机箱

    显卡:讯景R9 370x 尺寸:234×115×39mm 主板:技嘉GA-970A-DS3P 尺寸: 30.5X21.5 cm

  5. C#实现快速排序法

    现在有数组{ 3, 6, 2, 1, 9, 5, 4, 7 }; 然后用快速排序法把他们排序 1.首先 ,取出3作为比较数据 2.从最右边往左边比较找到第一个比3小的数据,把3在数组中的位置赋值为那个 ...

  6. media type和media query

    media type media type是CSS2的重要属性,通过它,可以针对不同的设备指定不同的样式.   media type种类:   用法: <link href="styl ...

  7. Spring MVC中如何指定某个类或方法自适配地响应某个HTTP请求?

    方法已经找到,即调用AbstractHandlerMethodAdapter.handle() public final ModelAndView handle(HttpServletRequest  ...

  8. SqlServer2005安装错误解决方法

    前段时间在安装数据库SQL Server2005时,在系统检测这一步计算机报了一个错误,提示“性能监视器计数要求(错误)”,使得安装无法继续进行,于是在网上找了些方法来解决,其中有一个方法最有效,在这 ...

  9. SQLite 入门教程(一)基本控制台(终端)命令

    一.基本简介 SQLite 是一个自持的(self-contained).无服务器的.零配置的.事务型的关系型数据库引擎.因为他很小,所以也可以作为嵌入式数据库内建在你的应用程序中.SQLite 被应 ...

  10. python 安装mysql 客户端遇到的问题

    一. Win7 64位编译Python扩展解决”error: Unable to find vcvarsall.bat”问题   系统上安装有Visual Studio 2010以及相应的SDK,然后 ...