classpath*与classpath
由于项目改成maven web里面之前配置的加载文件都是用classpath 结果启动报错如下:
2015-8-12 10:12:14 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:\jdk1.6.0_24\bin;.;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;D:/jdk1.6.0_24/bin/../jre/bin/client;D:/jdk1.6.0_24/bin/../jre/bin;D:/jdk1.6.0_24/bin/../jre/lib/i386;C:\Program Files (x86)\Common Files\NetSarang;.;D:\jdk1.6.0_24\bin;D:\jdk1.6.0_24\jre\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\lenovo\easyplussdk\bin;C:\ProgramData\Lenovo\ReadyApps;D:\Program Files (x86)\Brackets\command;D:\eclipse;
2015-8-12 10:12:15 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:hi' did not find a matching property.
2015-8-12 10:12:15 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2015-8-12 10:12:15 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 437 ms
2015-8-12 10:12:15 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2015-8-12 10:12:15 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.33
2015-8-12 10:12:15 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2015-8-12 10:12:15 org.springframework.web.context.ContextLoader initWebApplicationContext
信息: Root WebApplicationContext: initialization started
2015-8-12 10:12:15 org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
信息: Refreshing Root WebApplicationContext: startup date [Wed Aug 12 10:12:15 CST 2015]; root of context hierarchy
2015-8-12 10:12:15 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [config/bean/application-dao.xml]
2015-8-12 10:12:15 org.springframework.web.context.ContextLoader initWebApplicationContext
严重: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [config/bean/application-dao.xml]; nested exception is java.io.FileNotFoundException: class path resource [config/bean/application-dao.xml] cannot be opened because it does not exist
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:343)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
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:129)
at
。。。。
老是找不到application-dao.xml 后来在网上查了下 大概意思是
你用classpath 他是顺序加载的 如果一个包里面 有2给相同的文件 他只找第一个文件 而用classpath* 者文件都加载进来遍历classpath