Search code examples
jettyarchlinuxjetty-9

Jetty can't find web application file


I've installed jetty using PKGBUILD from AUR. The configuration was left default.

Note: since makepkg was unable to download jetty v.9.3.2 from offical site, I downloaded it from maven repository

The problem is that when I try to deploy my web application using Jetty Deployable Descriptor XML File, jetty fails to find the war with the following exception:

2016-01-27 17:05:30.265:WARN:oejw.WebInfConfiguration:main: Web application not found /home/pmitrofanov/sample.war
2016-01-27 17:05:30.265:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.w.WebAppContext@1efbd816{/sample,null,null}{/home/pmitrofanov/sample.war}
java.io.FileNotFoundException: /home/pmitrofanov/sample.war
    at org.eclipse.jetty.webapp.WebInfConfiguration.unpack(WebInfConfiguration.java:495)
    at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:72)
    at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:474)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:510)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41)
    at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:188)
    at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:499)
    at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:147)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)
    at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:459)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)
    at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:610)
    at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:529)
    at org.eclipse.jetty.util.Scanner.scan(Scanner.java:392)
    at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:313)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:150)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:561)
    at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:236)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:405)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:372)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1510)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1435)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.jetty.start.Main.invokeMain(Main.java:214)
    at org.eclipse.jetty.start.Main.start(Main.java:457)
    at org.eclipse.jetty.start.Main.main(Main.java:75)

Here is the contents of the xml:

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
    <Set name="contextPath">/sample</Set>
    <Set name="war">/home/pmitrofanov/sample.war</Set>
    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
    <!-- Max Form Size                                                   -->
    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
    <Set name="maxFormContentSize">5000000</Set>
</Configure>

It should be mentioned that:

  1. When I manually put the war into the webapps directory instead of using xml, everything goes fine.
  2. All users have rwx access to the war: -rwxrwxrwx 1 pmitrofanov pmitrofanov 25104375 Jan 27 16:37 /home/pmitrofanov/sample.war

Solution

  • The problem is that nobody except the owner has read+execute access to /home/pmitrofanov directory.