org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionfactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
缺少 javassist.jar
下载地址:http://jboss.org/javassist/downloads/
最近一直在看java的三大开源框架(Struts、Spring、Hibernate)其中遇到点问题,在下费了好大劲才找到原因,所以把我的错误贴出来供大家分享,以至有同样错误的网友有个参考。
好,下面则是开篇:
我在做Spring和Hibernate整合的时候报了以下的错误:
Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file […….xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
在百度、Google上都没找到解决方法。可能运气不好,百度只有几条结果。其中只有一条有个解决方法:
缺少 javassist.jar。索性下载它并添加进lib,结果还是不行。其它的根本就是只有提问没有回答。Google搜索的结果到挻多但中文的大多跟百度的结果差不多,有些英文的看不太懂。后来索性自己找问题。
我逐步的缩减项目把项目精减到最小,最后终于发现hibernate.cfg.xml里的mapping项目中有一条.hbm.xml文件配置写错了,暂时把它删除了,调试程序。问题解决。
这篇文章写得有点长,解决方法技术含量并不高,主要强调的是自己解决问题的思路及步骤,希望能给有同样问题的朋友一点帮助。
更有可能的是包的冲突,因为后面的错误信息中有如下错误:
NoClassDefFoundError: org/objectweb/asm/CodeVisitor
在google上一搜就有很多解决方法
分享到:
相关推荐
FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient 通过控制台的...
No Hibernate Session bound to thread,没有绑定线程解决办法,找了好久才找到的
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider] at org.hibernate.service.internal....
解决目前memcached不支持hibernate4的缺陷,hibernate配置<property name="hibernate.cache.region.factory_class">com.googlecode.hibernate.memcached.MemcachedRegionFactory</property>
WebService大讲堂之Axis2,多个实例,非常全的文档,从新手入门开始到复杂的实例
ar.com.tadp.xml.rinzo_0.9.0.zip eclipse xml 插件
<br> 测试代码完成测试 <br> 报错:Cannot instantiate class: org.jnp.interfaces.NamingContextFactory <br> 添加 引用 <br>继续报错是因为JNDI访问名称错误,也是用了原来的那个了。哈哈。...
1)第一种不是常驻型广播,也就是说广播跟随注册他的Activity的生命周期。 2)第二种是常驻型,也就是说当应用程序关闭后,如果有信息广播来,程序也会被系统调用自动运行。
dpoll ... 最初创建于 安装 $ python3 -m venv dpoll-env $ tmp source dpoll-env/bin/activate ...$ cd dpoll.xyz $ pip install -r requirements.txt $ touch dpoll/base/settings.py dpoll/base/local_settings.py ...
FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient 解决方法 ...
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.amqp.core.Queue]: Factory method 'clientQueue' threw exception; nested exception is org....
Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/aop] Offending resource: class path resource [beans.xml] at org....
Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to ...
SSH登录无实例化例子 SSH登录无实例化例子
一、hive版本验证,FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata....解决方法 ...
把下载的jar包放在 Maven仓库的 org\mybatis\generator\mybatis-generator-core\1.3.5 下面即可,然后在generatorConfig配置文件中加上<plugin type="org.mybatis.generator.plugins.LombokPlugin" > </plugin> ...
Threads compatibility routines for libgcc2 and libobjc.
{“success”:false,“message”:“Failed to instantiate the chaincode. cause:instantiate proposal resulted in an error :: Error: 2 UNKNOWN: chaincode error (status: 500, message: is not a valid ...
免费的库存管理软件,很好用的org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.io.File]: No default constructor found; nested exception is java.lang....
jain sip 入门文档jain sip 入门文档jain sip 入门文档jain sip 入门文档jain sip 入门文档jain sip 入门文档jain sip 入门文档jain sip 入门文档