转载

tomcat源码学习---SVN安装和下载tomcat源码

一、安装Subclipse
安装Subclipse的最好方法是使用Eclipse Update Manager。在Eclipse 3.1中,它位于Help -> Software Updates -> Find and Install...菜单下。
选择搜索要安装的新功能部件,点击新建远程站点,弹出图1,在URl输入框输入http://subclipse.tigris.org/update作为URL添加New Remote Site。(地址有可能变动,请以最新的为准),等待安装,安装完毕后重启eclipse就可以用插件了。

二.下载tomcat源码
打开SVN管理器,点击右键 新建资源库位置  在弹出的URL框填入http://svn.apache.org/repos/asf/tomcat/tc6.0.x/tags/TOMCAT_6_0_0地址,点击OK开始下载tomcat源码;

Tomcat的目录结构,把脚本文件放在bin目录,将xmlproperties配置文件放在conf目录中,把Java源码文件放在java或者src目录中,资源文件比如说图片文件,ini文件及其它的一些静态资源文件可以放在res目录,测试源代码可以放在test目录中。
然后运行小蚂蚁(ant),编译后 加入 ant.jar   eclipse插件包  运行  argruments start    VM argruments 
为-Dcatalina_home="D:\eclipse\workspace\cvs\tomcat6\output\build"
日志信息为:  但是还有监听器错误  一下解决不了
TomcatStarter: main()
Try  org.apache.tomcat.startup.Main
Try  org.apache.catalina.startup.BootstrapService
Try  org.apache.catalina.startup.Bootstrap
Starting org.apache.catalina.startup.Bootstrap
2009-8-11 17:28:39 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: E:\myeclipse\jre\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.6.0\bin;D:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\Program Files\Samsung\Samsung PC Studio 3\;C:\Program Files\Common Files\Thunder Network\KanKan\Codecs;C:\WINDOWS\system32;E:\apache-ant-1.7.1;C:\Program Files\StormII\Codec;C:\Program Files\StormII;E:\软件安装地\SSH客户端;C:\Program Files\CVSNT\;E:\apache-ant-1.7.1\bin;C:\Program Files\MySQL\MySQL Server 5.0\bin
2009-8-11 17:28:39 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2009-8-11 17:28:39 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 703 ms
2009-8-11 17:28:40 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2009-8-11 17:28:40 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/@VERSION@
2009-8-11 17:28:40 org.apache.catalina.core.StandardHost start
信息: XML validation disabled
2009-8-11 17:28:40 org.apache.catalina.core.StandardContext listenerStart
严重: Error configuring application listener of class listeners.ContextListener
java.lang.ClassNotFoundException: listeners.ContextListener
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1354)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1200)
 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3769)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4335)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:919)
 at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:882)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1137)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
 at org.apache.catalina.core.StandardService.start(StandardService.java:450)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.jk.apr.TomcatStarter.run(TomcatStarter.java:81)
 at java.lang.Thread.run(Unknown Source)
2009-8-11 17:28:40 org.apache.catalina.core.StandardContext listenerStart
严重: Error configuring application listener of class listeners.SessionListener
java.lang.ClassNotFoundException: listeners.SessionListener
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1354)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1200)
 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3769)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4335)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:919)
 at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:882)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1137)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
 at org.apache.catalina.core.StandardService.start(StandardService.java:450)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.jk.apr.TomcatStarter.run(TomcatStarter.java:81)
 at java.lang.Thread.run(Unknown Source)
2009-8-11 17:28:40 org.apache.catalina.core.StandardContext listenerStart
严重: Skipped installing application listeners due to previous error(s)
2009-8-11 17:28:40 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2009-8-11 17:28:40 org.apache.catalina.core.StandardContext start
严重: Context [/examples] startup failed due to previous errors
2009-8-11 17:28:40 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2009-8-11 17:28:41 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2009-8-11 17:28:41 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/32  config=null
2009-8-11 17:28:41 org.apache.catalina.startup.Catalina start
信息: Server startup in 1250 ms  

正文到此结束
Loading...