我有一场战争想部署在Jetty上并运行。这是我在Eclipse-Maven上构建的angular-Java项目
这是我从战争中分离出来的战争内容(tourism-services.war)
如您所见,根据我在互联网上发现的帖子(并且没有留下任何痕迹),我将战争文件放在webapps目录下,并创建了一个带有旅游广告的webapps.demo目录, services.xml文件,如下所示
根据该帖子(Jetty Run War Using only command line),我运行以下命令
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
如您所见,我按照该页面的说明使用jetty-http.xml:https://www.eclipse.org/jetty/documentation/9.4.x/quick-start-configure.html
日志显示无错误。
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
但是却无济于事。我有三个问题
1)首先在Jetty文件夹中,没有与爆炸战争相对应的爆炸文件夹
2)当我在浏览器中查看http://localhost:8080/tourism-services地址时,什么都没有。这可能是由于缺少爆炸性应用程序以及
3)事实上,我可能必须使用以下命令启动角度应用程序-> ng serve --open在展开的文件夹(有index.html)下
嗨,我解决了我的一个问题:这是爆发战争的方式。
这是我做的事情:我在JETTY_HOME下创建了一个工作目录,然后再次运行java命令,然后在工作目录中获得了爆炸的战争
但是我不能开始有角度。我试图将自己放在index.html目录中,然后运行->'ng serve --open',但它告诉我找不到'angular.json'。可能与“从生产环境开始”与“从开发生产开始”有关
MBP-de-Admin:~ admin$ cd /Users/admin/Application-Marwen/Jetty/jetty-distribution-9.4.12.v20180830/work/jetty-0.0.0.0-8080-tourism-services.war-_tourism-services-any-
MBP-de-Admin:jetty-0.0.0.0-8080-tourism-services.war-_tourism-services-any- admin$ ng serve --open
Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found.
at WorkspaceLoader._getProjectWorkspaceFilePath (/usr/local/lib/node_modules/@angular/cli/models/workspace-loader.js:37:19)
at WorkspaceLoader.loadWorkspace (/usr/local/lib/node_modules/@angular/cli/models/workspace-loader.js:24:21)
at ServeCommand._loadWorkspaceAndArchitect (/usr/local/lib/node_modules/@angular/cli/models/architect-command.js:180:32)
at ServeCommand.<anonymous> (/usr/local/lib/node_modules/@angular/cli/models/architect-command.js:47:25)
at Generator.next (<anonymous>)
at /usr/local/lib/node_modules/@angular/cli/models/architect-command.js:7:71
at new Promise (<anonymous>)
at __awaiter (/usr/local/lib/node_modules/@angular/cli/models/architect-command.js:3:12)
at ServeCommand.initialize (/usr/local/lib/node_modules/@angular/cli/models/architect-command.js:46:16)
at Object.<anonymous> (/usr/local/lib/node_modules/@angular/cli/models/command-rMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMBMMMMMMMMMMMMMBMMMMMMBMMMBMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
我想要获得的是:在
中最简单地部署和运行Java + angular应用程序1)开发
2)在生产中