Search code examples
jettyjetty-8

I can't get Jetty8 etc/jetty-webapps.xml extractWars="false" to work


I am migrating my application from Jetty 7 to Jetty 8 and it is not going so well. The battle is currently at etc/jetty-webapps.xml. Prior to this migration, our configuration always set this value to "false"

<Configure id="Server" class="org.eclipse.jetty.server.Server">
  <Ref id="DeploymentManager">
    <Call id="webappprovider" name="addAppProvider">
      <Arg>
        <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
          <Set name="monitoredDirName"><Property name="jetty.home" default="." />/webapps</Set>
          <Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set>
          <Set name="scanInterval">1</Set>
          <Set name="contextXmlDir"><Property name="jetty.home" default="." />/contexts</Set>
          <Set name="extractWars">false</Set>
        </New>
      </Arg>
    </Call>
  </Ref>

When I try to bin/jetty.sh start with this value set to "false" Jetty spews exceptions like...

2013-04-08 17:33:03.380:INFO:oejd.DeploymentManager:Deployable added: /Users/bobk/work/workspace/DM_Server/build/distributions/device-management-1.6.5-DEVELOP-dev/webapps/root.war
2013-04-08 17:33:04.526:WARN:oejw.WebAppClassLoader:EXCEPTION 
java.lang.IllegalArgumentException: !file: jar:file:/Users/bobk/work/workspace/DM_Server/build/distributions/device-management-1.6.5-DEVELOP-dev/webapps/root.war!/WEB-INF/lib/guava-14.0.1.jar
    at org.eclipse.jetty.webapp.WebAppClassLoader.addClassPath(WebAppClassLoader.java:245)
    at org.eclipse.jetty.webapp.WebAppClassLoader.addJars(WebAppClassLoader.java:282)
    blah...blah...blah...

...for each and every Jar file in my WAR's WEB-INF/lib directory. I can get jetty.sh start to successfully load my webapp if I change the value of extractWars in etc/jetty-webapps.xml from "false" to "true". Like I said, though, this value has been "false" ever since Jetty 6 and it is frustrating that it no longer works.

Is "false" even a legitimate setting any more? If it is, what else do I have to set, unset, include in the etc/ directory, jetty.conf, or start.ini file to get this to work?

Any help is greatly appreciated.


Solution

  • Bob,

    The bug tracker and all doco for jetty-7,8 and 9 is found over at Eclipse, here: http://www.eclipse.org/jetty/

    IIRC, in jetty-6, despite having extractWar set to false, under-the-covers jetty was extracting and copying the WEB-INF directory to overcome issues under windows with hot redeployment. So even if you thought you weren't extracting the full war, at least part of it was anyway.

    With jetty-7,8,9 we obey the settings of extractWar, copyWebInf, copyWebDir precisely. The default is to extract - each iteration of the servlet spec has encouraged extraction as there are more an more features that really work best on an unpacked war.

    Jan