atleap安裝篇

安裝過程:
我使用的是版本爲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,在此謝過。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章