windows 下opentaps-1.5M2 安装(转自windows下 opentaps1.4安装,有修改)

 

一、opentaps简介

opentaps是一个基于ofbiz基础开发的完全开源的企业级应用系统。它包括了完整的ERPCRM解决方案和内建的企业智能工具。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&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-cdopentaps根目录

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,拥有所有权限。

 

 

【问题一览】

·问题15步中可能会出现,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

·问题25步中出现“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>

 

·问题35步中可能还会再次出现内存不足的问题,这个时候可以将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。

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值