天天看點

基于Ofbiz的ERP Opentaps 1.5 安裝基于Ofbiz的ERP Opentaps 1.5 安裝

基于Ofbiz的ERP Opentaps 1.5 安裝

第一步:mysql配置

進入%MYSQL_HOME%\bin目錄,打開指令行并輸入:mysql -u root -h localhost –p,提示輸入root密碼;

輸入密碼按回車;

用create database opentaps指令建立opentaps資料庫 ;

用create user opentaps;指令建立名為opentaps的使用者名;

用grant all privileges on opentaps.* to 'opentaps'@'localhost' identified by 'opentaps-password' with grant option指令建立使用者為opentaps的密碼、權限等資訊 ;

用flush privileges指令重新整理mysql;

用exit指令退出mysql。

第二步:安裝opentaps 

解壓opentaps壓縮檔案包;

打開\opentaps\framework\entity\config\entityengine.xml,

把<delegator name="default"...>段中的datasource-name="localderby"中的"localderby"改為"localmysql",

把<datasource name="localmysql"...>段中的jdbc-uri後的 

jdbc:mysql://127.0.0.1/opentaps?autoReconnect=true&amp;useOldAliasMetadataBehavior=true

改為

jdbc:mysql://localhost:3306/opentaps?autoReconnect=true&amp;useOldAliasMetadataBehavior=true

主要是更改資料庫把資料庫從ofbiz改成opentaps;

把編碼從latin1改成utf8,latin1_general_cs改成utf8_general_ci。

第三步:修改代碼

打開\opentaps\opentaps\opentaps-common\build-aspects.xml檔案,将以下三行注釋掉

 <jar jarfile="${ofbiz.dir}/framework/entity/build/lib/ofbiz-entity.jar" update="true" 

basedir="${build.dir}/classes/" includes="META-INF/aop.xml" />

<jar jarfile="${ofbiz.dir}/framework/common/build/lib/ofbiz-common.jar" update="true" 

basedir="${build.dir}/classes/" includes="META-INF/aop.xml" />

<jar jarfile="${ofbiz.dir}/applications/order/build/lib/ofbiz-order.jar" update="true" 

basedir="${build.dir}/classes/" includes="META-INF/aop.xml" />

打開opentaps\framework\webapp\src\org\ofbiz\webapp\control\ConfigXMLReader.java

将for (String a : url.toString().split(File.separator)) 

改為for (String a : url.toString().split("/")) 

打開opentaps\framework\entity\src\org\ofbiz\entity\jdbc下的DatabaseUtil.java将createTable方法中的

if (UtilValidate.isNotEmpty(this.datasourceInfo.tableType)) {

sqlBuf.append(" TYPE ");

sqlBuf.append(this.datasourceInfo.tableType);

 }

中的TYPE修改為ENGINE

第四步:安裝opantaps

在opentaps目錄下打開指令行,輸入ant run-install,等待即可。

第五步:啟動Opentaps 

執行startofbiz.bat

啟動不成功時,檢視\opentaps\runtime\logs\console.log,

發現下面兩行

Error occurred during initialization of VM

Could not reserve enough space for object heap

則修改startofbiz.bat中

"%JAVA_HOME%\bin\java" -Xms256M -Xmx1024M -XX:MaxPermSize=1024M -jar ofbiz.jar > runtime\logs\console.log

為 "%JAVA_HOME%\bin\java" -Xms256M -Xmx512M -XX:MaxPermSize=512M -jar ofbiz.jar > runtime\logs\console.log

重新執行startofbiz.bat

第六步:通路Opentaps

打開浏覽器,在位址欄輸入 http://localhost:8080/opentaps/

預設管理者使用者名:admin

密碼:opentaps