我把项目布置到Eclipse中就有错误

三月 10, 2015 10:56:17 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/8.0.14
三月 10, 2015 10:56:18 上午 org.apache.catalina.start![图片说明](https://img-ask.csdn.net/upload/201503/10/1425956762_83018.png)图片说明up.VersionLoggerListener log
信息: Server built: Sep 24 2014 09:01:51
三月 10, 2015 10:56:18 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 8.0.14.0
三月 10, 2015 10:56:18 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 7
三月 10, 2015 10:56:18 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 6.1
三月 10, 2015 10:56:18 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
三月 10, 2015 10:56:18 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.8.0_20-b26
三月 10, 2015 10:56:18 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
三月 10, 2015 10:56:19 上午 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Java\jre1.8.0_20\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:/Java/jre1.8.0_20/bin/server;D:/Java/jre1.8.0_20/bin;D:/Java/jre1.8.0_20/lib/amd64;%JAVA_HOME%\bin;C:\ProgramData\Oracle\Java\javapath;%JAVA_HOME%\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Java\eclipse;;.
三月 10, 2015 10:56:20 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:jshoper3' did not find a matching property.
三月 10, 2015 10:56:20 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-nio-8080"]
三月 10, 2015 10:56:21 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
三月 10, 2015 10:56:21 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-nio-8009"]
三月 10, 2015 10:56:21 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
三月 10, 2015 10:56:21 上午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 4388 ms
三月 10, 2015 10:56:21 上午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
三月 10, 2015 10:56:21 上午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.0.14
三月 10, 2015 10:56:25 上午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [235] milliseconds.
三月 10, 2015 10:56:37 上午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
三月 10, 2015 10:56:37 上午 org.apache.catalina.core.ApplicationContext log
信息: 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.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
三月 10, 2015 10:56:37 上午 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.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:539)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5221)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:171)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
... 21 more

三月 10, 2015 10:56:37 上午 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
三月 10, 2015 10:56:37 上午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/1] startup failed due to previous errors
三月 10, 2015 10:56:37 上午 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
三月 10, 2015 10:56:37 上午 org.apache.catalina.core.StandardContext listenerStop
严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171)
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1092)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1066)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1012)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:586)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4838)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5438)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

三月 10, 2015 10:56:38 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-8080"]
三月 10, 2015 10:56:38 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-nio-8009"]
三月 10, 2015 10:56:38 上午 org.apache.catalina.startup.Catalina start
信息: Server startup in 16433 ms

7个回答

这里是java环境有问题。你引用的build path看看jdk或者jre是否正确

看看applicationContext.xml的路径对不对吧,报的错误不是找不到嘛

这种都是spring没有配好,jar包没找到的。检查下applicationContext.xml吧。

BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
没有刷新整个项目,状态不对,编码方式不对。

检查一下配置文件,路径等信息是不是出错了。

1.找不到applicationContext.xml文件,查看一下是否配置该文件;
2.如果工程中存在该文件,检查一下web.xml中是否配之的地址是否正确。

java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist

没有找到applicationContext.xml文件,请检查一下

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问