Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] deploy and run jetty OUTSIDE ECLIPSE for a war which consist of an angular-Java application

Hi Flamant,

To run jetty easily during development you can use the jetty maven plugin. The documentation on that is here:

To run jetty with the distribution, you should make a new base directory, and then configure that base directory with all of the modules that are needed to support your application. You should not use the top level directory in the distribution as you are doing (you haven't made a full base directory, you've just added another webapps directory).  The documentation on running in the distro is here:


On Thu, 27 Dec 2018 at 04:42, <flamant@xxxxxxxxxxxxxxxx> wrote:
As Jetty is supported by the Eclipse foundation, I post my question on this forum.
Firstly I want to do the following outside Eclipse :
I have a war that I want to deploy and run on Jetty. It is an angular-Java project that I built on Eclipse-Maven  
(see image1.png attached)

I have also downloaded Jetty 9 on my mac and here is a print screen of the hierarchy
(see image2.png attached)

As you can see, according to a post that I found on internet (and that I didn't keep a trace of), I put my war file under webapps directory and I created a webapps.demo directory with a tourism-services.xml file, which is the following
(see image3.png attached)

According to that post ([url][/url]), I run the following command
[code]MBP-de-Admin:.m2 admin$ cd /Users/admin/Application-Marwen/Jetty/jetty-distribution-9.4.12.v20180830
    MBP-de-Admin:jetty-distribution-9.4.12.v20180830 admin$ java -jar start.jar -Dwar.location=./webapps/tourism-services.war -DcontextPath=/tourism-services ./etc/jetty-http.xml[/code]

As you can see, I use jetty-http.xml following the instruction of that page : [/url][/url]

The logs shows no error :
[code]MBP-de-Admin:.m2 admin$ cd /Users/admin/Application-Marwen/Jetty/jetty-distribution-9.4.12.v20180830
MBP-de-Admin:jetty-distribution-9.4.12.v20180830 admin$ java -jar start.jar -Dwar.location=./webapps/tourism-services.war -DcontextPath=/tourism-services ./etc/jetty-http.xml
WARN  : System properties and/or JVM args set.  Consider using --dry-run or --exec
2018-12-19 19:31:21.730:INFO::main: Logging initialized @956ms to org.eclipse.jetty.util.log.StdErrLog
2018-12-19 19:31:22.065:WARN:oejs.HomeBaseWarning:main: This instance of Jetty is not running from a separate {jetty.base} directory, this is not recommended.  See documentation at
2018-12-19 19:31:22.148:INFO:oejs.Server:main: jetty-9.4.12.v20180830; built: 2018-08-30T13:59:14.071Z; git: 27208684755d94a92186989f695db2d7b21ebc51; jvm 1.8.0_131-b11
2018-12-19 19:31:22.180:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:///Users/admin/Application-Marwen/Jetty/jetty-distribution-9.4.12.v20180830/webapps/] at interval 1
2018-12-19 19:31:25.029:WARN:oeja.AnnotationParser:main: Unknown asm implementation version, assuming version 393216
2018-12-19 19:31:25.757:WARN:oeja.AnnotationParser:qtp705265961-15: org.terracotta.context.AbstractTreeNode scanned from multiple locations: jar:file:///private/var/folders/cj/18nnbwrn68v72gpfnc09tpl80000gn/T/jetty-!/org/terracotta/context/AbstractTreeNode.class, jar:file:///private/var/folders/cj/18nnbwrn68v72gpfnc09tpl80000gn/T/jetty-!/org/terracotta/context/AbstractTreeNode.class
2018-12-19 19:31:25.758:WARN:oeja.AnnotationParser:qtp705265961-15: org.terracotta.context.ContextCreationListener scanned from multiple locations: jar:file:///private/var/folders/cj/18nnbwrn68v72gpfnc09tpl80000gn/T/jetty-!/org/terracotta/context/ContextCreationListener.class, jar:file:///private/var/folders/cj/18nnbwrn68v72gpfnc09tpl80000gn/T/jetty-!/org/terracotta/context/ContextCreationListener.class
2018-12-19 19:31:25.758:WARN:oeja.AnnotationParser:qtp705265961-15: org.terracotta.context.ContextElement scanned from multiple locations: jar:file:///private/var/folders/cj/18nnbwrn68v72gpfnc09tpl80000gn/T/jetty-!/org/terracotta/context/ContextElement.class, jar:file:///private/var/folders/cj/18nnbwrn68v72gpfnc09tpl80000gn/T/jetty-!/org/terracotta/context/ContextElement.class
[main] DEBUG org.jboss.resteasy.cdi.i18n - RESTEASY010575: No CDI beans found for class org.jboss.resteasy.plugins.providers.multipart.MimeMultipartProvider. Using default ConstructorInjector.
19:31:30.199 [main] DEBUG org.jboss.resteasy.cdi.i18n - RESTEASY010575: No CDI beans found for class org.jboss.resteasy.plugins.providers.multipart.XopWithMultipartRelatedReader. Using default ConstructorInjector.
19:31:30.200 [main] DEBUG org.jboss.resteasy.cdi.i18n - RESTEASY010575: No CDI beans found for class org.jboss.resteasy.plugins.providers.multipart.XopWithMultipartRelatedWriter. Using default ConstructorInjector.
19:31:30.212 [main] INFO org.jboss.weld.environment.servletWeldServlet - WELD-ENV-001009: org.jboss.weld.environment.servlet.Listener used for ServletRequest and HttpSession notifications
2018-12-19 19:31:30.291:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@2758fe70{Archetype Created Web Application,/tourism-services,file:///private/var/folders/cj/18nnbwrn68v72gpfnc09tpl80000gn/T/jetty-,AVAILABLE}{/tourism-services.war}
2018-12-19 19:31:30.323:INFO:oejs.AbstractConnector:main: Started ServerConnector@e18d7ad{HTTP/1.1,[http/1.1]}{}
2018-12-19 19:31:30.323:INFO:oejs.Server:main: Started @9550ms[/code]

To get the exploded war, I created a work directory under JETTY_HOME and run again the java command, and I obtain the exploded war in the work directory
(see image4.png attached)

But when I look at [url]http://localhost:8080/tourism-services[/url]  or [url]http://localhost:8080/tourism-services/index.html[/url]  address in my browser, there is the following error displaying in my console :
[code] RESTEASY003210: Could not find resource for full path: http://localhost:8080/tourism-services/[index.html][/code]

What I want to obtain : deploy and run the most simply the java + angular application in

1) development

2) in production

jetty-users mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Jan Bartel <janb@xxxxxxxxxxx>
Expert assistance from the creators of Jetty and CometD

Back to the top