0

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.

Bob Kuhar
  • 10,838
  • 11
  • 62
  • 115
  • This has something to do with it: http://jira.codehaus.org/browse/JETTY-1531 . But the copyWebInf and copyWebDir properties it speaks of are nowhere to be found in the Jetty 8 WebAppProvider class. Argh. – Bob Kuhar Apr 09 '13 at 01:04
  • 2 days and, crickets. Google turns up nothing. The only Jetty documentation is for the case of "true". That makes for a less than useful parameter, no? – Bob Kuhar Apr 10 '13 at 20:27
  • The "!file:" part of the error message says that the URL doesn't start with "file://", which it doesn't. it starts with "jar:file:/". Not sure how this will help, but it at least translates the error message a bit. – Joakim Erdfelt Apr 10 '13 at 22:37

1 Answers1

3

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

Jan
  • 1,287
  • 7
  • 7
  • 1
    So I think you are saying that the only value that works is "true" and that all the previous Jetty's were lying to me, accepting my "false" setting, but extracting the WAR anyhow. I've kind of decided I don't care if it extracts it or not so I'm going with "true" as it stops the stacktraces and things seem to work. I must admit that I am underwhelmed at the Jetty documentation and have found the only way to figure out Jetty is to read the source code. Thanks again for your help. – Bob Kuhar Apr 11 '13 at 00:24