Javassist Enhancement failed

四月 16, 2015 10:48:07 上午 org.hibernate.event.internal.DefaultLoadEventListener onLoad

INFO: HHH000327: Error performing load command : org.hibernate.HibernateException: Javassist Enhancement failed: com.spri.entity.User

报错原因是在User当中显示的写了一个构造方法,把原来默认的构造方法给覆盖了。这里用到了hibernate的持久化,那么为什么它的持久化需要一个无参的构造方法呢,原因是Hibernate的实现持久化的机制是反射,它在反射的时候,需要调用newInstance(),这个方法就是通过调用默认构造方法来创建实例对象的。在本例中自己写了一个有参的构造方法,把原来默认的构造方法覆盖了,而原来默认的方法是无参的,所以需要再显示构造一个无参数的构造方法。

解决办法:在User当中添加一个无参的构造方法。

时间: 2024-11-10 11:03:05

Javassist Enhancement failed的相关文章

javassist两个jar包导致:.Department_$$_javassist_1 cannot be cast to javassist.util.proxy.Proxy

当处理如下代码: 1 2 Javassist Enhancement failed: com.entities.Department java.lang.ClassCastException: com.entities.Department_$$_javassist_1 cannot be cast to javassist.util.proxy.Proxy 1 2 3 <many-to-one name="department" class="com.entities

[spring] org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljav 解决

今天为java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V错误真花了我大量的时间去找这个问题,在网上也找到了不少的解决的办法,但不知道为什么不能解决我的问题,也不知道是不是我用的工具的问题哟,不过综合找到的现在终于找到了,虽然花了不少的时间,但还是很高兴,本来不想把

java.lang.IllegalStateException: Failed to load ApplicationContext

1.错误描述 INFO:2015-02-05 22:14:21[main] - Loading XML bean definitions from class path resource [applicationContext.xml] INFO:2015-02-05 22:14:22[main] - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning INFO:2015-02-05

Caused by: java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateBaseDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not a

Caused by: java.lang.ClassNotFoundException: javassist.ClassPool

1.错误原因 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop } 2014-7-10 23:07:25 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 using

mysqld服务启动失败, Failed to restart mysqld.service: Unit not found.

-bash-4.2# service mysqld restart Redirecting to /bin/systemctl restart mysqld.serviceFailed to restart mysqld.service: Unit not found. 并不存在 mysqld 的服务, -bash-4.2# -bash-4.2# chkconfig -list -list: unknown option -bash-4.2# chkconfig --list Note: Thi

Spring Cloud ZooKeeper集成Feign的坑2,服务调用了一次后第二次调用就变成了500,错误:Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.n

错误如下: 2017-09-19 15:05:24.659 INFO 9986 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.spring[email protected]56528192: startup date [Tue Sep 19 15:05:24 CST 2017]; root of context hierarchy 2017-09-19 15:05:24.858 INFO 9986 --

Hive报错 Failed with exception java.io.IOException:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:user.name%7D

报错信息如下 Failed with exception java.io.IOException:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:user.name%7D 解决方法: 编辑 hive-site.xml 文件,添加下边的属性 <property> <name>system:java.io.tmpdir<

View Composer Agent initialization error (16): Failed to activate software license (1026556)

1.       桌面发布过程中偶尔有些桌面池中的桌面提示无法访问代理,查看报错信息如下:View Composer Agent initialization error (16):Failed to activate software license (1026556). KB地址:https://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&externalId=1026556 主要意思是Windows 7系统激活的