如何将 root(/) 上下文中的 war 文件部署到 Wildfly 9.0.1 版 [英] How to deploy war file in root(/) context to Wildfly ver 9.0.1
问题描述
我是 Wildfly 的新手,直到现在我一直在使用 tomcat 来部署我的应用程序.现在只是为了添加 Wildfly 的功能,我们想继续这个.我使用的是 Windows 操作系统,我已经完成了 Wildfly 的基本实现以启动服务等,但无法部署 ROOT.war 来代替欢迎页面.我已经研究并浏览了很多链接,我在我的项目 WEB-INF 文件夹中添加了 jboss-web.xml,并在链接中添加了以下设置.但是我仍然无法在独立部署中部署 ROOT.war.每次都失败了.不明白我做错了什么.
I am newbie for Wildfly till now I was working on tomcat to deploy my applications. Now just for add on features of Wildfly we want to move on to this. I am using Windows Os, I have done with the basic implementation of wildfly to start service etc. but Unable to deploy the ROOT.war in place of Welcome page. I have studied and gone through lot of links, I added jboss-web.xml in my project WEB-INF folder with following settings as I got in links. But I am still unable to deploy the ROOT.war in standalone deployment. Each times it goes to failed. Not getting what I have done Wrong.
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.jboss.com/xml/ns/javaee
http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd">
<context-root>/</context-root>
</jboss-web>`
我已经创建了管理员用户,但是为了部署,我只使用了wildfly 用户设置.为此,我也取消了 bin/init.d wildfly.conf fly 中的字段的注释.但完全不知道错误.
I have made the admin user, But for deploying I am using wildfly user setting only. For it also I uncommented the fields from bin/init.d wildfly.conf fly. But totally unaware of the error.
注意:我们也在 linux 机器上尝试过,但 ROOT.war 也没有在那里部署.使用
Note: We also tried it on linux machine but ROOT.war is not getting deployed there too.used
推荐答案
在创建war文件之前必须在WEB-INF
文件夹中添加两个文件
Two files have to be added in WEB-INF
folder before creating a war file
jboss-web.xml
jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.jboss.com/xml/ns/javaee
http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd">
<context-root>/</context-root>
</jboss-web>
空 bean.xml
这篇关于如何将 root(/) 上下文中的 war 文件部署到 Wildfly 9.0.1 版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!