0 Replies Latest reply on Aug 18, 2011 5:09 PM by David Caldwell

    Problem deploying war file: Cannot search for matching files underneath URL

    David Caldwell Newbie

      I installed a war file following the instructions in converting the war using the war scheme (http://fusesource.com/docs/esb/4.4/esb_deploy_osgi/DeployWar-Convert.html).  The war file contains a restful web service developed prior to our interest in Fuse ESB.  The War conversion mechanism sounds like it may be intended to work for web services that have not been designed specifically to be hosted in an ESB, so I gave it a try.

       

      After starting the bundle, I get the following exception:

       

      12:18:57,908 | WARN | l Console Thread | hMatchingResourcePatternResolver | 141 - file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war - 0 | Cannot search for matching files underneath URL bundle://141.0:1/ because it does not correspond to a directory in the file system

      java.io.FileNotFoundException: URL bundle://141.0:1/ cannot be resolved to absolute file path because it does not reside in the file system: bundle://141.0:1/

      at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:204)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:52)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.core.io.UrlResource.getFile(UrlResource.java:168)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingFileResources(PathMatchingResourcePatternResolver.java:528)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.web.context.support.ServletContextResourcePatternResolver.doFindPathMatchingFileResources(ServletContextResourcePatternResolver.java:92)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:349)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:267)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1227)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:177)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at com.example.web.ExampleContextLoaderListener.createWebApplicationContext(ExampleContextLoaderListener.java:68)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)141:file____d__h_Example_DataServices_CwDs-v1_CwDs-v1_server_target_example.war:0

      at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext$1.call(HttpServiceContext.java:168)132:org.ops4j.pax.web.pax-web-jetty:1.0.3

      at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext$1.call(HttpServiceContext.java:164)132:org.ops4j.pax.web.pax-web-jetty:1.0.3

      at org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60)132:org.ops4j.pax.web.pax-web-jetty:1.0.3

      at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.addEventListener(HttpServiceContext.java:161)132:org.ops4j.pax.web.pax-web-jetty:1.0.3

      at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.addEventListener(JettyServerImpl.java:235)132:org.ops4j.pax.web.pax-web-jetty:1.0.3

      at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Started.addEventListener(ServerControllerImpl.java:276)132:org.ops4j.pax.web.pax-web-jetty:1.0.3

      at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.addEventListener(ServerControllerImpl.java:127)132:org.ops4j.pax.web.pax-web-jetty:1.0.3

      at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerEventListener(HttpServiceStarted.java:286)130:org.ops4j.pax.web.pax-web-runtime:1.0.3

      at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerEventListener(HttpServiceProxy.java:133)130:org.ops4j.pax.web.pax-web-runtime:1.0.3

      at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:276)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:561)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.register(WebAppPublisher.java:170)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.serviceChanged(WebAppPublisher.java:155)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.serviceChanged(WebAppPublisher.java:119)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.swissbox.tracker.ReplaceableService.setService(ReplaceableService.java:114)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.swissbox.tracker.ReplaceableService.access$100(ReplaceableService.java:28)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.swissbox.tracker.ReplaceableService$CollectionListener.serviceAdded(ReplaceableService.java:183)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.swissbox.tracker.ServiceCollection$Tracker.addingService(ServiceCollection.java:181)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)karaf.jar:2.2.0-fuse-00-43

      at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)karaf.jar:2.2.0-fuse-00-43

      at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184)karaf.jar:2.2.0-fuse-00-43

      at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:339)karaf.jar:2.2.0-fuse-00-43

      at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:273)karaf.jar:2.2.0-fuse-00-43

      at org.ops4j.pax.swissbox.tracker.ServiceCollection.onStart(ServiceCollection.java:139)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle$Stopped.start(AbstractLifecycle.java:121)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle.start(AbstractLifecycle.java:49)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.swissbox.tracker.ReplaceableService.onStart(ReplaceableService.java:146)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle$Stopped.start(AbstractLifecycle.java:121)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle.start(AbstractLifecycle.java:49)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:81)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.web.extender.war.internal.WebXmlObserver.doPublish(WebXmlObserver.java:304)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.web.extender.war.internal.WebXmlObserver.addingEntries(WebXmlObserver.java:153)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.swissbox.extender.BundleWatcher.register(BundleWatcher.java:186)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.swissbox.extender.BundleWatcher.access$000(BundleWatcher.java:45)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.ops4j.pax.swissbox.extender.BundleWatcher$1.bundleChanged(BundleWatcher.java:127)134:org.ops4j.pax.web.pax-web-extender-war:1.0.3

      at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:795)org.apache.felix.framework-3.0.9-fuse-00-43.jar:

      at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:717)org.apache.felix.framework-3.0.9-fuse-00-43.jar:

      at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:597)org.apache.felix.framework-3.0.9-fuse-00-43.jar:

      at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3751)org.apache.felix.framework-3.0.9-fuse-00-43.jar:

      at org.apache.felix.framework.Felix.startBundle(Felix.java:1781)org.apache.felix.framework-3.0.9-fuse-00-43.jar:

      at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:927)org.apache.felix.framework-3.0.9-fuse-00-43.jar:

      at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:914)org.apache.felix.framework-3.0.9-fuse-00-43.jar:

      at org.apache.karaf.shell.osgi.StartBundle.doExecute(StartBundle.java:29)21:org.apache.karaf.shell.osgi:2.2.0.fuse-00-43

      at org.apache.karaf.shell.osgi.BundlesCommand.doExecute(BundlesCommand.java:37)21:org.apache.karaf.shell.osgi:2.2.0.fuse-00-43

      at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)38:org.apache.karaf.shell.console:2.2.0.fuse-00-43

      at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)38:org.apache.karaf.shell.console:2.2.0.fuse-00-43

      at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)38:org.apache.karaf.shell.console:2.2.0.fuse-00-43

      at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)38:org.apache.karaf.shell.console:2.2.0.fuse-00-43

      at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)38:org.apache.karaf.shell.console:2.2.0.fuse-00-43

      at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)38:org.apache.karaf.shell.console:2.2.0.fuse-00-43

      at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)38:org.apache.karaf.shell.console:2.2.0.fuse-00-43

      at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)38:org.apache.karaf.shell.console:2.2.0.fuse-00-43

      at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:79)38:org.apache.karaf.shell.console:2.2.0.fuse-00-43

      at org.apache.karaf.shell.console.jline.Console.run(Console.java:240)38:org.apache.karaf.shell.console:2.2.0.fuse-00-43

      at java.lang.Thread.run(Thread.java:619):1.6.0_21

       

      Apparently, the problem has to do with org.springframework.util.ResourceUtils.getFile not being able to handle the bundle protocol in the URL (felix user's group post - http://osdir.com/ml/users-felix-apache/2011-06/msg00143.html).

       

      The WEB-INF/classes directory in the bundle jar contains 2 spring files matching the contextConfigLocation pattern (classpath:applicationContext.xml).  The Bundle-Classpath contains WEB-INF/classes.

       

      Am I attempting something unusual?  Does the web service need some significant level of refactoring before the war->bundle conversion should work?  Or am I just missing a step or 2?  If the latter, any ideas on what the problem might be?

       

      David

       

      Edited by: ddc on Aug 18, 2011 9:07 PM

       

      Rich text didn't work very well.  Changed to plain text.