最近想整个最新的springMvc版本,启动遇到这个报错,项目还是能正常启动,找了好久也找不出问题所在啊。。。
求高人指点!
报错信息如下:
2014-04-10 00:43:53,464 ERROR [org.hibernate.impl.SessionFactoryImpl] - <Unable to construct current session context [org.springframework.orm.hibernate4.SpringSessionContext]>
java.lang.NoSuchMethodException: org.springframework.orm.hibernate4.SpringSessionContext.<init>(org.hibernate.engine.SessionFactoryImplementor)
at java.lang.Class.getConstructor0(Class.java:2810)
at java.lang.Class.getConstructor(Class.java:1718)
at org.hibernate.impl.SessionFactoryImpl.buildCurrentSessionContext(SessionFactoryImpl.java:1002)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:334)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)
at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:339)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:427)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:412)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:681)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
2014-04-10 00:43:53,640 INFO [org.springframework.web.context.ContextLoader] - <Root WebApplicationContext: initialization completed in 1396 ms>
配置事务
回复 @RAY_STONE:hibernate4的session是与线程绑定的,与hibernate3是不一样的方式又是一轮调试,发现问题出在<propkey="hibernate.current_session_context_class">org.springframework.orm.hibernate4.SpringSessionContext</prop>改成thread或jta就正常,难道是SpringSessionContext版本还没适配好?配置事务
把你的3个配置文件贴出来看一下?application,spring-mvc,web.xml
springmvc4?我操,你升级升的真勤奋.
呵呵,想重新搞一套,就整了个最新的楼主你的spring4能否借我参详一下,不甚感激。麻烦楼主发我邮箱345129564@qq.com。在在下感激不尽。最近公司可能要要最近太忙,才看到,还有需要吗?版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。