tomcat部署

时间:2023-03-10 01:24:16
tomcat部署

  因为之前一直用的JBoss服务器,今天测试了一下想换成tomcat,然后就考了一个现成的tomcat,然后将jboss下的项目复制了一个到tomcat下,然后改了一下文件名,结果启动时报错

java.lang.SecurityException: Servlet of class org.apache.catalina.servlets.InvokerServlet is privileged and cannot be loaded by this web application

  从网上找了一下,发现了一个解决方法

修改conf/context.xml文件,新加两个属性,开启Servelt调用器即可。
<Context reloadable=”true” privileged=”true”>
<!– Default set of monitored resources –>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>

  项目正常启动,但一访问就报错了

type Exception report
message javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
description The server encountered an internal error that prevented it from fulfilling this request.
exception

  然后查找资料发现项目中多了jar包 javax.servlet.jar 和 javax.servlet.jsp.jar ,将相关jar删除就好了。