当前位置: 首页 > 工具软件 > AtLeap > 使用案例 >

atleap安装篇

柯冯浩
2023-12-01

安装过程:
我使用的是版本为atleap-1.0,建议大家严格按照该项目附带的《AtLeap-AdminGuide-1.0.pdf》和《AtLeap-DeveloperGuide-1.0.pdf》的要求进行安装。

我使用的工具为:tomcat+msql+sun jdk+ant。
1.工具要求(指导书要求):
Sun J2SE SDK 1.4.2, 1.5.0, 6.0
Apache Ant 1.6.2, 1.6.3, 1.6.5
Tomcat 5.5以上
MySQL 3.23, 4.0, 4.1, 5.0
步骤如下:
一、找到所需的工具包
而在实际当中,我使用的工具版本详细如下:
操作系统:windows xp
jre:Sun J2SE SDK 1.5.0.08
ant:Apache Ant  1.6.5
tomcat:apache-tomcat-5.5.17
mysql:mysql-5.0.18-win32
二、设置环境变量
ANT_HOME=D:/Java/apache-ant-1.6.5
JAVA_HOME=D:/Java/jdk1.5.0_08
MYSQL_HOME=C:/Program Files/MySQL/MySQL Server 5.0
CATALINA_HOME=G:/Web_Server/Tomcat 5.5
CATALINA_OPTS= -XX:MaxPermSize=256m -Xms256M -Xmx1024M
以上环境变量在 我的电脑->属性->告警->环境变量 中进行设置。
三.atleap/build.properties:
mysql部分
database.jar=${mysql.jar}
database.jar.name=${mysql.jar.name}
database.dir=${mysql.dir}
database.type=mysql
database.name=${webapp.name}_db
database.host=localhost
database.port=3306
database.driver_class=com.mysql.jdbc.Driver
database.url=jdbc:${database.type}://${database.host}:${database.port}/${database.name}?characterEncoding=utf-8&useUnicode=true&autoReconnect=true
database.username=test
database.password=test
database.test.tablename=SELECT 1
database.pool.datasource.class=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
database.pool.size.max=20
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
dbunit.datatype.factory=org.dbunit.ext.mysql.MySqlDataTypeFactory
dbunit.escapepattern=`?`
database.admin.url=jdbc:${database.type}://${database.host}:${database.port}/mysql
database.admin.username=root
database.admin.password=11
tomcat:
appserver.host=127.0.0.1

将Jetty Properties中的相关属性用#注释掉
将Tomcat Properties中的相关属性的注释弄去,变成:
# Please specify tomcat5 or tomcat5.5
appserver.type=tomcat5.5
appserver.http.port=8080
appserver.https.port=8443

# You need below properties only if you plan to deploy application when AS is started
# and deploy.force.unpack=false (default)
# Be sure that in $CATALINA_HOME/conf/tomcat-users.xml file there is user which has the manager role.
# <role rolename="manager"/>
# <user username="manager" password="manager" roles="manager"/>
tomcat.manager.host=${appserver.host}
tomcat.manager.port=${appserver.http.port}
tomcat.manager.url=http://${tomcat.manager.host}:${tomcat.manager.port}/manager
tomcat.manager.username=manager
tomcat.manager.password=manager

# Set into true if you want Ant always unpack your app during deployment
# Usually forcing is required when you deploy app in ROOT context
#deploy.force.unpack=true

# Usually you do not need to specify below properties
tomcat.home=C:/Tomcat 5.5
tomcat.app.base=${tomcat.home}/webapps
tomcat.service.name=Catalina
tomcat.work.dir=${tomcat.home}/work/${tomcat.service.name}/${appserver.host}/${context.doc.base}
tomcat.conf.dir=${tomcat.home}/conf/${tomcat.service.name}/${appserver.host}

四、建立数据库
进入mysql,建立数据库atleap_db,可能该步骤不是必须的。

五、ant生成
进入atleap 主目录执行:ant setup。

问题集合:
1、必须指出,进行文字内容编辑功能(所见即所得)必须在IE6.0中才能使用,IE5.0不支持。
配置参数为:atleap 1.0 + tomcat 5.5 + mysql-5.0.18-win32。
2、在ant setup时出现如下错误,简直莫名其妙:
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'simple_value' at row 1
查找了所有atleap相关资料后,始终没有找到解决该问题的办法,后来直接把该 错误信息 google/baidu一下才发现原来是数据库的编码不符合要求。
《AtLeap-AdminGuide-1.0.pdf》 中明确写了:
For MySQL 4.1 and above you should run mysql daemon with parameter -
-default-character-set=utf8。
3、启动tomcat过程中出现错误:
xdoclet.template.TemplateEngine invokeMethod 严重: Invoking method failed: xdoclet.tagshandler.ClassTagsHandler.forAllClasses, line=36 of template file: jar:file:/D:/workspace/atleap/lib/xdoclet-1.2.3/xdoclet-web-module-1.2.3.jar!/xdoclet/modules/web/resources/web_xml.xdt
 解决方法:build.properties 中设置deploy.force.unpack=true,并重新启动tomcat,依据如下
在《AtLeap-AdminGuide-1.0.pdf》中描写:
Tomcat has a bug with deployment of big WAR (Web archive) and AtLeap is big WAR. If you get one of the
following errors during AtLeap deployment:
1. Missing application web.xml
2. cannot create JDBC driver of class ' ' for connect URL 'null'
3. Error deploying application at context path null
4. or something like
do the following:
1. Stop tomcat
2. Specify deploy.force.unpack=true property in your build.properties file
3. Execute bin/build refresh
4. Start tomcat
Please, carefully read the documentation and release notes of your servlet container to avoid extra problems.
For example, Tomcat under Linux recommends to define LD_ASSUME_KERNEL environment variable equal to the
kernel version (e.g. 2.4.1).
4、在解决了问题3之后发现重新启动tomcat又报错,错误如下:

严重: Error reading tld listeners java.lang.NullPointerException
java.lang.NullPointerException
 at org.apache.log4j.Category.isEnabledFor(Category.java:749)
 at org.apache.commons.logging.impl.Log4JLogger.isTraceEnabled(Log4JLogger.java:333)

通过baidu和google找到答案如下:
问题在于atleap自带的commons-logging版本过高,替换commons-logging-1.1.1.jar为commons-logging-1.0.4.jar即可。
方法:找到atleap/lib/commons,替换commons-logging-1.1.1.jar为commons-logging-1.0.4.jar,并修改文件
atleap/lib/commons/lib.properties的属性:
commons-logging.jar=${commons.dir}/commons-logging-1.1.1.jar
替换为:
commons-logging.jar=${commons.dir}/commons-logging-1.0.4.jar。

 

本文参考了http://blog.csdn.net/chinayuan/archive/2006/01/04/569672.aspx,在此谢过。

 类似资料: