信息: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
2012-7-9 13:54:29 org.apache.catalina.core.StandardContext listenerStart
严重: 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 class path resource [applicationContext-jdbc.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.Configuration]: Constructor threw exception; nested exception is java.lang.NoSuchFieldError: INSTANCE
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:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:377)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:278)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:897)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.Configuration]: Constructor threw exception; nested exception is java.lang.NoSuchFieldError: INSTANCE
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104)
at org.springframework.orm.hibernate3.SessionFactoryBuilderSupport.newConfiguration(SessionFactoryBuilderSupport.java:529)
at org.springframework.orm.hibernate3.SessionFactoryBuilderSupport.initializeConfigurationIfNecessary(SessionFactoryBuilderSupport.java:502)
at org.springframework.orm.hibernate3.SessionFactoryBuilderSupport.doBuildSessionFactory(SessionFactoryBuilderSupport.java:255)
at org.springframework.orm.hibernate3.SessionFactoryBeanDelegate.afterPropertiesSet(SessionFactoryBeanDelegate.java:110)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:96)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 26 more
Caused by: java.lang.NoSuchFieldError: INSTANCE
at org.hibernate.type.BasicTypeRegistry.<init>(BasicTypeRegistry.java:94)
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 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)
... 34 more
2012-7-9 13:54:29 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
2012-7-9 13:54:29 org.apache.catalina.core.StandardContext startInternal
严重: Context [/risPro] startup failed due to previous errors
2012-7-9 13:54:29 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2012-7-9 13:54:29 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\apache-tomcat-7.0.25\webapps\ROOT
2012-7-9 13:54:29 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8081"]
2012-7-9 13:54:29 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
2012-7-9 13:54:29 org.apache.catalina.startup.Catalina start
信息: Server startup in 1973 ms

解决方案 »

  1.   

    WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
    log4j:WARN Please initialize the log4j system properly.log4j 的配置文件没有找到。
      

  2.   

    那么下边的那些    严重: 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 class path resource [applicationContext-jdbc.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.Configuration]: Constructor threw exception; nested exception is java.lang.NoSuchFieldError: INSTANCE
     这个是什么问题呢
      

  3.   

    Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    首先这个是没有初始化ContextLoaderListener
     Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-jdbc.xml]: Invocation of init method failed
    找不到他的方法
      

  4.   

    Java出错就是很长很长的,你也不能全翻译过来找错啊,就像是一个空指针错误,下面还有很多错误信息呢,但其实他就是一个空指针错误,所以你应该只要找错误的源头就行了。总的来说这个错误就是找不到log4j的配置文件,不能注入。
      

  5.   

    我都没加log4j的包,怎么冒出个这错误,真是的!
      

  6.   

    问题奇迹般的解决了,是因为我的web.xml里配置的太乱了。把里边主要的几个次要的配置都先删除了,把struts、spring先配正确,再一个个的加上其他的,对了。谢谢大家了。
      

  7.   

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-jdbc.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.Configuration]: Constructor threw exception; nested exception is java.lang.NoSuchFieldError: INSTANCE看看是不是你的Hibernate包有问题!!
      

  8.   

    估计楼主的web.xml是copy过来的,里面用到一些其他的配置文件又没copy过来,这结果就是某些东西找不到了。
      

  9.   

    建议配置文件不要直接copy,还是根据自己的需要配进去。