`
ssydxa219
  • 浏览: 622325 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

Could not instantiate bean class

 
阅读更多

严重: Servlet.service() for servlet default threw exception
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.AnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.VerifyError: class org.hibernate.type.WrappedMaterializedBlobType overrides final method getReturnedClass.()Ljava/lang/Class;
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
 at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1097)
 at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:242)
 at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:227)
 at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:171)
 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
 at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.AnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.VerifyError: class org.hibernate.type.WrappedMaterializedBlobType overrides final method getReturnedClass.()Ljava/lang/Class;
 at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162)
 at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104)
 at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newConfiguration(LocalSessionFactoryBean.java:818)
 at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:549)
 at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
 ... 23 more
Caused by: java.lang.VerifyError: class org.hibernate.type.WrappedMaterializedBlobType overrides final method getReturnedClass.()Ljava/lang/Class;
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
 at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2775)
 at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1126)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1614)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1493)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
 at org.hibernate.type.BasicTypeRegistry.<init>(BasicTypeRegistry.java:91)
 at org.hibernate.type.TypeResolver.<init>(TypeResolver.java:59)
 at org.hibernate.cfg.Configuration.<init>(Configuration.java:250)
 at org.hibernate.cfg.Configuration.<init>(Configuration.java:302)
 at org.hibernate.cfg.AnnotationConfiguration.<init>(AnnotationConfiguration.java:168)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
 ... 29 more

 

 

#############################@@@@@@@@@@@$$$%%%%%%%^&&&&&&&*

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.AnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.VerifyError: org/hibernate/type/WrappedMaterializedBlobType
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
	org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1097)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:242)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:227)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:171)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

 

root cause

org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.AnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.VerifyError: org/hibernate/type/WrappedMaterializedBlobType
	org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162)
	org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104)
	org.springframework.orm.hibernate3.LocalSessionFactoryBean.newConfiguration(LocalSessionFactoryBean.java:818)
	org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:549)
	org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
	org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1097)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:242)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:227)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:171)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

 

root cause

java.lang.VerifyError: org/hibernate/type/WrappedMaterializedBlobType
	org.hibernate.type.BasicTypeRegistry.<init>(BasicTypeRegistry.java:91)
	org.hibernate.type.TypeResolver.<init>(TypeResolver.java:59)
	org.hibernate.cfg.Configuration.<init>(Configuration.java:250)
	org.hibernate.cfg.Configuration.<init>(Configuration.java:302)
	org.hibernate.cfg.AnnotationConfiguration.<init>(AnnotationConfiguration.java:168)
	sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
	org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104)
	org.springframework.orm.hibernate3.LocalSessionFactoryBean.newConfiguration(LocalSessionFactoryBean.java:818)
	org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:549)
	org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
	org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1097)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:242)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:227)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:171)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
分享到:
评论

相关推荐

    @AspectJ配置Spring AOP,demo

    &lt;bean class="com.example.aspect.LoggingAspect" /&gt; ``` 或者在Java配置中: ```java @Configuration @EnableAspectJAutoProxy public class AppConfig { @Bean public LoggingAspect loggingAspect() { ...

    springAOP demo 带错误解决文档

    nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator]: ...

    Maven解决jar冲突调试步骤

    nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.topsec.tbm.web.auth.TbmRealm]: Constructor threw exception; nested exception is Java....

    spring boot spring could

    Spring Boot和Spring Cloud是两个非常重要的Java开发框架,它们在构建微服务架构中扮演着核心角色。Spring Boot致力于简化Spring应用程序的初始设置和配置,而Spring Cloud则为开发者提供了实现云应用开发的一系列...

    最新二级缓存memcached,支持hibernate4

    解决目前memcached不支持hibernate4的缺陷,hibernate配置&lt;property name="hibernate.cache.region.factory_class"&gt;com.googlecode.hibernate.memcached.MemcachedRegionFactory&lt;/property&gt;

    phpmailer,php发送邮件类库

    phpmailer是一个php发送邮件的类库; 在window下使用基本没有问题,如果在linux上无法使用,出现could not connect to smtp host错误,可以参考我文章中的解决方案

    org.hibernate.HibernateException: No Hibernate Session bound to thread

    Hibernate Session 绑定线程解决方案 在 Java web 开发中, Hibernate 是一个非常流行的 ORM(Object-Relational Mapping)框架,用于将 Java 对象映射到关系数据库中。然而,在使用 Hibernate 进行数据库操作时,...

    PHP使用PHPMailer发送邮件的简单使用方法

    使用官方自带的一些例子,有些会报 Mailer Error: Could not instantiate mail function. 这个错误。参考了一些资料之后,还是自己写了一个方法。代码很简单,就不多解释了。复制代码 代码如下:function mailto($...

    jain sip 入门

    标题:"Jain SIP入门" 描述:"本文档旨在详细介绍Jain SIP的基础知识,为开发者提供一个全面的入门指南。" 标签:"SIP" 部分内容摘要:"Jain SIP是标准化的Java接口,用于实现桌面和服务器应用程序中的会话发起...

    解决MyEclipse下开发Struts异常:org.apache.struts.taglib.bean.CookieTei.doc 下载

    我们将深入探讨如何解决在MyEclipse环境下开发Struts应用时遇到的一个常见问题:“org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.bean....

    PHPMailer使用QQ邮箱实现邮件发送功能

    require_once("../../includes/phpmailer/5.1/class.phpmailer.php"); require_once("../../includes/phpmailer/5.1/class.smtp.php"); ``` 接下来,实例化PHPMailer类: ```php $mail = new PHPMailer(); ``` ...

    Unity3D入门 :Prefabs(预设)与 Instantiate(实例化)

    public class SpawnPlayer : MonoBehaviour { public GameObject playerPrefab; // 在Inspector中拖放Player Prefab void Start() { Vector3 spawnPosition = new Vector3(0, 1, 0); // 设置初始位置 ...

    Unity3D教程:Prefabs与Instantiate1

    Unity3D Prefabs 与 Instantiate 教程 Unity 3D 中的 Prefabs 是一种资源类型,可以被重复使用的游戏对象。它可以被置入多个场景中,又或者能够在一个场景中被多次置入。当你在一个场景中增加一个 Prefabs,你就...

    myclipse+jboss+ejbStateless

    &lt;br&gt; 测试代码完成测试 &lt;br&gt; 报错:Cannot instantiate class: org.jnp.interfaces.NamingContextFactory &lt;br&gt; 添加 引用 &lt;br&gt;继续报错是因为JNDI访问名称错误,也是用了原来的那个了。哈哈。...

    Hibernate配置常见错误

    错误表现:在初始化SessionFactory时,可能出现“org.hibernate.HibernateException: Could not instantiate dialect class”等异常,这通常是因为Hibernate配置文件中的dialect设置不正确或对应的JDBC驱动未引入。...

    python继承和抽象类的实现方法

    class AbstractEmployee(ABC): def __init__(self, first, last): self.firstName = first self.lastName = last @abstractmethod def earnings(self): pass ``` 在这个例子中,`AbstractEmployee` 类是一个...

    自己的IoC框架实现

    `instantiateBean`使用`Class.forName`和`newInstance`创建对象,然后`injectDependencies`遍历对象的字段,如果发现类型为其他beanId的字段,就从beanPool中获取对应对象注入。 最后,我们可以创建一个简单的测试...

    自己实现IOC容器

    throw new BeanCreationException("Failed to instantiate bean", e); } } } ``` #### 2.5 实现依赖注入 最后,我们需要处理Bean间的依赖关系。这可以通过在Bean工厂中增加一个方法,遍历所有Bean,查找并注入...

    Unity中Instantiate实例化物体卡顿问题的解决

    本文实例为大家分享了Unity中Instantiate实例化物体卡顿问题的解决方法,供大家参考,具体内容...public class Test : MonoBehaviour { public GameObject prefab; private void Update() { if (Input.GetKeyDown

    spring学习源码笔记

    在`instantiateBean(...)`方法中,Spring会根据实例化策略(如无参构造函数、工厂方法等)来创建bean实例,并在适当的时候应用`BeanPostProcessor`。 通过深入理解Spring的源码,我们可以更好地掌握其内部工作原理...

Global site tag (gtag.js) - Google Analytics