windows opentap

测试安装环境

系统:WindowsXp(64位,2G)

数据库:mysql5.5

Jdk:1.6

opentaps版本:1.4.0

IDE:eclipse3.4

-------------------------------

本人整理的相关文档下载:

         http://www.itelib.com/category/srcother/src/267.html

可以参考的博客:http://jiasudu.iteye.com/category/17002

一、opentaps简介

opentaps 1.4 安装

1.下载安装 JDK1.6,并设置环境变量:JAVA_HOME。

2.下载 MySQL数据库:mysql-5.0.15-win32.rar,解压到 E 盘。

3.下载 opentaps:opentaps-1.4-preview-2.zip,解压到 E 盘。

4.设置实体引擎( Entity Engine)的缺省数据库为mysql.在修改 ${ofbiz install dir}/framework/entity/config/entityengine.xml文件中修改配置:

   a.修改数据库连接参数:
<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/opentaps14?
autoReconnect=true"  --数据库名
                jdbc-username="root"  --用户名
                jdbc-password=""   --密码
                isolation-level="ReadCommitted"
                pool-minsize="2"
                pool-maxsize="250"
                time-between-eviction-runs-millis="600000"/><!-- ####-->
        <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> -->
    </datasource>

    b. 修改实体引擎的数据库缺省配置如下:将datasource-name的值设置为 localmysql:
<!-- the connection factory class to use, one is needed for obtaining connections/pools for defined resources -->
    <connection-factory class="org.ofbiz.entity.connection.DBCPConnectionFactory"/>

    <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"/>
    </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"/>
    </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="localmysql"/>
        <group-map group-name="org.ofbiz.olap"
                   datasource-name="localmysql"/>
    </delegator>
  
            <delegator name="other"
               entity-model-reader="main"
               entity-group-reader="main"
               entity-eca-reader="main">
        <group-map group-name="org.ofbiz"
                  datasource-name="localmysql"/>
    </delegator>

5.修改 build.xml 文件中关于JVM启动参数的配置,将内存配置按照你电脑的实际能力进行修改,如:
<project name="OFBiz Main Build" default="build" basedir=".">
    <property name="site.dir" value="../site"/>
    <property name="memory.initial.param" value="-Xms128M"/>
    <property name="memory.max.param" value="-Xmx256M"/>
    <property name="permmemory.max.param" value="-XX:MaxPermSize=256m"/>

6.修改 startofbiz.bat文件中关于JVM启动参数的配置,将内存配置按照你电脑的实际能力进行修改,如:
"%JAVA_HOME%\bin\java" -Xms128M -Xmx512M -XX:MaxPermSize=256M -jar ofbiz.jar > runtime\logs\console.log


7.打开dos并在 opentaps-1.4-preview-2 目录下执行命令(时间较长):
ant run-install
startofbiz.bat

8.启动成功,可以打开以下界面:
http://localhost:8080/ecommerce
https://localhost:8443/webtools

至此,opentaps 1.4 安装成功。

opentaps是一个基于ofbiz基础开发的完全开源的企业级应用系统。它包括了完整的ERP和CRM解决方案和内建的企业智能工具。

 

opentaps现在在国内应用面不象sugarcrm/vtigercrm这些企业应用那样普遍,我想很大程度是由于JavaEE应用的逻辑结构严谨与复杂度决定其不象PHP应用那样容易拆分按需阅读切入。了解一个JavaEE的应用需要先了解其构造的框图、分层结构、每层实现的技术方式以及采用的技术。对于OFBiz这样一个野心极大要囊括几乎所有企业应用层面的项目,想要掌握它就更难上加难了,也许我们可以选择简单开始,先从文档的中文化与由简入繁的练习中开始了解这个庞大的开源项目。

 

二、opentaps安装准备

1、安装JDK 1.5或以上版本,并在系统中设置好JAVA_HOME及相关PATH

2、安装MYSQL 5.0或以上版本

3、下载opentaps 最新版本

              http://sourceforge.net/projects/opentaps/files/

 

三、开始安装

1、通过mysql命令行来创建opentaps所需数据库,为了方便识别,我们这里就用ofbiz来做数据库吧。

mysql> create database ofbiz;

推荐一个2个mysql的客户端图形工具:Navicat、Toad for mysql 都比较好用

 

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&amp;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分多钟,直到系统提示安装完成。 这个过程很重要,也会出现很多问题,见最后的【问题一览】

 

 

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中全部内容)

<!-- ================================================================== --><!-- Weave advice into target jars --><!-- ================================================================== --><target name="weave" depends="detect-dependencies" if="processRequired"><echo message="[build] =========== Start Building Aspect (Weave) ============="/><java classname="org.codehaus.aspectwerkz.compiler.AspectWerkzC" fork="true"><jvmarg value="-Daspectwerkz.definition.file=${aopConfig}"/><jvmarg value="-Daspectwerkz.transform.filter=no"/><!-- <jvmarg value="-Daspectwerkz.transform.verbose=true"/> --><!-- <jvmarg value="-Daspectwerkz.transform.details=true"/> --><arg value="-verify"/><classpath refid="local.class.path" /><classpath><pathelement path="${build.dir}/classes/common"/></classpath><!-- below is the jars to post-process --><arg value="${ofbiz.dir}/framework/entity/build/lib/ofbiz-entity.jar"/></java><java classname="org.codehaus.aspectwerkz.compiler.AspectWerkzC" fork="true"><jvmarg value="-Daspectwerkz.definition.file=${aopConfig}"/><jvmarg value="-Daspectwerkz.transform.filter=no"/><!-- <jvmarg value="-Daspectwerkz.transform.verbose=true"/> --><!-- <jvmarg value="-Daspectwerkz.transform.details=true"/> --><arg value="-verify"/><classpath refid="local.class.path" /><classpath><pathelement path="${build.dir}/classes/common"/></classpath><!-- below is the jars to post-process, if these jar not effect each other you can put them in same pos, else please seperate them into another task --><arg value="${ofbiz.dir}/framework/common/build/lib/ofbiz-common.jar"/></java><java classname="org.codehaus.aspectwerkz.compiler.AspectWerkzC" fork="true"><jvmarg value="-Daspectwerkz.definition.file=${aopConfig}"/><jvmarg value="-Daspectwerkz.transform.filter=no"/><!-- <jvmarg value="-Daspectwerkz.transform.verbose=true"/> --><!-- <jvmarg value="-Daspectwerkz.transform.details=true"/> --><arg value="-verify"/><classpath refid="local.class.path" /><classpath><pathelement path="${build.dir}/classes/common"/></classpath><!-- below is the jars to post-process --><arg value="${ofbiz.dir}/applications/order/build/lib/ofbiz-order.jar"/></java><jar jarfile="${lib.dir}/${name}.jar" update="true" basedir="${build.dir}/classes/common" includes="org/opentaps/aspect/secas/**" /><!-- put aop.xml into target jar META-INF dir --><mkdir dir="${build.dir}/classes/META-INF" /><copy file="${aopConfig}" tofile="${build.dir}/classes/META-INF/aop.xml" overwrite="true"/><!-- create new jar with aop.xml, then copy it to orign location, using these for avoid unable rename error on windows 64bit system--><zip destfile="${lib.dir}/ofbiz-entity.jar"><zipfileset src="${ofbiz.dir}/framework/entity/build/lib/ofbiz-entity.jar"/><fileset dir="${build.dir}/classes/"><include name="META-INF/aop.xml"/></fileset></zip><delete file="${ofbiz.dir}/framework/entity/build/lib/ofbiz-entity.jar" failοnerrοr="false"/><move file="${lib.dir}/ofbiz-entity.jar" tofile="${ofbiz.dir}/framework/entity/build/lib/ofbiz-entity.jar"/><zip destfile="${lib.dir}/ofbiz-common.jar"><zipfileset src="${ofbiz.dir}/framework/common/build/lib/ofbiz-common.jar"/><fileset dir="${build.dir}/classes/"><include name="META-INF/aop.xml"/></fileset></zip><delete file="${ofbiz.dir}/framework/common/build/lib/ofbiz-common.jar" failοnerrοr="false"/><move file="${lib.dir}/ofbiz-common.jar" tofile="${ofbiz.dir}/framework/common/build/lib/ofbiz-common.jar"/><zip destfile="${lib.dir}/ofbiz-order.jar"><zipfileset src="${ofbiz.dir}/applications/order/build/lib/ofbiz-order.jar"/><fileset dir="${build.dir}/classes/"><include name="META-INF/aop.xml"/></fileset></zip><delete file="${ofbiz.dir}/applications/order/build/lib/ofbiz-order.jar" failοnerrοr="false"/><move file="${lib.dir}/ofbiz-order.jar" tofile="${ofbiz.dir}/applications/order/build/lib/ofbiz-order.jar"/><echo message="[build] =========== Done Building Aspect (Weave) =============="/></target>
 

·问题3:第5步中可能还会再次出现内存不足的问题,这个时候可以将build.xml中的memory设置小一点:

<project name="OFBiz Main Build" default="build" basedir=".">

    <propertyname="site.dir"value="../site"/>

    <propertyname="memory.initial.param"value="-Xms256M"/>

    <propertyname="memory.max.param"value="-Xmx512M"/>

    <propertyname="permmemory.max.param"value="-XX:MaxPermSize=512m"/>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
win7 安装Opentaps 1.5 以下是在安装前的一些文件修改和操作 1)修改framework\entity\config\entityengine.xml 文件 a)把<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"/>(53、54行)的localderby修改为localmysql b)把<datasource name="localmysql" 段(314行)做以下修改: table_tye="InnoDB" 修改为 Engine="InnoDB" character-set="lantin1" 修改为 character-set="utf8" collate="lantin1_general_cs" 修改为 collate="utf8_general_ci" jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true&useOldAliasMetadataBehavior=true" 中的ofbiz修改为opentaps //opentaps为创建的数据库名字 jdbc-username="ofbiz" 和 jdbc-password="ofbiz" 中的ofbiz修改为mysql上创建了的用户名和密码 c)修改build.properties文件,把里面的内存值减小一半(如果内存是4G以上就不用修改了) d)把 \framework\webapp\src\org\ofbiz\webapp\controlfor\ConfigXMLReader.java文件中的 81行 for (String a : url.toString().split(File.seperator)) { 中File.seperator修改为 "/"   e)打开\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" /> f) 如果Mysql 版本太低,会导致表无法创建, 解决方法如下   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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

福海鑫森

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值