一、opentaps简介
opentaps是一个基于ofbiz基础开发的完全开源的企业级应用系统。它包括了完整的ERP和CRM解决方案和内建的企业智能工具。optentaps目前最新版本为1.5M2,其安装与1.4版本基本一致。
二、opentaps安装准备
1、安装JDK 1.5或以上版本,并在系统中设置好JAVA_HOME及相关PATH
2、安装MYSQL 5.0或以上版本
3、下载opentaps 最新版本
三、开始安装
0、java环境变量的设置。
依次点击:“我的电脑”-(右键)“属性”-“高级”-“环境变量”,弹出Windows的“环境变量”配置卡。
在“系统变量”栏下执行三项操作:
①新建“Java_Home”,设置其值为 JDK所在的绝对路径(例如 D:/Program Files/Java/jdk1.5.0_04)。
②新建“Classpath”(如果已有,则直接编辑),设置其值为 .;%Java_Home%/lib (若值中原来有内容,用分号与之隔开)。
注意路径前的符号为.;不能漏掉
③新建“Path”(如果已有,则直接编辑),值: %Java_Home%/bin; (若值中原来有内容,用分号与之隔开)。
参考http://topic.csdn.net/u/20090323/22/ecde92f8-0a8c-4aee-bcb3-8d7f667a74f4.html
1、通过mysql命令行来创建opentaps所需数据库,为了方便识别,我们这里就用ofbiz来做数据库吧。
mysql> create database ofbiz;
2、将下载的opentaps解压至你电脑的任意合法目录(没有特殊字符)。
3、编辑opentaps目录中的framework/entity/config/entityengine.xml文件,使其能正确连接到你的mysql数据库中。
3.1 将其中的<delegator name="default"...> 段中的"datasource-name"从原来的"local" 改为"localmysql"
3.2 编辑<datasource name="localmysql"...> 段内容,修改"jdbc-uri"为"jdbc:mysql://127.0.0.1/opentaps?autoReconnect=true";修改"jdbc-username"/ "jdbc-password"为你的mysql连接用户名/密码,修改character- set="utf8",collate=" utf8_general_ci",示例如下:
<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"/>
</delegator>
<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="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&useOldAliasMetadataBehavior=true"
jdbc-username="root"
jdbc-password="root"
isolation-level="ReadCommitted"
pool-minsize="2"
pool-maxsize="250"/>
<!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> -->
</datasource>
4、进行系统初始化
开始-cmd-cd到opentaps根目录
ant run-install
系统开始安装,这个时候是编译+系统安装,原文的作者说大约用了6分多钟(有点怀疑,自己安装用了21 minutes 56 seconds),直到系统提示安装完成。 这个过程很重要,也会出现很多问题,见最后的【问题一览】。
5、启动opentaps
双击运行opentaps目录下的startofbiz.bat命令即可,请注意控制台输入默认输出至log下的ofbiz.log中,所以无法从控制台中判断系统是否启动完成,一般需等待两到五分钟。也可以将输出改回至console。
6、访问opentaps
打开浏览器访问:http://localhost:8080/opentaps
点击你希望访问的功能特性,系统默认帐号为
admin/ofbiz,拥有所有权限。
【问题一览】
·问题1:第5步中可能会出现,OutOfMemory异常,可以修改一下ant.bat
"%JAVA_HOME%//bin//java" -Xms256M -Xmx512M -XX:MaxPermSize=512m -XX:PermSize=256m -jar hot-deploy/opentaps-common/lib/ant/ant-launcher.jar %1 %2 %3 %4 %5 %6
·问题2:第5步中出现“Unable to rename old file”错误,这个错误是64位系统引起的,官方已经给出了解决方法。详见下面链接:
http://www.opentaps.org/docs/index.php/General_Installation_of_Opentaps#Build_Aspect_class_Errors
就是用下面这段代码替换build-aspects.xml中的Weave advice into target jars那段代码(注意不是替换xml中全部内容)
·问题3:第5步中可能还会再次出现内存不足的问题,这个时候可以将build.xml中的memory设置小一点:
<project name="OFBiz Main Build" default="build" basedir=".">
<property name="site.dir" value="../site"/>
<property name="memory.initial.param" value="-Xms256M"/>
<property name="memory.max.param" value="-Xmx512M"/>
<property name="permmemory.max.param" value="-XX:MaxPermSize=512m"/>
上面的解决方法对于1.5M2好像不行,在1.5M2版本中,找不到上面三行设置,即使自己增加上去也还是报错。打开build.xml文件发现比1.4版本多了下面一行
<property file="build.properties" />
因而打开build.properties文件发现memory.initial.param等在该文件中有定义,因而只要修改build.properties文件的相关内容即可,如下所示:
memory.initial.param = -Xms256M
memory.max.param = -Xmx512M
permmemory.max.param = -XX:MaxPermSize=256M
memory.maxpermsize.param = -XX:MaxPermSize=256M
javadoc.maxmemory = 512M
pos.memory.max.param = -Xmx256M。