问题描述
谁能帮帮我啊,这个到底是怎么回事啊,= =|||叩谢了严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.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 java.lang.AbstractMethodError: com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys()Zat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830)at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1105)at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203)at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)at java.lang.Thread.run(Thread.java:619)Caused by: java.lang.AbstractMethodError: com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys()Zat org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:123)at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:855)at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:774)at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1400)... 23 more
解决方案
java.lang.AbstractMethodError: com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys()Z 由这句可以知道你是用sql-server的驱动,但是BaseDatabaseMetaData.supportsGetGeneratedKeys这个方法是抽象的,所以出异常了,具体解决的话,一个是更换驱动看看,还有就是保证驱动的类是正确的
解决方案二:
奥,看错了,你看看是不是有两个包asm 和asm-2.2.3,这两个冲突。删掉后面那个试试吧。
解决方案三:
Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener 你没配置Spring 监听器吧。在web.xml中配置 <!--Spring ApplicationContext 载入 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>