请教《WebWork in action》中第一个HelloWorld例子问题

jindayu2005 2008-10-31 09:41:10
请教《WebWork in action》中第一个HelloWorld例子问题:
第2章的HelloWorld例子,我按照书上步骤做,就是报错. 查了好几下了。请教一下是什么原因呢?谢谢!
(Tomcat版本是6.0.18 )。


HTTP Status 500 -

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

type Exception report

message

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

exception

javax.servlet.ServletException: Servlet execution threw an exception


root cause

java.lang.NoClassDefFoundError: Could not initialize class com.opensymphony.xwork.util.OgnlValueStack
com.opensymphony.xwork.ActionContext$ActionContextThreadLocal.initialValue(ActionContext.java:331)
java.lang.ThreadLocal.setInitialValue(Unknown Source)
java.lang.ThreadLocal.get(Unknown Source)
com.opensymphony.xwork.ActionContext.getContext(ActionContext.java:153)
com.opensymphony.webwork.dispatcher.WebWorkRequestWrapper.getAttribute(WebWorkRequestWrapper.java:38)
com.opensymphony.webwork.dispatcher.DispatcherUtils.createContextMap(DispatcherUtils.java:352)
com.opensymphony.webwork.dispatcher.DispatcherUtils.createContextMap(DispatcherUtils.java:311)
com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:241)
com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:111)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
...全文
164 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
caozhongwei06 2012-02-23
  • 打赏
  • 举报
回复
ognl-1.0.jar。你缺少这个包
jindayu2005 2008-10-31
  • 打赏
  • 举报
回复
我在网上找一会.有这样一句话"webwork 2.2以后web.xml出现很大改动。用filter代替了servlet。"所以把原web.xml的东西要改成

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>hello world</display-name>
<filter>
<filter-name>webwork</filter-name>
<filter-class>com.opensymphony.webwork.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>webwork</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
</web-app>
但又报了如下的错误:

type Exception report

message

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

exception

javax.servlet.ServletException: Filter execution threw an exception


root cause

java.lang.NoClassDefFoundError: Could not initialize class com.opensymphony.xwork.util.OgnlValueStack
com.opensymphony.xwork.ActionContext.getContext(ActionContext.java:156)
com.opensymphony.webwork.dispatcher.WebWorkRequestWrapper.getAttribute(WebWorkRequestWrapper.java:38)
com.opensymphony.webwork.dispatcher.DispatcherUtils.createContextMap(DispatcherUtils.java:352)
com.opensymphony.webwork.dispatcher.DispatcherUtils.createContextMap(DispatcherUtils.java:311)
com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:241)
com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:202)


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

10,613

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 其他
社区管理员
  • 其他
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧