---
title: "java.lang.SecurityException 解决方案"
author: "yuanyannan"
date: "2011-10-18T15:29:34Z"
tags: []
categories: ["编程语言"]
slug: "java-lang-securityexception"
draft: false
lastmod: "2011-10-18T15:29:34Z"
id: 1199322
url: "https://andyy.iteye.com/blog/1199322"
---

异常：
java.lang.SecurityException: Servlet of class  org.apache.catalina.servlets.InvokerServlet is privileged and cannot be loaded by this web application

解决方案：


在Tomcat中，如果想使用Servlet调用器(org.apache.catalina.servlets.InvokerServlet)，要在conf/web.xml中，把调用器这个servlet的注册和映射开启来。但对于Tomcat 6.X 而言，会出现下面错误：

java.lang.SecurityException: Servlet of class org.apache.catalina.servlets.InvokerServlet is privileged and cannot be loaded by this web application

解决方法：?
修改conf/context.xml文件，新加两个属性.
 <Context? reloadable="true" privileged="true">
  <!-- Default set of monitored resources -->
  <WatchedResource>WEB-INF/web.xml</WatchedResource>
 </Context>