1·首先安装java开发环境 本套教程采用 jdk1.8
2·eclipse 版本:Eclipse Jee Neon
3·eclipse 插件 svn
1·首先到官网下载项目到 eclipse http://svn.apache.org/repos/asf/ofbiz/branches/release15.12
2·下载好项目以后 项目会有红叹号 是缺少 /ofbiz/framework/base/build/gen-src/javacc 解决方案是运行 ant
3·第2步会生成ofbiz的jar包 ,第三步将他们引入 ,部署项目环境就完成了
4·EntityFieldMap 类的 getFieldEntryIterator 方法 会报错 暂时将其 return改为 Iterator<?> 改完项目就无其他异常了
5·将mysql的jdbc驱动拷贝到${Ofbiz_Home}/framework/entity/lib/jdbc 目录下。 如果忘记了驱动,安装的时候,会报如下错误: [java] Exception: java.lang.ClassNotFoundException [java] Message: Cached loader got a known bad class name:com.mysql.jdbc.Driver [java] ---- stack trace ------
6.设置实体引擎(Entity Engine)的默认数据库为mysql.对 ${Ofbiz_Home}/framework/entity/config/entityengine.xml配置文件进行修改:i.默认的数据库为derby,所以要把localderby改成MySql [mw_shl_code=java,true] <!-- be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "ant load-demo" 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"/>
<group-map group-name="org.ofbiz.tenant" datasource-name="localmysql"/>
</delegator>[/mw_shl_code] [mw_shl_code=java,true] <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="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>[/mw_shl_code] 【遇到问题欢迎在此帖回复询问】
【本文章bbs.tiebazs.com原创 转载请注明来源】
上一篇:2016年9月10日签到记录贴 下一篇:2016年9月11日签到记录贴 |