Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Jetty7 to Jetty9 migration: What happened to WebAppProvider's contextXmlDir property?

I am migrating a Jetty7 application and associated Jetty configuration to Jetty9.2.2

Previously, I had a DeploymentManager:

====================
<Ref id="DeploymentManager">
  <Call id="webappprovider" name="addAppProvider">
    <Arg>
      <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
        <Set name="monitoredDirName">/conf</Set>
        <Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set>
        <Set name="contextXmlDir">/conf/jetty-contexts</Set>
      </New>
    </Arg>
  </Call>
</Ref>

====================

And in the /conf/jetty-contexts folder, a "context.xml" file that contained the <Configure class="org.eclipse.jetty.webapp.WebAppContext">...</Configure> block.

Directory structure (with some folders and much depth elided for brevity):

====================
test-project-please-ignore/
├── logs/
├── ops/
└── server/
    ├── bin/
    ├── conf/
    │   ├── jetty-contexts/
    │   │   └── context.xml
    │   ├── jetty-contexts.xml
    │   ├── jetty-deploy.xml
    │   ├── jetty-jmx.xml
    │   ├── jetty-logging.xml
    │   ├── jetty.java.command.line.args.generated.txt
    │   ├── jetty.maxQueued.xml
    │   ├── jetty.start.config
    │   ├── jetty.webdefault.xml
    │   ├── jetty.xml
    │   ├── logback-access.xml
    │   └── wrapper.conf
    ├── info/
    │   └── version.properties
    ├── lib/
    ├── test-project-please-ignore
    │   ├── META-INF/
    │   └── WEB-INF/
    │       ├── classes
    │       │   ├── META-INF/
    │       │   ├── com/
    │       │   ├── env/
    │       ├── dispatch-servlet.xml
    │       ├── lib/
    │       ├── views/
    │       └── web.xml
    ├── wars/
    │   └── test-project-please-ignore.war
    └── webapps
        └── test-project-please-ignore.war
====================

In Jetty9, it appears that there is no "contextXmlDir" on the WebAppProvider. The closest I can find is this documentation page: http://www.eclipse.org/jetty/documentation/current/configuring-contexts.html#using-the-webapp-provider which mentions that I can set the "contextPath" on a WebAppContext if I am using the WebAppProvider. But how do I tell the WebAppProvider about my WebAppContexts, which are in (were in?) the contextXmlDir that is no longer a property I can set?

As a sanity check, I commented-out the contextXmlDir line and sure enough, Jetty started up but informed me when I tried to access my webapp that it couldn't find any contexts that mapped to my request - just as I'd expect since there was now no configuration telling Jetty about my web application contexts.

With all that context out of the way, my question is as in the title: What happened to Jetty7's WebAppProvider's contextXmlDir property in Jetty9, and how do I accomplish the same thing?

Thank you for your time, and please let me know if I need to provide additional information.

Back to the top