Question

I'm trying to upgrade our jetty from 7 to 8 so that we can take advantage of servlet 3.0. It doesn't appear that any settings or configuration changes were made from 7 to 8. Previously we've been using jetty-maven-plugin 7.2.0.RC0 to mvn jetty:run (along with catalina 6.0.29, slf4j 1.5.9 and servlet 2.5). When updating jetty, I had to add in the slf4j, log4j and javax.servlet-api dependencies to the plugin so that there wouldn't be API problems. The catalina dependency has always been there. Here's the pom now:

  <plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>8.1.10.v20130312</version>
    <dependencies>
      <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>tomcat-catalina</artifactId>
        <version>7.0.37</version>
        <scope>compile</scope>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.2</version>
        <scope>compile</scope>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.7.2</version>
        <scope>compile</scope>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.7.2</version>
        <scope>compile</scope>
      </dependency>
      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.14</version>
        <scope>compile</scope>
      </dependency>
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>compile</scope>
      </dependency>
    </dependencies>
    <configuration>
      <webAppConfig>
        <contextPath>/widgets</contextPath>
        <baseResource implementation="org.eclipse.jetty.util.resource.ResourceCollection">
          <resourcesAsCSV>/Users/dwinsor/neo/neo-js/src/main/webapp,/Users/dwinsor/neo/neo-js/target/neo-js</resourcesAsCSV>
        </baseResource>
        <overrideDescriptor>/Users/dwinsor/neo/neo-js/target/generated-resources/xml/override-web-default.xml</overrideDescriptor>
      </webAppConfig>
      <contextHandlers>
        <contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
          <war>/Users/dwinsor/neo/neo-js/target/dependency-wars/neo.war</war>
          <contextPath>/</contextPath>
          <tempDirectory>/Users/dwinsor/neo/neo-js/target/tmp-neo</tempDirectory>
        </contextHandler>
      </contextHandlers>
      <scanTargets>
        <scanTarget>src/main/resources</scanTarget>
        <scanTarget>src/main/webapp</scanTarget>
      </scanTargets>
      <jettyConfig>/Users/dwinsor/neo/neo-js/target/generated-resources/xml/jetty.xml</jettyConfig>
      <connectors>
        <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
        </connector>
        <connector implementation="org.eclipse.jetty.server.ssl.SslSocketConnector">
        </connector>
      </connectors>
    </configuration>
  </plugin>

My problem is that I'm no longer seeing the kind of debug output that I expect to see. In jetty 7 when I did mvn jetty:run I'd see something like

org.mortbay.jetty.plugin.JettyServer@271bc503 STOPPED +-SelectChannelConnector@0.0.0.0:8080 +-SslSocketConnector@0.0.0.0:8443 +-qtp62871287{8<=5<=8/254,0} +-HandlerCollection@c237b89 started +-ContextHandlerCollection@6d836598 started | +-JettyWebAppContext@17043b2f@17043b2f/widgets,[file:/Users/dwinsor/previ ... ... [INFO] Started Jetty Server

Now, however, all I see is the last line, [INFO] Started Jetty Server. I want to be able to see all the pretty WebAppContext output. I've tried -Dorg.eclipse.jetty.util.log.DEBUG=true and -Dorg.eclipse.jetty.LEVEL=DEBUG, yet we weren't using either of these before anyways. How can I enable this output?

Thank you.

Was it helpful?

Solution

The problem was at jetty 7.3.0 the debug output seen is no longer printed out unless certain properties were set in jetty.xml:

<Set name="dumpAfterStart">true</Set>

<Set name="dumpBeforeStop">true</Set>

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top