Ofbiz12.04環境搭建

1.默認安裝 JDK1.6,並設置環境變量 在「個人電腦」上點右鍵—>「屬性」—>「高級」—> 「環境變量(N)」。 新建系統變量JAVA_HOME:C:\Program Files\Java\jdk1.6.0_10 在系統變量Path的值的前面加入如下內容:%JAVA_HOME%\bin;java

2.安裝mysql數據庫 因爲windows的mysql依賴.net framework 4.0,故先安裝它,再安裝mysql 創建一個數據庫ofbiz。新建一個用戶ofbiz和密碼ofbiz,而且賦予ofbiz所有權限。 都設置ofbiz,是爲了偷懶,就搞成跟ofbiz裏面的配置同樣,若是有其餘需求,自行 設置,只要與ofbiz數據庫訪問配置同樣就行。mysql

3.下載apache-ofbiz-12.04.zip
http://mirror.esocc.com/apache/ofbiz/apache-ofbiz-12.04.02.zipsql

4.集成開發工具eclipse(java環境要加進來) 解壓ofbiz12.0.4到eclipse工做目錄下,打開eclipse載入ofbiz12.04 5.更新JDBC驅動,將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改爲MySqlapache

<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"/> <group-map group-name="org.ofbiz.olap" datasource-name="localmysql"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localmysql"/> </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="localmysql"/> <group-map group-name="org.ofbiz.olap" datasource-name="localmysql"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localmysql"/> </delegator> windows

<!-- 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=" localmysql "/> 
    <group-map group-name="org.ofbiz.olap" datasource-name=" localmysql "/> 
    <group-map group-name="org.ofbiz.tenant" datasource-name=" localmysql "/>

</delegator> 瀏覽器

ii. 修改實體引擎的默認數據庫的配置信息eclipse

<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" engine="InnoDB" <!-- 如今mysql通常的引擎都是InnoDB,早在4.0時代就不推薦使用type,如今改爲engine ,--> 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" 
            jdbc-username="ofbiz"<!-- 這裏都是數據庫的基本配置信息,改爲本身對應的--> 
            jdbc-password="ofbiz" 
            isolation-level="ReadCommitted" 
            pool-minsize="2" 
            pool-maxsize="250" 鏈接池不必搞這麼多,50夠了 
            time-between-eviction-runs-millis="600000"/>        
</datasource>

7.運行(CTRL+R) 輸入cmd進入命令模式,cd到你eclipse的工做目錄workspace下項目ofbiz12.0.4的根目錄(如:D:\workspace\ofbiz), 輸入ant命令,等他buildsuccess以後,在運行ant load-demo(11.04版是運行ant run-install) 安裝OFBIZ演示數據:ant load-demo 啓動OFBIZ:ant start 命令行窗口不要關,在瀏覽器輸入 http://localhost:8080/ecommerce開發工具

相關文章
相關標籤/搜索