日期:2014-05-17  浏览次数:20650 次

有关tomcat HTTP Status 500的疑问,麻烦大家进来看看
初学java web就遇到了这个问题,我的jsp文件代码如下:
<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<%@ page import="java.util.*,org.jbpm.api.*,org.jbpm.api.task.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<a href="index.jsp?action=deploy">deploy</a>
<%
ProcessEngine processEngine = Configuration.getProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
String action = request.getParameter("action");
if("deploy".equals(action))
{
repositoryService.createDeployment().addResourceFromClasspath("leave.jpdl.xml").deploy();
}
List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().list();
for(ProcessDefinition pd : list){
%>
<%=pd.getId()%>, <%=pd.getName()%>, <%=pd.getVersion()%><br>
<%
}
%>
</body>
</html>

错误提示:
HTTP Status 500 - 

--------------------------------------------

type Exception report

message 

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

exception 

org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:606)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause 

java.lang.ClassCastException: de.odysseus.el.ExpressionFactoryImpl cannot be cast to javax.el.ExpressionFactory
javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:180)
javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:107)
org.apache.jasper.compiler.PageInfo.<init>(PageInfo.java:78)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:109)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:360)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


note The full stack trace of the root cause is available in the Apache Tomcat/7.0.0 logs.


--------------------------------------------

Apache Tomcat/7.0.0

经过检测之后我发现jsp文件代码应该没错(我是照着书上打的),那错误应该发生在哪里?麻烦各位大侠了,谢谢!

------解决方案--------------------
de.odysseus.el.ExpressionFactoryImpl cannot be cast to javax.el.ExpressionFactory