posts - 6, comments - 6, trackbacks - 0, articles - 0

AtLeap中运用Mysql

Posted on 2007-03-29 19:46 吴涛涛 阅读(533) 评论(0)  编辑  收藏
1、环境说明:
WINDOWS2003、JDK 1.5.0_11、ANT 1.6.5、Tomcat 5.0.27、MySQL4.1.10a;
先设置好环境变量;

2、数据库设置
#database.jar=${mysql.jar}
#database.jar.name=${mysql.jar.name}
#database.dir=${mysql.dir}
#database.version=${mysql.version}
#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
#hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect


改为:
database.jar=${mysql.jar}
database.jar.name=${mysql.jar.name}
database.dir=${mysql.dir}
database.version=${mysql.version}
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=数据库用户名
database.password=数据库密码
hibernate.dialect=org.hibernate.dialect.MySQLDialect

在数据库初始化的过程中,提示${hibernate.transaction.factory_class},我就在properties.xml中将
<entry key="hibernate.transaction.factory_class" value="${hibernate.transaction.factory_class}"/>

改为
<entry key="hibernate.transaction.factory_class" value="org.hibernate.transaction.JDBCTransactionFactory"/>

就可以通过;


3、服务器设置
1)
# Jetty is embeded into AtLeap distribitive
appserver.type=jetty5
appserver.http.port=8080
# in order to enable support HTTPS please reconfigure jettyplus.xml
appserver.https.port=8443
# the memory sizes
jetty.initialmemory=128m
jetty.maxmemory=256m

改为:
# Jetty is embeded into AtLeap distribitive
# appserver.type=jetty5
# appserver.http.port=8080
# in order to enable support HTTPS please reconfigure jettyplus.xml
# appserver.https.port=8443
# the memory sizes
# # jetty.initialmemory=128m
jetty.maxmemory=256m

2)
# Please specify tomcat5 or tomcat5.5
#appserver.type=tomcat5.5
#appserver.http.port=8080
#appserver.https.port=8443

#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

改为:
# Please specify tomcat5 or tomcat5.5
appserver.type=tomcat
appserver.http.port=8080
appserver.https.port=8443

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

4、部署设置
# Usually you do not need to specify below properties
#tomcat.home=C:/TOOLS/java/jakarta-tomcat-5.5.7
#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}

改为:

# Usually you do not need to specify below properties
tomcat.home=c:/tomcat
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}

回到build.xml所在的目录,执行ant deploy;

5、测试运行
http://localhost:8080/atleap

参考文档:Blandware AtLeap 安装说明


只有注册用户登录后才能发表评论。


网站导航: