Skip to main content

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

There is no longer any distinction between the old "contexts dir" and the "webapps dir".
They are one in the same now.
See the 'monitoredDirName' property on the WebAppProvider.

https://www.eclipse.org/jetty/documentation/current/deployment-architecture.html#default-web-app-provider

This change was put in as the old mechanism was poorly understood and caused many duplicate deployments.
(Once from the raw WAR file and once again for the XML context, often on different contextPaths)


--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts


On Mon, Aug 25, 2014 at 2:50 PM, Austin Witt <witt.austin@xxxxxxxxx> wrote:
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.

_______________________________________________
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


Back to the top