NutzCN Logo
问答 $(base)在IDE上部署到本地tomcat可以正常运行,Maven远程部署war后就运行时错误,是${base}设置的问题吗?
发布于 2793天前 作者 qq_56734821 1775 次浏览 复制 上一个帖子 下一个帖子
标签:

$(base)在IDE上部署到本地tomcat可以正常运行,Maven远程部署war后就运行时错误,是${base}设置的问题吗?

IDEA 运行上部署local server

Tomcat 信息

上面配置运行一切正常

Maven远程部署,即war方式

远程部署

部署完成后如下:
成功部署
上面的部署运行的时候能正常启动服务器,但是访问网页的时候就报运行时错误。

各路大神,求解答!

完整错误信息

HTTP Status 500 - org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/mana/_common_.jsp at line 8

type Exception report

message org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/mana/_common_.jsp at line 8

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.lang.RuntimeException: org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/mana/_common_.jsp at line 8

5: <%@ taglib prefix="fck" uri="http://java.fckeditor.net"%>
6: <%@ taglib prefix="p2p" uri="/viewAPI" %>
7: 
8: <c:set var="resPath" value="${base}/static/mana/"/>


Stacktrace:
	org.nutz.lang.Lang.wrapThrow(Lang.java:148)
	org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:48)
	org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:64)
	org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	org.nutz.mvc.NutFilter.doFilter(NutFilter.java:182)

root cause

org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/mana/_common_.jsp at line 8

5: <%@ taglib prefix="fck" uri="http://java.fckeditor.net"%>
6: <%@ taglib prefix="p2p" uri="/viewAPI" %>
7: 
8: <c:set var="resPath" value="${base}/static/mana/"/>


Stacktrace:
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:580)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.nutz.mvc.view.ForwardView.render(ForwardView.java:70)
	org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:40)
	org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:30)
	org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:45)
	org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:64)
	org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	org.nutz.mvc.NutFilter.doFilter(NutFilter.java:182)

root cause

java.lang.ClassCastException: org.apache.jasper.runtime.ELContextImpl cannot be cast to org.apache.jasper.el.ELContextImpl
	org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:946)
	org.apache.jsp.WEB_002dINF.mana.login_jsp._jspx_meth_c_005fset_005f0(login_jsp.java:255)
	org.apache.jsp.WEB_002dINF.mana.login_jsp._jspService(login_jsp.java:115)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.nutz.mvc.view.ForwardView.render(ForwardView.java:70)
	org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:40)
	org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:30)
	org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:45)
	org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:64)
	org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	org.nutz.mvc.NutFilter.doFilter(NutFilter.java:182)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.73 logs.
5 回复
java.lang.ClassCastException: org.apache.jasper.runtime.ELContextImpl cannot be cast to org.apache.jasper.el.ELContextImpl

war里面有jsp-api/el的jar, 删掉.

@wendal 原来少了provided

<dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>

还有一个方法,就是修改 Tomcat7/conf/context.xml,在下添加一行,如下:

<Context>
    <Loader delegate="true" />

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
添加回复
请先登陆
回到顶部