[英]Wildfly maven plugin not register web context
当我使用wildfly maven插件通过以下POM配置将java ee应用程序部署到我的wildfly 8.1.0独立Web应用程序服务器时:
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.0.2.Final</version>
<configuration>
<hostname>127.0.0.1</hostname>
<port>9991</port>
<username>root</username>
<password>manager</password>
</configuration>
</plugin>
如果我运行mvn wildfly:deploy,则应用程序已部署,并且我从服务器日志控制台收到了以下消息:
....
21:45:42,100 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "MyApp-0.0.1.war" (runtime-name: "MyApp-0.0.1.war")
21:45:42,819 INFO [org.wildfly.extension.undertow] (MSC service thread 1-7) JBAS017534: Registered web context: /MyApp-0.0.1
21:45:44,319 INFO [org.jboss.as.server] (management-handler-thread - 1) JBAS018562: Redeployed "MyApp-0.0.1.war"
....
如果我在POM的插件的配置部分中指定name参数,如下所示:
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.0.2.Final</version>
<configuration>
<hostname>127.0.0.1</hostname>
<port>9991</port>
<username>root</username>
<password>manager</password>
<name>WebApp</name>
</configuration>
</plugin>
应用程序已部署,但未指定Web上下文,如果我转到: http://127.0.0.1:8080/WebApp
: http://127.0.0.1:8080/WebApp
: http://127.0.0.1:8080/WebApp
服务器显示错误页面404! 使用此参数部署应用程序时,服务器控制台日志仅显示以下消息:
....
21:44:28,299 INFO [org.jboss.as.repository] (management-handler-thread - 1) JBAS014900: Content added at location D:\Wildfly\standalone\data\content\c0\e78f2599016bf33187b1049001b210040b829a\content
21:44:28,299 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "WebApp" (runtime-name: "WebApp")
21:44:28,705 INFO [org.jboss.as.server] (management-handler-thread - 1) JBAS018559: Redeployed "WebApp" (runtime-name : "WebApp")
....
为什么仅通过名称说明不注册Web上下文? 我可以在配置参数(例如应用程序名称)中指定Web上下文吗? 有人可以帮我吗?
我已经尝试过了,结果证明您必须将其设置为WebApp.war才能运行。
我个人更喜欢直接使用标记在该部分中设置名称,因为这很常见,您可以在其中省略文件扩展名。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.