Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] java.io.FileNotFoundException: ServletContext resource [/WEB-INF/lib/] cannot be resolved to URL because it does not exist

Swapnil,

When you run with mvn jetty:run, you don't have a WEB-INF/lib because
the webapp is not assembled. It looks like spring is expecting it to
exist. Perhaps your only option is to use mvn jetty:run-war instead,
which will assemble the webapp before running it. Alternatively,
update the version of the maven jetty plugin, as we have added support
for a virtual "WEB-INF/lib" in later versions that should work for
spring.

Jan

On 11 September 2014 19:47, Swapnil Raverkar <swapnil.raverkar@xxxxxxxxx> wrote:
> Hi All,
>
> Any help/pointers on this would be really helpful :
>
>
> I am getting following exception while deploying a war in jetty through mvn
> jetty:run
>
> java.io.FileNotFoundException: ServletContext resource [/WEB-INF/lib/]
> cannot be resolved to URL because it does not exist
>
>
> I am using Jetty : 9.1.5.v20140505
>
> RESTEasy : 3.0.7.Final
>
>
> The complete stacktrace is :
>
> 2014-09-11 02:39:05.236:INFO:/:main: Spring WebApplicationInitializers
> detected on classpath:
> [com.apple.ist.acss.ws.encoding.spring.EncodingServiceAppInitializer@623e0ec4]
>
> [INFO] EncodingServiceAppInitializer initialization complete
>
> 2014-09-11 02:39:05.720:INFO:/:main: Initializing log4j from
> [/Users/ctsuser1/acss_ws/ws-encoding/src/main/webapp/WEB-INF/log4j.properties]
>
> 2014-09-11 02:39:05.723:INFO:/:main: Initializing Spring root
> WebApplicationContext
>
> [INFO] Root WebApplicationContext: initialization started
>
> [INFO] Refreshing Root WebApplicationContext: startup date [Thu Sep 11
> 02:39:05 PDT 2014]; root of context hierarchy
>
> [INFO] Loading XML bean definitions from ServletContext resource
> [/WEB-INF/app-config.xml]
>
> [INFO] Loading XML bean definitions from ServletContext resource
> [/WEB-INF/acsecurity-cxf-config.xml]
>
> [INFO] Loading XML bean definitions from class path resource
> [META-INF/cxf/cxf.xml]
>
> [ERROR] Context initialization failed
>
> org.springframework.beans.factory.BeanDefinitionStoreException: Could not
> resolve bean definition resource pattern
> [/WEB-INF/lib/csws-core*.jar!/**/gcrmws-config.xml]; nested exception is
> java.io.FileNotFoundException: ServletContext resource [/WEB-INF/lib/]
> cannot be resolved to URL because it does not exist
>
> at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:228)
>
> 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
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540)
>
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
>
> at
> org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
>
> at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
>
> at
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
>
> at
> org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:800)
>
> at
> org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:446)
>
> at
> org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:792)
>
> at
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:296)
>
> at
> org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1359)
>
> at
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1352)
>
> at
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:744)
>
> at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:497)
>
> at
> org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:282)
>
> at
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>
> at
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:125)
>
> at
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:107)
>
> at
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
>
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:154)
>
> at
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>
> at
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:125)
>
> at
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:107)
>
> at
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
>
> at
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>
> at
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:125)
>
> at org.eclipse.jetty.server.Server.start(Server.java:358)
>
> at
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:107)
>
> at
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
>
> at org.eclipse.jetty.server.Server.doStart(Server.java:325)
>
> at org.eclipse.jetty.maven.plugin.JettyServer.doStart(JettyServer.java:68)
>
> at
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>
> at
> org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:564)
>
> at
> org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:360)
>
> at
> org.eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.java:168)
>
> at
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
>
> at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
>
> at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
>
> at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
>
> at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
>
> at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
>
> at
> org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
>
> at
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
>
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
>
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
>
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
>
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
>
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
> at java.lang.reflect.Method.invoke(Method.java:606)
>
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
>
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
>
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
>
> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
>
> Caused by: java.io.FileNotFoundException: ServletContext resource
> [/WEB-INF/lib/] cannot be resolved to URL because it does not exist
>
> at
> org.springframework.web.context.support.ServletContextResource.getURL(ServletContextResource.java:156)
>
> at
> org.springframework.core.io.support.PathMatchingResourcePatternResolver.isJarResource(PathMatchingResourcePatternResolver.java:417)
>
> at
> org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:346)
>
> at
> org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:284)
>
> at
> org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1170)
>
> at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:215)
>
> ... 59 more
>
>
>
> Thanks,
>
> Swapnil
>
>
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users



-- 
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
'Expert Jetty/CometD developer,production,operations advice'


Back to the top