首页 新闻 会员 周边 捐助

关于Java Web发布后提示的错误

0
悬赏园豆:20 [已解决问题] 解决于 2015-10-21 16:02

我的项目发布后提示如下错误:

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
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 java.lang.NoSuchMethodError: org.hibernate.cfg.annotations.reflection.XMLContext$Default.getDelimitedIdentifier()Ljava/lang/Boolean;
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
 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:291)
 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
 at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
 at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
 at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003)
 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1263)
 at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1948)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: org.hibernate.cfg.annotations.reflection.XMLContext$Default.getDelimitedIdentifier()Ljava/lang/Boolean;
 at org.hibernate.cfg.annotations.reflection.JPAMetadataProvider.getDefaults(JPAMetadataProvider.java:87)
 at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.getDefaults(JavaReflectionManager.java:226)
 at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1317)
 at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1307)
 at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:717)
 at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
 ... 25 more

 

我把上述相关的java包全部更新后仍然如此,请问问题出现在哪里,有哪些解决方法

昨日已逝的主页 昨日已逝 | 初学一级 | 园豆:159
提问于:2015-10-12 20:08
< >
分享
最佳答案
0

https://github.com/hibernate/hibernate-orm/blob/6504cb6d78740d2a4695096463f40baf18c9af11/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/XMLContext.java 第219行

2011年的时候就有Default.getDelimitedIdentifier()这个方法了,不知道这个是hibernate几了。

楼主hibernate版本是多少?

用Spring,Hibernate这种依赖比较复杂的,楼主最好还是使用maven吧

 

收获园豆:15
之奇一昂 | 小虾三级 |园豆:1421 | 2015-10-13 09:33
其他回答(1)
0

你这spring注入的问题怎么找,spring没有加载成功,我推测大约是在spring中配置该类时,未配置<property name="sessionFactory" ref="sessionFactory" />,其实ssh整合的问题还是自己去找,自己细心点

收获园豆:5
稳稳的河 | 园豆:4216 (老鸟四级) | 2015-10-13 09:31
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册