struts2.0问题

njliuqi 2008-06-14 02:59:44
我新建立项目后,lib中有5个jar: commons-logging-api-1.1.jar, freemarker-2.3.8.jar, ognl-2.6.11.jar, struts2-core-2.0.8.jar, xwork-2.0.3.jar
tomcat 启动时会报错:

严重: Exception starting filter struts2
Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - jar:file:/D:/workspace/Struts2Demo/webapp/WEB-INF/lib/struts2-core-2.0.8.jar!/struts-default.xml:8:72


classes目录下的struts.xml配置为:

<struts>
<package name="example" namespace="/example" extends="struts-default">
<action name="hello" class="cn.com.ldns.struts2.demo.HelloAction">
<result name="success">
/hello.jsp
</result>
<result name="fal">
/errors.jsp
</result>
</action>
</package>
</struts>

请问我哪写错了?
...全文
196 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
liya1014 2008-06-16
  • 打赏
  • 举报
回复
struts 2.0还没怎么用过啊!~
whetu 2008-06-15
  • 打赏
  • 举报
回复
把 你的struts-default.xml帖出来,看看他里面的struts.ObjectFactory项是怎么配置的。
我估计是你项目里面少jar包。
saly494 2008-06-15
  • 打赏
  • 举报
回复
..................
njliuqi 2008-06-15
  • 打赏
  • 举报
回复
Setting Fix Version to "future" for issues without a set fix version.

This is pretty weird... so you are saying that if you extract struts-default.xml to WEB-INF/classes then it breaks? The stacktrace you provide show the file being served from the jar. If the problem is that the struts-default.xml has to be loaded by the same _classloader_ as the Struts classes, well that is certainly the case.

If you extract struts-default.xml and still keep it on ther will be all kind of exceptions (duplicated bean definitions and such). Please post a full stacktrace, or give more details.

67,537

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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