整合struts和hibernate时出错,用struts中的action调用hibernate里面的方法出现如下错误

严重:Servlet.service()forservletdefaultthrewexceptionjava.lang.IllegalStateExceptionato... 严重: Servlet.service() for servlet default threw exception
java.lang.IllegalStateException
at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407)
at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:752)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:505)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
展开
 我来答
在你下石榴裙下
2010-11-17 · TA获得超过5351个赞
知道大有可为答主
回答量:1328
采纳率:0%
帮助的人:2972万
展开全部
struts 2配置文件:struts.xml
?xml version="1.0" encoding="GBK"?
!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "[url]"[/url]
struts
constant name="struts.i18n.encoding" value="GBK"/
constant name="struts.custom.i18n.resources" value="messageResource"/
package name="lee" extends="struts-default"
action name="add" class="org.yeeku.action.AddPersonAndSon"
resultwelcome.html/result
/action
/package
/struts
对应的映射文件:Son.hbm.xml
?xml version="1.0" encoding="GBK"?
!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN" "[url]"[/url]
hibernate-mapping package="org.yeeku.model"
!-- 每个class元素映射一个持久化类 --
class name="Son" table="son"
id name="id"
generator class="identity"/
/id
property name="sonName"/
property name="sonAge"/
many-to-one name="parent" column="person_id" not-null="true"/
/class
/hibernate-mapping
时间片轮转算法
2010-11-04 · TA获得超过1661个赞
知道小有建树答主
回答量:809
采纳率:0%
帮助的人:610万
展开全部
错误原因有很多种,你自己找
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式