博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SSH整合错误三连
阅读量:7113 次
发布时间:2019-06-28

本文共 2485 字,大约阅读时间需要 8 分钟。

访问Action错误

ognl.MethodFailedException: Method "add" failed for object com.test3.action.UserAction@557d9144 [java.lang.NoSuchMethodError: org.hibernate.Session.getFlushMode()Lorg/hibernate/FlushMode;]

at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1305)

at ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)
at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:117)
at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:108)
at ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1369)
at ognl.ASTMethod.getValueBody(ASTMethod.java:90)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
at ognl.SimpleNode.getValue(SimpleNode.java:258)
at ognl.Ognl.getValue(Ognl.java:494)
at ognl.Ognl.getValue(Ognl.java:458)

...省略

1、这是版本问题,参见此问题的Answer

版本符合后,又出现error

 

org.springframework.orm.hibernate4.HibernateSystemException: getFlushMode is not valid without active transaction; nested exception is org.hibernate.HibernateException: getFlushMode is not valid without active transaction org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:218) org.springframework.orm.hibernate4.HibernateTemplate.doExecute(HibernateTemplate.java:344) org.springframework.orm.hibernate4.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:309) org.springframework.orm.hibernate4.HibernateTemplate.save(HibernateTemplate.java:618) com.test3.dao.impl.UserDaoImpl.save(UserDaoImpl.java:13) com.test3.service.impl.UserServiceImpl.save(UserServiceImpl.java:17) com.test3.action.UserAction.add(UserAction.java:25) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:870)

2、参考该链接第二种方法

若此时无error最好不过了,现实很残酷

又一error

org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.

3、检查spring的配置文件,查看事务启动

使用注解的情况

<tx:annotation-driven transaction-manager="transactionManager"/>

参考

没有使用注解

检查配置切入点路径是否正确

个人是因为路径写错,修改后无错误。

记录一次error三连。

 

转载于:https://www.cnblogs.com/GG-Bond/p/10748951.html

你可能感兴趣的文章
openstack中彻底删除计算节点的操作记录
查看>>
统一回复《怎么学JavaScript?》
查看>>
[AngularJS] Using an AngularJS directive to hide the keyboard on submit
查看>>
博客迁址通知
查看>>
Git查看、删除、重命名远程分支和tag(转)
查看>>
Atitit 编程语言常用算法attilax总结
查看>>
前端学PHP之MemCache
查看>>
更改WAS Profiles的概要文件的server1的SDK版本
查看>>
Centos下MySQL主从同步配置
查看>>
Sort Detail Data Block Example - Oracle Forms
查看>>
如何在Node.js中合并两个复杂对象
查看>>
(笔记)VC6插件安装--Unable to register this add-in because its DllRegisterServer returns an error...
查看>>
【.net 深呼吸】细说CodeDom(7):索引器
查看>>
CSS3 速移动效果动画流畅无卡顿
查看>>
ASP.NET Core MVC/WebAPi 模型绑定探索
查看>>
Linux进程管理子系统分析【转】
查看>>
一步步构建iOS路由
查看>>
无法启动MYSQL服务”1067 进程意外终止”解决办法
查看>>
基於tiny4412的Linux內核移植 --- 实例学习中断背后的知识(1)
查看>>
Python魔法方法(magic method)细解几个常用魔法方法(上)
查看>>