deploy and run jetty OUTSIDE ECLIPSE for a war which consist of an angular-Java application

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

deploy and run jetty OUTSIDE ECLIPSE for a war which consist of an angular-Java application

flamant
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]https://stackoverflow.com/questions/3623412/jetty-run-war-using-only-command-line#answer-4744119[/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]https://www.eclipse.org/jetty/documentation/9.4.x/quick-start-configure.html[/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 http://www.eclipse.org/jetty/documentation/current/startup.html
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-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/WEB-INF/lib/ehcache-3.5.2.jar!/org/terracotta/context/AbstractTreeNode.class, jar:file:///private/var/folders/cj/18nnbwrn68v72gpfnc09tpl80000gn/T/jetty-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/WEB-INF/lib/ehcache-2.10.3.jar!/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-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/WEB-INF/lib/ehcache-3.5.2.jar!/org/terracotta/context/ContextCreationListener.class, jar:file:///private/var/folders/cj/18nnbwrn68v72gpfnc09tpl80000gn/T/jetty-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/WEB-INF/lib/ehcache-2.10.3.jar!/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-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/WEB-INF/lib/ehcache-3.5.2.jar!/org/terracotta/context/ContextElement.class, jar:file:///private/var/folders/cj/18nnbwrn68v72gpfnc09tpl80000gn/T/jetty-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/WEB-INF/lib/ehcache-2.10.3.jar!/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-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/,AVAILABLE}{/tourism-services.war}
2018-12-19 19:31:30.323:INFO:oejs.AbstractConnector:main: Started ServerConnector@e18d7ad{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
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]javax.ws.rs.NotFoundException: 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
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: deploy and run jetty OUTSIDE ECLIPSE for a war which consist of an angular-Java application

Jan Bartel
Hi Flamant,

To run jetty easily during development you can use the jetty maven plugin. The documentation on that is here: https://www.eclipse.org/jetty/documentation/9.4.14.v20181114/maven-and-jetty.html

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: https://www.eclipse.org/jetty/documentation/9.4.14.v20181114/quickstart-common-config.html

regards,
Jan

On Thu, 27 Dec 2018 at 04:42, <[hidden email]> 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]https://stackoverflow.com/questions/3623412/jetty-run-war-using-only-command-line#answer-4744119[/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]https://www.eclipse.org/jetty/documentation/9.4.x/quick-start-configure.html[/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 http://www.eclipse.org/jetty/documentation/current/startup.html
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-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/WEB-INF/lib/ehcache-3.5.2.jar!/org/terracotta/context/AbstractTreeNode.class, jar:file:///private/var/folders/cj/18nnbwrn68v72gpfnc09tpl80000gn/T/jetty-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/WEB-INF/lib/ehcache-2.10.3.jar!/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-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/WEB-INF/lib/ehcache-3.5.2.jar!/org/terracotta/context/ContextCreationListener.class, jar:file:///private/var/folders/cj/18nnbwrn68v72gpfnc09tpl80000gn/T/jetty-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/WEB-INF/lib/ehcache-2.10.3.jar!/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-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/WEB-INF/lib/ehcache-3.5.2.jar!/org/terracotta/context/ContextElement.class, jar:file:///private/var/folders/cj/18nnbwrn68v72gpfnc09tpl80000gn/T/jetty-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/WEB-INF/lib/ehcache-2.10.3.jar!/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-0.0.0.0-8080-tourism-services.war-_tourism-services-any-8018000225900899231.dir/webapp/,AVAILABLE}{/tourism-services.war}
2018-12-19 19:31:30.323:INFO:oejs.AbstractConnector:main: Started ServerConnector@e18d7ad{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
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]javax.ws.rs.NotFoundException: 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
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users


--
Jan Bartel <[hidden email]>
www.webtide.com
Expert assistance from the creators of Jetty and CometD


_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users