异常信息1:
org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces.
org.springframework.aop.framework.DefaultAopProxyFactory.createAopProxy(DefaultAopProxyFactory.java:67)
org.springframework.aop.framework.ProxyCreatorSupport.createAopProxy(ProxyCreatorSupport.java:106)
org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110)
解决:
由于CGLIB基于字节码的静态代理不能建立,缺少jar包:cglib-nodep-2.2.jar
--------------------------------------------------------------------
异常信息2:
Caused by: org.hibernate.MappingException: could not instantiate id generator [entity-name=cn.aa.test.entity.User2]
at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:132)
at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:175)
。。。。。。
Caused by: org.hibernate.MappingException: Dialect does not support sequences
at org.hibernate.dialect.Dialect.getSequenceNextValString(Dialect.java:619)
at org.hibernate.id.SequenceGenerator.configure(SequenceGenerator.java:88)
。。。。。。
解决:
此处是用的mysql数据库,该表主键设置为auto_increment,
修改该对象主键生成策略名称为:
@GeneratedValue(strategy = GenerationType.IDENTITY)即可。
若数据库为oracle,则修改为@GeneratedValue(strategy = GenerationType.SEQUENCE)
分享到:
相关推荐
struts2-convention-plugin-2.3.24.1
struts2-convention-plugin-2.1.6.jar
struts2-convention-plugin-2.3.15.1.jar
struts2-convention-plugin-2.3.1.jar,使用注解的方式代替xml配置action,必须要引用这个包。
struts2-convention-plugin-2.1.8.jar
struts2-convention-plugin-2.3.32
struts2-convention-plugin-2.3.1.2.jar
struts2-convention-plugin-2.3.24.jar
不论高低版本,要使用struts2-core这个jar包,当又需struts2-convention-plugin.jar时勿必要使两者版本一致哦,否则会有DefError、Unable to read class诸等错误
struts2-convention-plugin-2.3.4.1.jar
struts2-convention-plugin-2.3.15.3.jar struts2配置Action注解要用到的包,真正实现零配置
Struts开始使用convention-plugin代替codebehind-plugin来实现struts的零配置,使用Convention插件,你需要此JAR文件
struts2-convention-plugin-2.1.8.1.jar
在Struts2框架中,Convention-Plugin是一项重要的功能,它允许开发者通过约定而非配置的方式快速搭建Web应用。 #### Convention-Plugin原理及实现 ##### 1. Convention-Plugin概述 在传统的Struts2项目中,开发...
Convention-plugin是Struts2提供的一种自动化配置机制,它允许开发者在不编写大量XML配置文件的情况下实现Action和结果页面的映射,极大地简化了开发流程。以下是关于Struts2 Convention-plugin的详细说明: 1. **...
从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行...
在给定的文件"struts2-convention-plugin-2.3.32.jar"中,我们关注的是Struts2的Convention插件,版本号为2.3.32。这个插件是Struts2框架的一个重要组成部分,旨在提供更加灵活和自动化的配置方式。 Convention...