48_test Analysis of an advanced problem of the Class Loader, 48 Loading
This is an experiment, source code link: http://pan.baidu.com/s/1c0ix9UK password: ssvd
1. Let tomcat load MyServlet
Http: // localhost: 8080/itcastweb/servlet/MyServlet
2. Let jvm load MyServlet
Export MyServlet. class to D: \ Program Files \ Java \ jdk1.8.0 \ jre \ lib \ ext \ itcast_web.jar,
ThenExtClassLoaderThe MyServlet. class is loaded,
AndThe classes related to MyServlet must also be loaded by ExtClassLoader.,
And D: \ Program Files \ Java \ jdk1.8.0 \ jre \ lib \ ext path, there is no servlet-api.jar,
If the father BootStrap cannot find and the son ExtClassLoader cannot find HttpSerlvet, an error is thrown.
Http: // localhost: 8080/itcastweb/servlet/MyServlet
Set tomcat_home \Lib \ servlet-api.jarCopy to D: \ Program Files \ Java \Jdk1.8.0 \ jre \ lib \ extMedium,
To let the JVM ExtClassLoader load MySerlvet and related HttpServlet classes.
Access again: http: // localhost: 8080/itcastweb/servlet/MyServlet