Jetty9 - Jetty does not start from a separate {jetty.base}

I see the following warning when starting the jetty9 server as a service. I have no idea about this.

WARN: oejs.HomeBaseWarning: main: This Jetty instance does not start from a separate directory {jetty.base}, this is not recommended. See the documentation at http://www.eclipse.org/jetty/documentation/current/startup.html

+3


source to share


1 answer


Jetty recommends that you launch Jetty instances not from the jetty.home distribution folder directly, but from the jetty.base folder, which must be defined separately

1. In the chapter Declaring a Jetty Base :

http://www.eclipse.org/jetty/documentation/current/startup-base-and-home.html

The Jetty distribution start.jar is the component that controls the behavior of this split.

Jetty start.jar and XML files always assume that both $ {jetty.home} and $ {jetty.base} are defined when Jetty starts.

You can manually define $ {jetty.home} and $ {jetty.base} directories such as:

 [jetty-distribution-9.3.7.v20160115]$ pwd
 /home/user/jetty-distribution-9.3.7.v20160115
 [jetty-distribution-9.3.7.v20160115]$ java -jar start.jar \
     jetty.home=/home/user/jetty-distribution-9.3.7.v20160115 \
     jetty.base=/home/user/my-base 2013-10-16 09:08:47.802:INFO:oejs.Server:main: jetty-9.3.7.v20160115 2013-10-16
 09:08:47.817:INFO:oejdp.ScanningAppProvider:main: Deployment monitor
 [file:/home/user/my-base/webapps/] at interval 1 ...

      

Or you can declare one directory and open another.

The following example uses the default $ {jetty.home} discovery, using the parent directory wherever the .jar starts, and the $ {jetty.base} manual declaration.

 [jetty-distribution-9.3.7.v20160115]$ pwd
 /home/user/jetty-distribution-9.3.7.v20160115
 [jetty-distribution-9.3.7.v20160115]$ java -jar start.jar
 jetty.base=/home/user/my-base 2013-10-16
 09:08:47.802:INFO:oejs.Server:main: jetty-9.3.7.v20160115 2013-10-16
 09:08:47.817:INFO:oejdp.ScanningAppProvider:main: Deployment monitor
 [file:/home/user/my-base/webapps/] at interval 1 ...

      



But Jetty recommends that you always start Jetty by sitting in the directory that is your $ {jetty.base} and starting Jetty by linking start.jar remotely.

2. ... and Create a new Jetty Base here:

http://www.eclipse.org/jetty/documentation/current/quickstart-running-jetty.html

The demo base directory above is an example Jetty 9.1 adds the jetty.base mechanism. The base of the berth allows the configuration and web application of the server instance to be kept separate from the berth allocation so that it can be upgraded with minimal disruption. Jetty's default configuration is based on two properties: jetty.home Property that defines the location of the jetty distribution, its libraries, default modules, and default XML files (usually start.jar, lib, etc.) jetty.base Property that defines the location of a specific jetty server instance, its configuration, logs and web applications (usually start.ini, start.d, logs and webapps) The jetty.home and jetty.base properties can be explicitly set on the command line, or they can be output from Wednesday,if used with commands such as:

 cd $JETTY_BASE
 java -jar $JETTY_HOME/start.jar

      

The following commands: create a new base directory; Includes an HTTP connector and web application deployer; copies the demo webapp to be deployed:

 JETTY_BASE=/tmp/mybase
 mkdir $JETTY_BASE
 cd $JETTY_BASE
 java -jar $JETTY_HOME/start.jar
WARNING: Nothing to start, exiting ...

Usage: java -jar start.jar [options] [properties] [configs]
       java -jar start.jar --help  # for more information

> java -jar $JETTY_HOME/start.jar --add-to-startd=http,deploy
INFO: server          initialised (transitively) in ${jetty.base}/start.d/server.ini
INFO: http            initialised in ${jetty.base}/start.d/http.ini
INFO: security        initialised (transitively) in ${jetty.base}/start.d/security.ini
INFO: servlet         initialised (transitively) in ${jetty.base}/start.d/servlet.ini
INFO: webapp          initialised (transitively) in ${jetty.base}/start.d/webapp.ini
INFO: deploy          initialised in ${jetty.base}/start.d/deploy.ini
MKDIR: ${jetty.base}/webapps
INFO: Base directory was modified
> cp $JETTY_HOME/demo-base/webapps/async-rest.war webapps/ROOT.war
> java -jar $JETTY_HOME/start.jar
2015-06-04 11:10:16.286:INFO::main: Logging initialized @274ms
2015-06-04 11:10:16.440:INFO:oejs.Server:main: jetty-9.3.0.v20150601
2015-06-04 11:10:16.460:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:///tmp/mybase/webapps/] at interval 1
2015-06-04 11:10:16.581:WARN::main: async-rest webapp is deployed. DO NOT USE IN PRODUCTION!
2015-06-04 11:10:16.589:INFO:oejw.StandardDescriptorProcessor:main: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2015-06-04 11:10:16.628:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@1a407d53{/,[file:///tmp/jetty-0.0.0.0-8080-ROOT.war-_-any-4510228025526425427.dir/webapp/, jar:file:///tmp/jetty-0.0.0.0-8080-ROOT.war-_-any-4510228025526425427.dir/webapp/WEB-INF/lib/example-async-rest-jar-9.3.0.v20150601.jar!/META-INF/resources],AVAILABLE}{/ROOT.war}
2015-06-04 11:10:16.645:INFO:oejs.ServerConnector:main: Started ServerConnector@3abbfa04{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
2015-06-04 11:10:16.646:INFO:oejs.Server:main: Started @634ms

      

+3


source







All Articles