本文将记录如何在MyEclipse6.5中,导入IBatis的JPetStore5.0源码,并且部署到tomcat6.0中。
下载tomcat6.0:http://dev.xiaonei.com/apache-mirror/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.zip
配置Tomcat6.0中上下文,使用JPetStore目录。
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
enableLookups="false"
connectionTimeout="20000"
redirectPort="8443"
maxThreads="900"
minSpareThreads="150"
maxSpareThreads="450"
disableUploadTimeout="true"
URIEncoding="UTF-8" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8"/>
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="jpetstore" reloadable="true" crossContext="true">
<Resource name="jdbc/jpetstore"
auth="Container"
type="javax.sql.DataSource"
maxActive="10" maxIdle="5" maxWait="100"
username="jpetstore" password="ibatis9977"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1:3306/jpetstore?autoReconnect=true&characterEncoding=GBK"/>
</Context>
</Host>
</Engine>
</Service>
</Server>