Skip to main content
summaryrefslogtreecommitdiffstats
blob: f3beee2e889eb6071f1ad14ab3a1e5f21ff94217 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Managing Server Classpath</title><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><meta name="keywords" content="jetty, servlet, servlet-api, cometd, http, websocket, eclipse, maven, java, server, software"><link rel="home" href="index.html" title="Jetty : The Definitive Reference"><link rel="up" href="startup.html" title="Chapter&nbsp;9.&nbsp;Starting Jetty"><link rel="prev" href="startup-xml-config.html" title="Managing XML Based Startup Configuration"><link rel="next" href="startup-modules.html" title="Managing Startup Modules"><link xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" rel="shortcut icon" href="images/favicon.ico"><script type="text/javascript" src="js/shCore.js"></script><script type="text/javascript" src="js/shBrushJava.js"></script><script type="text/javascript" src="js/shBrushXml.js"></script><script type="text/javascript" src="js/shBrushBash.js"></script><script type="text/javascript" src="js/shBrushJScript.js"></script><script type="text/javascript" src="js/shBrushSql.js"></script><script type="text/javascript" src="js/shBrushProperties.js"></script><script type="text/javascript" src="js/shBrushPlain.js"></script><link type="text/css" rel="stylesheet" href="css/shCore.css"><link type="text/css" rel="stylesheet" href="css/shThemeEclipse.css"><link type="text/css" rel="stylesheet" href="css/font-awesome.min.css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><tr><td style="width: 25%"><a href="http://www.eclipse.org/jetty"><img src="images/jetty-header-logo.png" alt="Jetty Logo"></a><br><span style="font-size: small">
            Version: 9.3.1-SNAPSHOT</span></td><td style="width: 50%"><script type="text/javascript">  (function() {
            var cx = '016459005284625897022:obd4lsai2ds';
            var gcse = document.createElement('script');
            gcse.type = 'text/javascript';
            gcse.async = true;
            gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
            '//www.google.com/cse/cse.js?cx=' + cx;
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(gcse, s);
            })();
          </script><gcse:search></gcse:search></td></tr></table><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Managing Server Classpath</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="startup-xml-config.html"><i class="icon-chevron-left"></i> Previous</a>&nbsp;</td><th width="60%" align="center">Chapter&nbsp;9.&nbsp;Starting Jetty<br><a accesskey="p" href="index.html"><i class="icon-home"></i> Home</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="startup-modules.html">Next <i class="icon-chevron-right"></i></a></td></tr></table><hr></div><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="jetty-callout"><h5 class="callout"><a href="http://www.webtide.com/">Contact the core Jetty developers at
          <span class="website">www.webtide.com</span></a></h5><p>
 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 from 1 day to full product delivery
      </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="startup-classpath"></a>Managing Server Classpath</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="startup-classpath.html#d0e7770">Interrogating the Server Classpath</a></span></dt></dl></div><p>Jetty Server Classpath is determined by a combination of
  factors.</p><div class="variablelist"><dl><dt><span class="term">The java.class.path System Property</span></dt><dd><p>If you start Jetty with a JVM specified classpath, then Jetty
        will use the java.class.path System Property to populate the
        initial classpath.</p></dd><dt><span class="term">Module specified Libraries</span></dt><dd><p>With Jetty 9.1+ the module system declares various libraries
        that are required for that module to operate, these module defined
        libraries are added to the Jetty Server classpath when any module is
        activated with library declarations.</p></dd><dt><span class="term">Command Line Libraries</span></dt><dd><p>The command line option <code class="literal">--lib=&lt;path&gt;</code>can
        be used as a final means to add arbitrary entries to the Jetty Server
        classpath.</p></dd></dl></div><p>Of special note, there are 2 structural modules defined to ease some
  of this for you.</p><div class="variablelist"><dl><dt><span class="term">--module=ext</span></dt><dd><p>The <code class="literal">ext</code> module will enable the
        <code class="filename">lib/ext/*.jar</code> logic.</p><p>If this module is activated, then all jar files found in the
        lib/ext/ paths will be automatically added to the Jetty Server
        Classpath.</p></dd><dt><span class="term">--module=resources</span></dt><dd><p>The <code class="literal">resources</code> module will add the
        <code class="filename">resources/</code> directory the classpath.</p><p>If you have 3rd party libraries that lookup resources from the
        classpath, put your files in here.</p><p>Logging libraries often have classpath lookup of their
        configuration files (eg: <code class="filename">log4j.properties</code>,
        <code class="filename">log4j.xml</code>,
        <code class="filename">logging.properties</code>, and
        <code class="filename">logback.xml</code>), so this would be the ideal setup
        for this sort of configuration demand.</p></dd></dl></div><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><i class="icon-asterisk"></i> Note</h3><p>Both the <code class="literal">ext</code> and <code class="literal">resources</code>
    modules declare relative paths that follow <a class="link" href="startup-base-and-home.html#base-vs-home-resolution" title="Configuration Resolution Rules">Jetty Base and Jetty Home path
    resolution rules</a>.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="d0e7770"></a>Interrogating the Server Classpath</h3></div></div></div><p>The Jetty start.jar has the ability to resolve the classpath from
    the command line + modules + configuration, and list the classpath entries
    it will use to start jetty.</p><p>The <code class="literal">--list-classpath</code> command line option is used
    as such.</p><p>(Demonstrated with the <a class="link" href="startup-base-and-home.html#demo-base" title="Demo-Base in the Jetty Distribution">demo-base from the
    Jetty Distribution</a>)</p><div class="screenexample"><pre class="screen">[demo-base]$ java -jar $JETTY_HOME/start.jar --list-classpath

Jetty Server Classpath:
-----------------------
Version Information on 42 entries in the classpath.
Note: order presented here is how they would appear on the classpath.
      changes to the --module=name command line options will be reflected here.
 0:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-client-9.3.1-SNAPSHOT.jar
 1:      1.4.1.v201005082020 | ${jetty.base}/lib/ext/javax.mail.glassfish-1.4.1.v201005082020.jar
 2:               9.3.1-SNAPSHOT | ${jetty.base}/lib/ext/test-mock-resources-9.3.1-SNAPSHOT.jar
 3:                    (dir) | ${jetty.home}/resources
 4:                    3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
 5:                  3.1.RC0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
 6:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-http-9.3.1-SNAPSHOT.jar
 7:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-continuation-9.3.1-SNAPSHOT.jar
 8:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-server-9.3.1-SNAPSHOT.jar
 9:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-xml-9.3.1-SNAPSHOT.jar
10:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-util-9.3.1-SNAPSHOT.jar
11:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-io-9.3.1-SNAPSHOT.jar
12:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-jaas-9.3.1-SNAPSHOT.jar
13:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-jndi-9.3.1-SNAPSHOT.jar
14:      1.1.0.v201105071233 | ${jetty.home}/lib/jndi/javax.activation-1.1.0.v201105071233.jar
15:      1.4.1.v201005082020 | ${jetty.home}/lib/jndi/javax.mail.glassfish-1.4.1.v201005082020.jar
16:                      1.2 | ${jetty.home}/lib/jndi/javax.transaction-api-1.2.jar
17:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-rewrite-9.3.1-SNAPSHOT.jar
18:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-security-9.3.1-SNAPSHOT.jar
19:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-servlet-9.3.1-SNAPSHOT.jar
20:                    3.0.0 | ${jetty.home}/lib/jsp/javax.el-3.0.0.jar
21:      1.2.0.v201105211821 | ${jetty.home}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar
22:                    2.3.2 | ${jetty.home}/lib/jsp/javax.servlet.jsp-2.3.2.jar
23:                    2.3.1 | ${jetty.home}/lib/jsp/javax.servlet.jsp-api-2.3.1.jar
24:                    2.3.3 | ${jetty.home}/lib/jsp/jetty-jsp-jdt-2.3.3.jar
25:      1.2.0.v201112081803 | ${jetty.home}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar
26:   3.8.2.v20130121-145325 | ${jetty.home}/lib/jsp/org.eclipse.jdt.core-3.8.2.v20130121.jar
27:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-plus-9.3.1-SNAPSHOT.jar
28:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-webapp-9.3.1-SNAPSHOT.jar
29:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-annotations-9.3.1-SNAPSHOT.jar
30:                      4.1 | ${jetty.home}/lib/annotations/asm-4.1.jar
31:                      4.1 | ${jetty.home}/lib/annotations/asm-commons-4.1.jar
32:                      1.2 | ${jetty.home}/lib/annotations/javax.annotation-api-1.2.jar
33:               9.3.1-SNAPSHOT | ${jetty.home}/lib/jetty-deploy-9.3.1-SNAPSHOT.jar
34:                      1.0 | ${jetty.home}/lib/websocket/javax.websocket-api-1.0.jar
35:               9.3.1-SNAPSHOT | ${jetty.home}/lib/websocket/javax-websocket-client-impl-9.3.1-SNAPSHOT.jar
36:               9.3.1-SNAPSHOT | ${jetty.home}/lib/websocket/javax-websocket-server-impl-9.3.1-SNAPSHOT.jar
37:               9.3.1-SNAPSHOT | ${jetty.home}/lib/websocket/websocket-api-9.3.1-SNAPSHOT.jar
38:               9.3.1-SNAPSHOT | ${jetty.home}/lib/websocket/websocket-client-9.3.1-SNAPSHOT.jar
39:               9.3.1-SNAPSHOT | ${jetty.home}/lib/websocket/websocket-common-9.3.1-SNAPSHOT.jar
40:               9.3.1-SNAPSHOT | ${jetty.home}/lib/websocket/websocket-server-9.3.1-SNAPSHOT.jar
41:               9.3.1-SNAPSHOT | ${jetty.home}/lib/websocket/websocket-servlet-9.3.1-SNAPSHOT.jar
</pre></div><p>Of note is that an attempt is made to list the internally declared
    version of each artifact on the Server Classpath, of potential help when
    diagnosing classpath issues.</p></div></div><script type="text/javascript">
      SyntaxHighlighter.all()
    </script><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="startup-xml-config.html"><i class="icon-chevron-left"></i> Previous</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="startup.html"><i class="icon-chevron-up"></i> Top</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="startup-modules.html">Next <i class="icon-chevron-right"></i></a></td></tr><tr><td width="40%" align="left" valign="top">Managing XML Based Startup Configuration&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html"><i class="icon-home"></i> Home</a></td><td width="40%" align="right" valign="top">&nbsp;Managing Startup Modules</td></tr></table></div><p xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><div class="jetty-callout">
            See an error or something missing?
            <span class="callout"><a href="http://github.com/jetty-project/jetty-documentation">Contribute to this documentation at
                <span class="website"><i class="icon-github"></i> Github!</span></a></span><span style="float: right"><i>(Generated: 2015-11-23T01:01:12+00:00)</i></span></div></p><script xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1149868-7']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
    </script></body></html>

Back to the top