Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Migrating Jetty 8 to 9: "No contexts"

Thanks. This is my last day before I'm on vacation for a while, but I'll check out those ideas as soon as I can.

On 5/6/14 4:50 PM, Joakim Erdfelt wrote:
Some tips ...

From:
http://www.eclipse.org/jetty/documentation/current/configuring-specific-webapp-deployment.html

Your XML context files should be in the ${jetty.base}/webapps/ directory.
(It appears you are still on the old-school method of modifying
${jetty.home}, might want to read up on the jetty.home vs jetty.base
split <http://www.eclipse.org/jetty/documentation/current/startup.html>,
it will make your life easier in the long run)
There were some fundamental behavioral nuances in the split between
/contexts/ and /webapps/ that confused many people, and resulted in
duplicate deployments of the same webapp in an overwhelming number of
cases, the 2 separate directories were merged together with some basic
basename logic to minimize the dual deployment issues that many had.

The XML file format has changed slightly (mainly just a new DTD
reference that *must* be updated), be sure you update your XML files.
If you have your *.war (or webapp directory) in the
${jetty.base}/webapps/ directory too, then make sure your XML file and
the basename of the webapp is the same (otherwise you'll have double
deployment).

Said another way...
    if you have in ${jetty.base}/webapps/
       search.war   <-- this is ignored, because search.xml exists)
       search.xml  <-- this is used
       admin.xml   <-- this is used
       webadmin.war  <-- this is deployed as the /webadmin context path
(even if admin.xml references it)
       mystatic/    <-- no WEB-INF/web.xml in here? then its a
deployment of static content to the "/mystatic" context path

Note: if you are using xml deployment descriptors, then you don't need
to have the war file in ${jetty.base}/webapps/ too.

To see what was actually deployed, set "jetty.dump.start=true" in your
${jetty.base}/start.ini and check your logging output, it will include
the server state tree (including all handlers + webapps).


--
Joakim Erdfelt <joakim@xxxxxxxxxxx <mailto:joakim@xxxxxxxxxxx>>
webtide.com <http://www.webtide.com/> - intalio.com/jetty
<http://intalio.com/jetty>
Expert advice, services and support from from the Jetty & CometD experts
eclipse.org/jetty <http://eclipse.org/jetty/> - cometd.org
<http://cometd.org/>


On Tue, May 6, 2014 at 12:39 PM, Gary McGath
<gmcgath@xxxxxxxxxxxxxxxxxxxx <mailto:gmcgath@xxxxxxxxxxxxxxxxxxxx>> wrote:

    I first posted this to Stack Overflow and didn't get any answers;
    hoping to get unstuck here.

    We have a working Jetty 8 environment (and the person who set it up
    is gone). I'm trying to get our applications running in a test Jetty
    9. Jetty starts up and writes to start.log, which informs me that
    stderr/stdout are being redirected to
    /opt/jetty/logs/2014_04_17.__stderrout.log. The latter file reports:

    2014-04-17 13:58:37.437:WARN:oejuc.__AbstractLifeCycle:main: FAILED
    org.eclipse.jetty.deploy.__DeploymentManager@7cddffbd:
    java.lang.__IllegalStateException: No Contexts
    java.lang.__IllegalStateException: No Contexts
             at
    org.eclipse.jetty.deploy.__DeploymentManager.doStart(__DeploymentManager.java:221)
             at
    org.eclipse.jetty.util.__component.AbstractLifeCycle.__start(AbstractLifeCycle.java:__68)
             at
    org.eclipse.jetty.util.__component.ContainerLifeCycle.__start(ContainerLifeCycle.java:__125)

    ...

    The old installation put context deployment descriptor files in
    /opt/jetty/contexts. The documentation for Jetty 9 appears to say
    they should go in /opt/jetty/webapps. $JETTY_HOME in my environment
    is /opt/jetty. I copied one of the deployment descriptor files to
    webapps, but the error message is the same. There's nothing to tell
    me where it's looking or why it failed.

    I put a deliberate XML error into the deployment descriptor file to
    see if that would affect anything, but it didn't, so Jetty may not
    even be reading the file.

    I'm running the Jetty launch script in debug mode, and echoing the
    command which launches it to the console (changing -b to -v to get
    more useful output), and here's the full output to the console:

    Reading /etc/default/jetty..
    START_INI      =  /opt/jetty/start.ini
    JETTY_HOME     =  /opt/jetty
    JETTY_BASE     =  /opt/jetty
    JETTY_CONF     =  /opt/jetty/etc/jetty.conf
    JETTY_PID      =  /var/run/jetty.pid
    JETTY_START    =  /opt/jetty/start.jar
    JETTY_ARGS     =  jetty-logging.xml jetty-started.xml
    JAVA_OPTIONS   =  -Djetty.state=/opt/jetty/__jetty.state
    -Djetty.logs=/opt/jetty/logs -Djetty.home=/opt/jetty
    -Djetty.base=/opt/jetty -Djava.io.tmpdir=/tmp
    JAVA           =  /usr/bin/java
    RUN_CMD        =  /usr/bin/java
    Starting Jetty: start-stop-daemon -S -p/var/run/jetty.pid -cjetty
    -d/opt/jetty -v -m -a /usr/bin/java --
    -Djetty.state=/opt/jetty/__jetty.state -Djetty.logs=/opt/jetty/logs
    -Djetty.home=/opt/jetty -Djetty.base=/opt/jetty
    -Djava.io.tmpdir=/tmp -jar /opt/jetty/start.jar jetty-logging.xml
    jetty-started.xml start-log-file=start.log
    Starting /usr/bin/java...
    Logging to /opt/jetty/start.log
    FAILED Thu Apr 17 13:58:41 EDT 2014


    Anyone have any ideas on what I'm doing wrong?



--
Gary McGath, Principal Software Engineer, Outcome Referrals
gmcgath@xxxxxxxxxxxxxxxxxxxx



Back to the top