首页 新闻 会员 周边

新手在SSH整合中遇到了个愚蠢的错误

0
悬赏园豆:100 [待解决问题]

package org.zbq.action.type;

import java.util.Map;
import org.zbq.service.TypeService;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class ListTypeAction extends ActionSupport {

private TypeService typeService;

public TypeService getTypeService() {
    return typeService;
}

public void setTypeService(TypeService typeService) {
    this.typeService = typeService;
}

@SuppressWarnings("unchecked")  
@Override
public String execute() throws Exception {  
    Map request=(Map) ActionContext.getContext().get("request");
    
    request.put("list",this.typeService.findAllType());
    return SUCCESS;
}

}

打开网页链接报错
HTTP Status 500 – Internal Server Error

Type Exception Report

Message Method "execute" failed for object org.zbq.action.type.ListTypeAction@968db5d

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception
ognl.MethodFailedException: Method "execute" failed for object org.zbq.action.type.ListTypeAction@968db5d [java.lang.NoSuchMethodError: org.hibernate.Session.createQuery(Ljava/lang/String;)Lorg/hibernate/Query;]
ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1311)
ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)
com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:117)
com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:108)
ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1375)
ognl.ASTMethod.getValueBody(ASTMethod.java:91)
ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
ognl.SimpleNode.getValue(SimpleNode.java:258)
ognl.Ognl.getValue(Ognl.java:470)
ognl.Ognl.getValue(Ognl.java:434)
com.opensymphony.xwork2.ognl.OgnlUtil$3.execute(OgnlUtil.java:398)
com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecuteMethod(OgnlUtil.java:450)
com.opensymphony.xwork2.ognl.OgnlUtil.callMethod(OgnlUtil.java:396

jiezai的主页 jiezai | 初学一级 | 园豆:104
提问于:2018-09-24 12:40
< >
分享
所有回答(2)
0

java.lang.NoSuchMethodError: org.hibernate.Session.createQuery 调用的方法不存在?

队长给我球。 | 园豆:324 (菜鸟二级) | 2018-09-27 17:24
0

https://blog.csdn.net/u013238336/article/details/73928805 看一下能否解决,struts2很久没用了

番茄先生 | 园豆:911 (小虾三级) | 2018-09-29 13:51
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册