我正面临主题的错误,我不知道在哪里可以试一试。最有趣的是应用程序运行完美。我在互联网上搜索,我从一些OSGI用户那里找到了一些类似的主题。虽然我对使用OSGI不感兴趣,但我相信Spring 4没有对OSGI的默认支持或依赖,我可以在下面的日志中看到与IBM命名空间相关的这个词。我正在使用Websphere Liberty Profile v8.5,Spring 4,JDK 6和maven。我发现下面的链接解释了用于管理classPath的PathMatchingResourcePatternResolver,但我没有使用这个对象,至少我没有明确地使用它。
product = WebSphere Application Server 8.5.5.3 (wlp-1.0.6.cl50320140731-0257)
wlp.install.dir = C:/IBMliberty/
java.home = C:\Program Files\Java\jdk1.6.0_45\jre
java.version = 1.6.0_45
java.runtime = Java(TM) SE Runtime Environment (1.6.0_45-b06)
os = Windows 7 (6.1; amd64) (en_US)
********************************************************************************
[11/26/14 14:20:44:301 CST] 00000001 com.ibm.ws.logging.internal.TraceSpecification I TRAS0018I: The trace state has been changed. The new trace state is *=info.
[11/26/14 14:20:44:326 CST] 00000001 com.ibm.ws.kernel.launch.internal.FrameworkManager A CWWKE0001I: The server defaultServer has been launched.
[11/26/14 14:20:49:151 CST] 00000001 com.ibm.ws.kernel.launch.internal.FrameworkManager I CWWKE0002I: The kernel started after 5.375 seconds
[11/26/14 14:20:49:270 CST] 00000018 com.ibm.ws.kernel.feature.internal.FeatureManager I CWWKF0007I: Feature update started.
[11/26/14 14:20:56:450 CST] 00000011 com.ibm.ws.app.manager.internal.monitor.DropinMonitor A CWWKZ0058I: Monitoring dropins for applications.
[11/26/14 14:20:57:386 CST] 0000001c com.ibm.ws.tcpchannel.internal.TCPChannel I CWWKO0219I: TCP Channel defaultHttpEndpoint has been started and is now listening for requests on host 127.0.0.1 (IPv4: 127.0.0.1) port 8080.
[11/26/14 14:21:01:192 CST] 00000018 com.ibm.ws.kernel.feature.internal.FeatureManager I CWWKF0008I: Feature update completed in 12.117 seconds.
[11/26/14 14:21:01:193 CST] 00000018 com.ibm.ws.kernel.feature.internal.FeatureManager A CWWKF0011I: The server defaultServer is ready to run a smarter planet.
[11/26/14 14:24:05:977 CST] 00000016 com.ibm.ws.config.xml.internal.ConfigRefresher A CWWKG0016I: Starting server configuration update.
[11/26/14 14:24:08:618 CST] 00000022 com.ibm.ws.config.xml.internal.ConfigRefresher A CWWKG0017I: The server configuration was successfully updated in 2.639 seconds.
[11/26/14 14:24:08:618 CST] 00000022 com.ibm.ws.app.manager.AppMessageHelper W CWWKZ0014W: The application MHE_original could not be started as it could not be found at location MHE.war.
[11/26/14 14:24:10:828 CST] 00000018 com.ibm.ws.app.manager.AppMessageHelper I CWWKZ0018I: Starting application MHE_original.
[11/26/14 14:24:13:298 CST] 00000018 com.ibm.ws.webcontainer.osgi.webapp.WebGroup I SRVE0169I: Loading Web Module: MHE.
[11/26/14 14:24:13:298 CST] 00000018 com.ibm.ws.webcontainer I SRVE0250I: Web Module MHE has been bound to default_host.
[11/26/14 14:24:13:298 CST] 00000018 com.ibm.ws.http.internal.VirtualHostImpl A CWWKT0016I: Web application available (default_host): http://localhost:8080/MHE2/
[11/26/14 14:24:13:439 CST] 00000018 com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0001I: Application MHE_original started in 2.486 seconds.
[11/26/14 14:25:22:460 CST] 0000002b com.ibm.ws.session.WASSessionCore I SESN8501I: The session manager did not find a persistent storage location; HttpSession objects will be stored in the local application server's memory.
[11/26/14 14:25:22:491 CST] 0000002b com.ibm.ws.session.WASSessionCore I SESN0176I: A new session context will be created for application key default_host/MHE2
[11/26/14 14:25:22:538 CST] 0000002b com.ibm.ws.util I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[11/26/14 14:25:33:994 CST] 0000002b com.ibm.ws.webcontainer.webapp I SRVE0292I: Servlet Message - [MHE]:.No Spring WebApplicationInitializer types detected on classpath
[11/26/14 14:25:34:619 CST] 0000002b com.ibm.ws.webcontainer.webapp I SRVE0292I: Servlet Message - [MHE]:.Initializing Spring root WebApplicationContext
[11/26/14 14:25:34:619 CST] 0000002b org.springframework.web.context.ContextLoader I Root WebApplicationContext: initialization started
[11/26/14 14:25:34:947 CST] 0000002b springframework.web.context.support.XmlWebApplicationContext I Refreshing Root WebApplicationContext: startup date [Wed Nov 26 14:25:34 CST 2014]; root of context hierarchy
[11/26/14 14:25:35:072 CST] 0000002b rg.springframework.beans.factory.xml.XmlBeanDefinitionReader I Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
[11/26/14 14:25:35:919 CST] 0000002b g.springframework.beans.factory.config.PropertiesFactoryBean I Loading properties file from class path resource [restServices.properties]
[11/26/14 14:25:36:122 CST] 0000002b org.springframework.web.context.ContextLoader I Root WebApplicationContext: initialization completed in 1503 ms
[11/26/14 14:25:36:169 CST] 0000002b com.ibm.ws.webcontainer.webapp I SRVE0292I: Servlet Message - [MHE]:.Initializing Spring FrameworkServlet 'mvc-dispatcher'
[11/26/14 14:25:36:169 CST] 0000002b org.springframework.web.servlet.DispatcherServlet I FrameworkServlet 'mvc-dispatcher': initialization started
[11/26/14 14:25:36:169 CST] 0000002b springframework.web.context.support.XmlWebApplicationContext I Refreshing WebApplicationContext for namespace 'mvc-dispatcher-servlet': startup date [Wed Nov 26 14:25:36 CST 2014]; parent: Root WebApplicationContext
[11/26/14 14:25:36:169 CST] 0000002b rg.springframework.beans.factory.xml.XmlBeanDefinitionReader I Loading XML bean definitions from ServletContext resource [/WEB-INF/mvc-dispatcher-servlet.xml]
[11/26/14 14:25:37:060 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Cannot search for matching files underneath URL [bundleresource://96.fwk1553324600/] because it does not correspond to a directory in the file system
java.io.FileNotFoundException: URL [bundleresource://96.fwk1553324600/] cannot be resolved to absolute file path because it does not reside in the file system: bundleresource://96.fwk1553324600/
at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:212)
at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:52)
at org.springframework.core.io.UrlResource.getFile(UrlResource.java:212)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingFileResources(PathMatchingResourcePatternResolver.java:598)
at org.springframework.web.context.support.ServletContextResourcePatternResolver.doFindPathMatchingFileResources(ServletContextResourcePatternResolver.java:92)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:419)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:273)
at org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1159)
at org.springframework.core.io.support.ResourceArrayPropertyEditor.setValue(ResourceArrayPropertyEditor.java:159)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:387)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:195)
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:460)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:511)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:505)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1476)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1216)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:150)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:663)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:629)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:677)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:548)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:489)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:161)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:325)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadOnStartupCheck(ServletWrapper.java:1410)
at com.ibm.ws.webcontainer.webapp.WebApp.doLoadOnStartupActions(WebApp.java:1095)
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:1063)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:969)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6092)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:440)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:252)
at com.ibm.ws.http.internal.VirtualHostImpl.discriminate(VirtualHostImpl.java:458)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:203)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:448)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:382)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:282)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:253)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:174)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:83)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:502)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:559)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:908)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:991)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
[11/26/14 14:25:37:078 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Cannot search for matching files underneath URL [bundleresource://95.fwk1553324600/] because it does not correspond to a directory in the file system
java.io.FileNotFoundException: URL [bundleresource://95.fwk1553324600/] cannot be resolved to absolute file path because it does not reside in the file system: bundleresource://95.fwk1553324600/
at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:212)
at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:52)
at org.springframework.core.io.UrlResource.getFile(UrlResource.java:212)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingFileResources(PathMatchingResourcePatternResolver.java:598)
at org.springframework.web.context.support.ServletContextResourcePatternResolver.doFindPathMatchingFileResources(ServletContextResourcePatternResolver.java:92)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:419)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:273)
at org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1159)
at org.springframework.core.io.support.ResourceArrayPropertyEditor.setValue(ResourceArrayPropertyEditor.java:159)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:387)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:195)
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:460)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:511)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:505)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1476)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1216)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:150)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:663)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:629)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:677)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:548)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:489)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:161)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:325)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadOnStartupCheck(ServletWrapper.java:1410)
at com.ibm.ws.webcontainer.webapp.WebApp.doLoadOnStartupActions(WebApp.java:1095)
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:1063)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:969)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6092)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:440)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:252)
at com.ibm.ws.http.internal.VirtualHostImpl.discriminate(VirtualHostImpl.java:458)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:203)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:448)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:382)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:282)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:253)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:174)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:83)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:502)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:559)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:908)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:991)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
[11/26/14 14:25:37:085 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\STS\ws\MHE_original\WebContent\WEB-INF\lib\db2java.jar] because it does not denote a directory
[11/26/14 14:25:37:086 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\STS\ws\MHE_original\WebContent\WEB-INF\lib\jeapCore-03.02.1.2.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\STS\ws\MHE_original\WebContent\WEB-INF\lib\upload.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\org\apache\httpcomponents\httpclient\4.1.1\httpclient-4.1.1.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\org\apache\httpcomponents\httpcore\4.1\httpcore-4.1.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\commons-codec\commons-codec\1.4\commons-codec-1.4.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.12\jackson-mapper-asl-1.9.12.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.12\jackson-core-asl-1.9.12.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\org\springframework\spring-core\4.1.2.RELEASE\spring-core-4.1.2.RELEASE.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\org\springframework\spring-web\4.1.2.RELEASE\spring-web-4.1.2.RELEASE.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\org\springframework\spring-aop\4.1.2.RELEASE\spring-aop-4.1.2.RELEASE.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\org\springframework\spring-beans\4.1.2.RELEASE\spring-beans-4.1.2.RELEASE.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\org\springframework\spring-webmvc\4.1.2.RELEASE\spring-webmvc-4.1.2.RELEASE.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\org\springframework\spring-expression\4.1.2.RELEASE\spring-expression-4.1.2.RELEASE.jar] because it does not denote a directory
[11/26/14 14:25:37:102 CST] 0000002b ramework.core.io.support.PathMatchingResourcePatternResolver W Skipping [C:\Users\e049447\.m2\repository\org\springframework\spring-context\4.1.2.RELEASE\spring-context-4.1.2.RELEASE.jar] because it does not denote a directory
[11/26/14 14:25:37:118 CST] 0000002b framework.beans.factory.config.PropertyPlaceholderConfigurer I Loading properties file from file [C:\STS\ws\MHE_original\WebContent\WEB-INF\classes\environment.properties]
[11/26/14 14:25:37:118 CST] 0000002b framework.beans.factory.config.PropertyPlaceholderConfigurer I Loading properties file from file [C:\STS\ws\MHE_original\WebContent\WEB-INF\classes\extended.properties]
[11/26/14 14:25:37:118 CST] 0000002b framework.beans.factory.config.PropertyPlaceholderConfigurer I Loading properties file from file [C:\STS\ws\MHE_original\WebContent\WEB-INF\classes\restServices.properties]
[11/26/14 14:26:57:225 CST] 0000002b SystemOut O pchttp://localhost:8080/MHE2/log/display/last
[11/26/14 14:26:57:475 CST] 0000002b b.servlet.mvc.method.annotation.RequestMappingHandlerMapping I Mapped "{[/log/display/last],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.util.ArrayList<java.lang.String> com.ma.mhe.common.controller.Lo_Controller.getFirst(com.ma.mhe.log.domain.Mas60010)
[11/26/14 14:26:58:209 CST] 0000002b b.servlet.mvc.method.annotation.RequestMappingHandlerAdapter I Looking for @ControllerAdvice: WebApplicationContext for namespace 'mvc-dispatcher-servlet': startup date [Wed Nov 26 14:25:36 CST 2014]; parent: Root WebApplicationContext
[11/26/14 14:26:58:459 CST] 0000002b b.servlet.mvc.method.annotation.RequestMappingHandlerAdapter I Looking for @ControllerAdvice: WebApplicationContext for namespace 'mvc-dispatcher-servlet': startup date [Wed Nov 26 14:25:36 CST 2014]; parent: Root WebApplicationContext
[11/26/14 14:26:58:616 CST] 0000002b .springframework.web.servlet.handler.SimpleUrlHandlerMapping I Mapped URL path [/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
[11/26/14 14:26:58:678 CST] 0000002b org.springframework.web.servlet.DispatcherServlet I FrameworkServlet 'mvc-dispatcher': initialization completed in 82509 ms
[11/26/14 14:26:58:678 CST] 0000002b com.ibm.ws.webcontainer.servlet I SRVE0242I: [MHE_original] [/MHE2] [mvc-dispatcher]: Initialization successful.
[11/26/14 14:27:07:544 CST] 0000001a com.ibm.ws.webcontainer.servlet
答案 0 :(得分:1)
我今天遇到了同样的问题,
看起来问题是,ClassLoader.getResources()返回带有协议“file”而不是“jar”的URL,并且在某些情况下不会将共享库中的jar文件作为单独的资源URL返回,而是返回共享库位置(例如包含JAR的文件夹)作为单个资源URL。这似乎让PathMatchingResourcePatternResolver
在某个地方混淆了。
我通过
解决了这个问题convertClassLoaderURL
方法,如果URL协议为“file”且扩展名为“.jar”,则显式实例化JAR资源,doFindPathMatchingFileResources
方法,以搜索代表目录的资源的JAR文件。AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext() {
protected ResourcePatternResolver getResourcePatternResolver() {
return new ServletContextResourcePatternResolver(this) {
protected Resource convertClassLoaderURL(URL url) {
if (url.getProtocol().equals("file") && url.getFile().endsWith(".jar")) {
try {
return new UrlResource("jar", url + "!/");
} catch (final MalformedURLException ex) {
//LOG.catching(ex);
}
}
return new UrlResource(url);
}
protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource, String subPattern) throws IOException {
Set<Resource> matches = super.doFindPathMatchingFileResources(rootDirResource, subPattern);
try {
File rootDir = rootDirResource.getFile();
if (rootDir.isDirectory()) {
Set<Resource> containedJARs = doFindMatchingFileSystemResources(rootDir, "*.jar");
for (Resource jar : containedJARs) {
Set<Resource> matchingResourcesFoundInJar = doFindPathMatchingJarResources(convertClassLoaderURL(jar.getURL()), subPattern);
matches.addAll(matchingResourcesFoundInJar);
}
}
} catch (final IOException ex) {
// LOG.catching(ex);
}
return matches;
}
}
};
答案 1 :(得分:1)
将应用程序从tomcat迁移到Liberty时遇到类似的问题,最后我找到了一种通过调试spring代码来解决它的方法,以下是我的解决方法,仅供参考:
原始代码:
//old process (tomcat)
dispatcherServletConfiguration = new AnnotationConfigWebApplicationContext();
将其更改为:
//changes for Liberty
AnnotationConfigWebApplicationContext dispatcherServletConfiguration = null;
String serverType = System.getProperty("server.type");
if(serverType != null && serverType.trim().equalsIgnoreCase("liberty")) {
dispatcherServletConfiguration = new AnnotationConfigWebApplicationContext(){
protected ResourcePatternResolver getResourcePatternResolver() {
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(this) {
protected Resource convertClassLoaderURL(URL url) {
if(url.getProtocol().equals("file") && url.getFile().endsWith(".jar")) {
try {
return new UrlResource("jar", url + "!/");
} catch (Exception ex) {
//log and swallow it.
log.warn("Error when convert UrlResource from 'file' to 'jar'.", ex);
}
}
//old process
return new UrlResource(url);
}
};
return resolver;
}
};
} else {
//old process (tomcat)
dispatcherServletConfiguration = new AnnotationConfigWebApplicationContext();
}
答案 2 :(得分:1)
当我们的项目使用的是Spring的4.3.4.RELEASE版本时,我们看到了这个问题。 更新到最新版本(当时为4.3.22.RELEASE)使问题消失了。