Version: 9.4.27.v20200227 |

Metro
Previous | Chapter 29. Frameworks Home | Next

##### Contact the core Jetty developers at www.webtide.com

private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services for sponsored feature development

## Metro

Metro is the reference implementation for web services. You can easily use Metro with Jetty to integrate web services with your web applications.

### Metro Setup

1. Download the Metro distribution and unpack it to your disk. We’ll refer to the unpacked location as `$metro.home`.
2. Create the directory `$jetty.home/lib/metro`
3. Copy the jars from $metro.home/lib to `$jetty.home/lib/metro`

4. Edit the start.ini file and add an OPTION line for metro near the end.

       OPTIONS=metro

That’s all the setup you need to do to integrate Jetty and Metro.

Now read the Metro documentation on how to create web services. The Metro distribution you downloaded should also contain several example web applications in the $metro.home/samples directory that you can build and deploy to Jetty (simply by copying the war file produced by the build).

Here’s an example of the log output from Jetty when one of the sample Metro wars (from `$metro.home/samples/async`) is deployed to Jetty:

    [2093] java -jar start.jar

    2013-07-26 15:47:53.480:INFO:oejs.Server:main: jetty-9.0.4.v20130625
    2013-07-26 15:47:53.549:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/home/user/jetty-distribution-9.4.27.v20200227/webapps/] at interval 1
    Jul 26, 2013 3:47:53 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized
    INFO: WSSERVLET12: JAX-WS context listener initializing
    Jul 26, 2013 3:47:56 PM com.sun.xml.ws.server.MonitorBase createRoot
    INFO: Metro monitoring rootname successfully set to: com.sun.metro:pp=/,type=WSEndpoint,name=/metro-async-AddNumbersService-AddNumbersImplPort
    Jul 26, 2013 3:47:56 PM com.sun.xml.ws.transport.http.servlet.WSServletDelegate <init>
    INFO: WSSERVLET14: JAX-WS servlet initializing
    2013-07-26 15:47:56.800:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@75707c77{/metro-async,file:/tmp/jetty-0.0.0.0-8080-metro-async.war-_metro-async-any-/webapp/,AVAILABLE}{/metro-async.war}
    2013-07-26 15:47:56.853:INFO:oejs.ServerConnector:main: Started ServerConnector@47dce809{HTTP/1.1}{0.0.0.0:8080}

Previous | Top | Next
Weld | Home | Part V. Jetty Reference Guide

See an error or something missing? Contribute to this documentation at Github!(Generated: 2020-02-27)