ITeye博客

struts2 convention-plugin

pure1202 · 2011-03-10 00:36 · 应用 · 企业架构 · Java · MySQL · Hibernate · AOP · Oracle · Markdown

异常信息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)

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。