Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在JBoss7中部署war文件后无法查看主页_Jboss - Fatal编程技术网

在JBoss7中部署war文件后无法查看主页

在JBoss7中部署war文件后无法查看主页,jboss,Jboss,我使用Tomcat在本地成功运行了一个Struts2应用程序。我需要在JBoss7中部署该应用程序的war。这是我第一次尝试这个 将war文件放入路径“E:\jboss-as-7.1.1.Final\standalone\deployments”后,我可以在控制台中看到消息Deployed“MyApplication.war” 但是,在点击urlhttp://localhost:9990/,我收到404错误。 你能帮我找出我哪里做错了吗 注: 我在路径“E:\jboss as”中部署了MyA

我使用Tomcat在本地成功运行了一个Struts2应用程序。我需要在JBoss7中部署该应用程序的war。这是我第一次尝试这个

将war文件放入路径“E:\jboss-as-7.1.1.Final\standalone\deployments”后,我可以在控制台中看到消息
Deployed“MyApplication.war”

但是,在点击url
http://localhost:9990/
,我收到404错误。 你能帮我找出我哪里做错了吗

  • 注:
我在路径“E:\jboss as”中部署了MyApplication.war.deployed文件- 7.1.1.最终\独立\部署”

我在standalone.xml文件中有以下配置:

<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" auto-deploy-zipped="true" auto-deploy-exploded="false"/>

端口9990用于管理http而不是http

在standalone.xml中,http的默认值为8080

试试
http://localhost:8080/


仔细检查standalone.xml fot http端口。

正如另一个答案所述,在
JBoss 7.x
中,默认情况下,端口
9990
用于
管理http
,端口
8080
用于
http

最重要的是检查http和http ssl连接的
standalone.xml
配置文件中的
http
https
绑定中的端口

您可以在
standalone.xml
部分中找到,您可以根据自己的喜好修改端口,只要这些端口尚未使用,例如,我将端口
8088
用于http

然后您可以使用指定的端口调用您的应用程序,因此在您的情况下
http://localhost:8080/


...
...

在JBoss运行时部署您的war文件,并查看它是否会在部署时没有任何错误。有时在部署文件夹中已经有war的情况下启动Jboss会显示war已部署。您可能缺少一些配置调整。我可以在JBOSS控制台中看到我的应用程序。在命令行中,我可以看到下面的行。12:14:26322信息[org.jboss.web](服务器服务线程池--101)JBAS018210:注册web上下文:/Matix 12:14:28120信息[org.jboss.as.server](HttpManagementService threads-17)jbas018559:部署的“Matix.war”(运行时名称:“Matix.war”)如果我点击,什么都不会出现。您在standalone.xml中配置了端口9990吗?在
元素下是
http
的套接字绑定,如下所示
?正如您所知,此元素是您配置http/https端口的地方。或者只需检查此绑定下的端口并使用它即可。非常感谢!港口错了。应该是8080。事实上,当我点击“localhost:8080/”时,JBOSS主页出现了,点击管理控制台链接,它被重定向到9090端口,我认为这是我的应用程序需要点击的端口。但是,正如您所说,我检查了配置文件,发现http的端口是8080,然后当我点击url“localhost:8080/Matix/”时,我找到了我的应用程序的登录页面。多谢各位。
<socket-binding-group name="standard-sockets" default-interface="public" port offset="${jboss.socket.binding.port-offset:0}">
   ...
    <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
    <socket-binding name="ajp" port="8009"/>
    <socket-binding name="http" port="8080"/>
    <socket-binding name="https" port="8443"/>
    ...
</socket-binding-group>