测试环境:
Eclipse for J2EE: 1.2.1
Tomcat: 6.0.32
问题描述:
在eclipse中配置好runtime environment以后,想启动Tomcat调试一个Dynamic Web Project,跳出一个窗口报错内容如下:
‘Starting Tomcat v6.0 Server at localhost ‘ has encountered a problem.
窗口详细错误信息为:Server Tomcat v6.0 Server at localhost failed to start.
Console窗口错误信息如下:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
。。。。。。。。。。
Caused by: java.lang.SecurityException: Servlet of class org.apache.catalina.servlets.InvokerServlet is privileged and cannot be loaded by this web application
。。。。。。。。。。
解决办法:
1. 修改conf/context.xml文件,新加两个属性.
<Context reloadable="true" privileged="true">
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
2. 重启Eclipse,此步非常重要,一定要做