- 浏览: 914628 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (537)
- Java SE (114)
- Struts (18)
- Hibernate (25)
- Spring (3)
- Page_Tech (41)
- Others (87)
- Database (29)
- Server (24)
- OpenSource_Tools (15)
- IDE_Tool (22)
- Algorithm (28)
- Interview (22)
- Test (28)
- Hardware (1)
- Mainframe (25)
- Web application (4)
- Linux (3)
- PHP (17)
- Android (1)
- Perl (6)
- ubuntu (1)
- Java EE (9)
- Web Analysis (5)
- Node.js (2)
- javascript (2)
最新评论
-
一键注册:
request.getRequestURL()和request.getRequestURI() -
SuperCustomer:
...
SED的暂存空间和模式空间 -
juyo_ch:
讲得挺好理解的,学习了
java 死锁及解决 -
chinaalex:
最后一题答案正确,但是分析有误.按照如下过程,上一行为瓶,下一 ...
zz智力题 -
liaowuxukong:
多谢博主啦,弱弱的了解了一点。
C++/Java 实现多态的方法(C++)
-
Installation:
The classes in the zip "devloader.zip" must be extracted into "TOMCAT_HOME/server/classes".
- Requirements:
"DevLoader" works with Tomcat 4.x and Tomcat 5.x
- Use :
Activate and configure DevLoader for a project in project properties->Tomcat->DevLoader classpath
- ClassLoaders
Classloaders are primarly responsible for loading Java class files and for initializing the corresponding java.lang.Class object.
Different Classloader implementations already exist in Java2.
e.g. The systemclassloader is responsible for searching and loading java class files from the jar, zip and directories as defined in the CLASSPATH systemproperty and the RMIClassLoader loads classes through the HTTP protocol.
Classloaders may be nested.
From the JAVA SDK Documentation:The ClassLoader class uses a delegation model to search for classes and resources. Each instance of ClassLoader has an associated parent class loader. When called upon to find a class or resource, a ClassLoader instance will delegate the search for the class or resource to its parent class loader before attempting to find the class or resource itself.
The parent classloader is unable to access any resources (classes) of it's child classloaders.
- Webapplication Classloader
Simplified a Java Webapplication in Tomcat uses two different Classloader instances. The Systemclassloader (SCL) and the Webapplication-Classloader (WCL). The parent classloader of the WCL is the SCL.
Each deployed Webapplication has it's own WCL in Tomat. All WCL share the same (one and only) SCL.
So as defined by the Java SDK Documentation all classes which are loaded by the Systemclassloader are visible to all Webapplications.
Classes which are loaded by one WCL are not visible to other WCLs !
The WCL loads classes from the WEB-INF/classes directory and the from JAR (!) files in the WEB-INF/lib directory only.
As defined in the Java SDK Documentation the WCL should work as following:
Before a WCL loads a class he must ask the parent classloader (SCL) if he already knows the class. If the SCL does not know the class the WCL tries to load it.
This feature makes it possible to deploy two web-applications which use a different version of class A (as long as class A is not loadable through the SCL).
The exception:
The final servlet 2.3 specification defines the exception to the common rule.
From Servlet 2.3 Specification SRV.9.7.2 - WebApplication Classloader:It is recommended also that the application class loader be implemented so that classes and resources packaged within the WAR are loaded in preference to classes and resources residing in container-wide library JARs.
Tomcat supports this recommendation through a property which may be set in the server.xml configuration. Default setting is to act as defined in the Servlet specification.
See also the actual documentation of the Tomcat project. - Web-Projects in Eclipse
- With the TomcatPlugin it's easy to define a new webproject and to launch tomcat within the IDE.
Eclipse makes it very easy to divide a big project into some subprojects. e.g. utility classes which will be used by many projects resist in a project named "utils" and the concrete projects are referencing the "utils" project.
Unfortunatly the classes of the "utils" project are not automatically visible to Tomcat during runtime.
There are two possibilities: - Load the classes of the "utils" project through the Systemclassloader.
This can be done by adding the "utils" project to the Systemclasspath of Tomcat (Window->Preferences->Tomcat).
Why is this a bad idea ?
Typically your webproject class files (including those of the "utils" project) will resist in WEB-INF/classes or WEB-INF/lib of the WAR file for production mode.
So if you add some classes to the systemclassloader for development you will have a different classloading mechanism in production mode - this may lead to strange errors !
Additionaly some code does not work if you load the classes in the systemclassloader.
e.g. if the following class will resist in the "utils" project and you want to use this code to load a property file which resists in your webapplication (WEB-INF/classes) it is unable to load the resource because the systemclassloader is not allowed to access resources of the webappclassloader.public class ResourceLoader { public Properties load(String resourceName) { ClassLoader cl = ResourceLoader.class.getClassLoader(); InputStream in = cl.getResourceAsStream(resourceName); ... } }
- Load the classes of the "utils" project through the Webclassloader.
To load the classes through the Webclassloader the classes of the "utils" project must be put into the WEB-INF/classes or packaged as JAR into WEB-INF/lib directory.
This may be done by hand or through some ANT build scripts - but unfortunatly each time you change code in the "utils" project :(
- The Development-Webapp-Classloader
There's a simple solution for making things easier. It works the following way:
- A special Tomcat Webappclassloader implementation extends the mechanism of loading classes not only from WEB-INF/classes and WEB-INF/lib but also from locations which are specified in a special configuration file.
- Through the TomcatPlugin you specify for each Tomcat project which classes shall be loaded through the Webclassloader - yust point and click.
The TomcatPlugin writes the configuration file and the correct tomcat configuration (into server.xml).
发表评论
-
Apache vs Tomcat
2012-03-22 23:23 894本质区别:1)apache支持静态页面;tomcat支持动态页 ... -
zz Tomcat负载均衡和集群环境的搭建
2012-02-10 14:12 903Tomcat负载均衡和集群环境的搭建: 魏超 2010年3月 ... -
jrebel.jar
2010-10-09 14:44 1452jrebel.jar-noverify -javaagent ... -
web.xml中load-on-startup标签的含义
2010-09-16 10:25 844在servlet的配置当中,<load-on-start ... -
context-param和init-param区别
2010-09-16 10:19 1166web.xml里面可以定义两种参数:(1)applicatio ... -
状态码301和302
2010-08-02 10:38 2670先简要说一下重定向就 ... -
开源的项目tair 简介
2010-07-29 10:02 1571简介¶tair 是淘宝自己开发的一个分布式 key/value ... -
Eclipse中使用Tomcat的两种方式
2010-06-18 16:57 14151、直接配置Tomcat中的Server.xml,加入Cont ... -
Tomcat problem occured||WTP中Publishing failed:Resource /xxxx does not exist问题的解决
2010-06-17 14:28 1491使用WTP开发WEB程序,需要把WEB-INF/lib下的某个 ... -
Tomcat全攻略(TOMCAT详细教程)
2010-03-03 10:03 9375随着java的流行,其在web上的应用也越来越广,tomcat ... -
request.getRequestURL()和request.getRequestURI()
2009-12-25 10:40 8838先申明,我是自己琢磨出来的,不知道对不对!! 但是,我想应该不 ... -
WTP入门教程
2009-12-08 16:31 1580环境配置:Eclipse版本 eclipse-SDK-3.3. ... -
eclipse+wst+tomcat6.0搭建web开发环境
2009-12-08 16:28 2093最近发布的Eclipse3.3及其 ... -
eclipse下实现热部署,tomcat不重新reload context
2009-12-08 16:20 18041. 打开server的编辑器 2. 在modules页签内, ... -
tomcat 和 jboss的热部署(热发布)问题
2009-12-08 16:17 2074所谓的热部署(热发布)(下面称为“热部署”),就是说,在web ... -
tomcat-Context
2009-11-28 11:00 1077<Context>代表了运行在<Host&g ... -
在Eclipse中使用Tomcat插件的遇到的一些问题
2009-11-21 16:18 4243图片: Window-> ... -
Sysdeo Eclipse Tomcat Launcher plugin 中DevLoader的用处
2009-11-21 16:14 1684Sysdeo Eclipse Tomcat Launcher ... -
org.apache.catalina.loader.DevLoader
2009-11-21 16:12 2636java.lang.ClassNotFoundExceptio ... -
tomcat中三种部署项目的方法
2009-10-06 00:47 1259在tomcat中三种部署项目 ...
相关推荐
DevLoader.jar
花了几个小时在国外网站下的Eclipse插件(国外的网站打开很慢),包括13个插件,有的插件下了好几个版本,怕和用的Eclipse不合。。插件有:tomcat3.2/strutsIDE/XMLBuddy/Colorer Take/sqlexplorer/Fat Jar/AdvanQas/...
这个"DevLoader.zip"文件可能包含与Tomcat自定义类加载器相关的资料,特别是名为"DevLoader"的类加载器,这可能是Tomcat为开发者提供的一种特殊加载器。 首先,我们来理解一下类加载器的基本概念。在Java中,类加载...
tomcatPlugin不支持tomcat 8.x?么事,我来搞定,你用就行!
让Eclipse的TomcatPlugin支持Tomcat 8.x,亲测有效。 使用步骤: 1、先在Eclipse Markplace安装TomcatPlugin 2、复制devLoaderTomcat8.jar到tomcat8/lib/目录 3、在eclipse中启动tomcat
HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,UMSS.SYS ; Indicate that the device uses the C/B/I protocol [cbi.addreg.HW] HKR,,DeviceProtocol,0x10001,00 ; Indicate that the device uses the C/B protocol ...
HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,geneuide.sys HKR,,GeneUsbStorTag,,1 HKLM, "Software\Microsoft\Windows\CurrentVersion\RunOnce","USBIDRV",,"%\delentry.exe" [UsbStor.AddReg.Uninstall] HKLM,...
HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,usbser.sys HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" [Reader.NT.Services] AddService = usbser, 0x00000002, Service_Inst [Service_...
它主要的功能亮点在于与Maven工程的集成,能自动计算并处理Maven项目的依赖关系,从而省去了开发者手动在DevLoader中选择jar包的繁琐步骤,极大地提高了开发和调试的效率。 【描述】:“修改自官方最新的3.3.1版本...
HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,BULKUSB.sys HKLM,"System\Currentcontrolset\Services\BulkUsb\Parameters","MaximumTransferSize",0x10001,4096 ``` **1. 版本信息**:`[Version]`段定义了INF文件的...
HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,hvDriver.sys HKR,,PageOutWhenUnopened,3,01 HKR,Settings,VideoFormatLocked,3,09,0,0,0 ; VideoFormatLocked HKLM,"System\CurrentControlSet\Services\HV6000Drv\...
6. **配置DevLoader**:切换到“Devloader classpath”选项卡,并按照需要选择所需的类路径条目,以便为项目提供正确的类路径配置。 #### 四、在Eclipse中为tomcat的server.xml文件添加项目启动代码 最后一步是在...
- 如果你不打算手动构建WAR文件,并且希望Eclipse在每次修改代码后自动部署到Tomcat,可以保持DevLoader classPath的默认设置。 - “Export to WAR settings”关乎是否在部署时将项目打包成WAR文件。如果你选择不...
;Windows 2000/XP WDM Modem Setup File ;... 2004-2006 ;Manufacturer: Motorola Inc [Version] Signature = "$Windows NT$" Class = Modem ClassGUID = {4D36E96D-E325-11CE-BFC1-08002BE10318} ...
;Windows 2000/XP WDM Modem Setup File ;... 2004-2006 ;Manufacturer: Motorola Inc [Version] Signature = "$Windows NT$" Class = Modem ClassGUID = {4D36E96D-E325-11CE-BFC1-08002BE10318} ...
DevloaderTomcat.jar 启动jar包
传统的做法往往需要开发者在`DevLoader`中手动勾选所需的jar包,但使用`TomcatPlugin`后,这一繁琐步骤将被自动化处理。 **TomcatPlugin介绍** `TomcatPlugin`是一款针对Apache Tomcat服务器的Eclipse插件,它极大...