无法访问 JBoss AS7 中已部署的 HelloWorld 应用程序
我正在使用一个简单的 HelloWorld 应用程序尝试 JBoss AS 7。
- HelloWorld 应用程序文件夹有一个简单的
hello.jsp
文件。 - 部署将
HelloWorld.war
复制到jboss7.0.1\standalone\deployments
文件夹。 - 之后,我从 HelloWorld 文件夹启动
jboss.cmd
来启动应用程序 - 如果我访问 URL http://localhost:8080/HelloWorld/hello.jsp,我收到 Internet Explorer 无法显示网页 错误
我能够通过 http://localhost:9990/console 通常,但我不明白为什么我无法访问上述内容网址。
这是 JBoss 标准输出:
===============================================================================
16:17:23,921 INFO [org.jboss.modules] (main) JBoss Modules version 1.0.1.GA
16:17:24,218 INFO [org.jboss.as.process.Host Controller.status] (main) Starting process 'Host Controller'
[Host Controller] 16:17:24,671 INFO [org.jboss.modules] (main) JBoss Modules version 1.0.1.GA
[Host Controller] 16:17:25,031 INFO [org.jboss.msc] (main) JBoss MSC version 1.0.0.GA
[Host Controller] 16:17:25,421 INFO [org.jboss.remoting] (MSC service thread 1-7) JBoss Remoting version 3.2.
0.Beta2
[Host Controller] 16:17:25,437 INFO [org.xnio] (MSC service thread 1-7) XNIO Version 3.0.0.Beta3
[Host Controller] 16:17:25,453 INFO [org.xnio.nio] (MSC service thread 1-7) XNIO NIO Implementation Version 3
.0.0.Beta3
[Host Controller] 16:17:26,593 WARN [org.jboss.as] (Controller Boot Thread) No security realm defined for nat
ive management service, all access will be unrestricted.
[Host Controller] 16:17:26,593 INFO [org.jboss.as] (Controller Boot Thread) creating http management service
using network interface (management) port (9990)
[Host Controller] 16:17:26,593 WARN [org.jboss.as] (Controller Boot Thread) No security realm defined for htt
p management service, all access will be unrestricted.
[Host Controller] 16:17:26,687 INFO [org.jboss.as.remoting] (MSC service thread 1-1) Listening on /127.0.0.1:
9999
[Host Controller] 16:17:26,703 INFO [org.jboss.as.host.controller] (Controller Boot Thread) Starting server s
erver-one
16:17:26,718 INFO [org.jboss.as.process.Server:server-one.status] (ProcessController-threads - 3) Starting pr
ocess 'Server:server-one'
[Host Controller] 16:17:26,796 INFO [org.jboss.as.host.controller] (Controller Boot Thread) Starting server s
erver-two
[Server:server-one] 16:17:27,093 INFO [org.jboss.modules] (main) JBoss Modules version 1.0.1.GA
16:17:27,468 INFO [org.jboss.as.process.Server:server-two.status] (ProcessController-threads - 3) Starting pr
ocess 'Server:server-two'
[Server:server-one] 16:17:27,484 INFO [org.jboss.msc] (main) JBoss MSC version 1.0.0.GA
[Server:server-one] 16:17:27,562 INFO [org.jboss.as] (MSC service thread 1-3) JBoss AS 7.0.1.Final "Zap" star
ting
[Server:server-two] 16:17:27,828 INFO [org.jboss.modules] (main) JBoss Modules version 1.0.1.GA
[Server:server-two] 16:17:28,218 INFO [org.jboss.msc] (main) JBoss MSC version 1.0.0.GA
[Server:server-two] 16:17:28,296 INFO [org.jboss.as] (MSC service thread 1-4) JBoss AS 7.0.1.Final "Zap" star
ting
[Server:server-one] 16:17:28,328 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-8
) The Apache Tomcat Native library which allows optimal performance in production environments was not found o
n the java.library.path: C:\Program Files\Java\jdk1.6.0_26\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\
WINDOWS;C:\Program Files\Java\jdk1.6.0_26\bin;C:\Program Files\Java\jdk1.6.0_26\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Python27;.
[Server:server-two] 16:17:29,109 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-2
) The Apache Tomcat Native library which allows optimal performance in production environments was not found o
n the java.library.path: C:\Program Files\Java\jdk1.6.0_26\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\
WINDOWS;C:\Program Files\Java\jdk1.6.0_26\bin;C:\Program Files\Java\jdk1.6.0_26\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Python27;.
[Server:server-two] 16:17:29,156 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-8) Star
ting Coyote HTTP/1.1 on http--127.0.0.1-8230
当我检查控制台时,我发现没有服务器启动;我不确定这是否是问题所在。
I am trying out JBoss AS 7 with a simple HelloWorld application.
- The HelloWorld application folder has a simple
hello.jsp
file. - The deploy copies the
HelloWorld.war
to thejboss7.0.1\standalone\deployments
folder. - After this I start the
jboss.cmd
from the HelloWorld folder to start the application - If I access the URL http://localhost:8080/HelloWorld/hello.jsp, I get the Internet Explorer cannot display the webpage error
I am able to access the Admin console at http://localhost:9990/console normally, but I can't see why I am not able to access the above URL.
Here is the JBoss stdout:
===============================================================================
16:17:23,921 INFO [org.jboss.modules] (main) JBoss Modules version 1.0.1.GA
16:17:24,218 INFO [org.jboss.as.process.Host Controller.status] (main) Starting process 'Host Controller'
[Host Controller] 16:17:24,671 INFO [org.jboss.modules] (main) JBoss Modules version 1.0.1.GA
[Host Controller] 16:17:25,031 INFO [org.jboss.msc] (main) JBoss MSC version 1.0.0.GA
[Host Controller] 16:17:25,421 INFO [org.jboss.remoting] (MSC service thread 1-7) JBoss Remoting version 3.2.
0.Beta2
[Host Controller] 16:17:25,437 INFO [org.xnio] (MSC service thread 1-7) XNIO Version 3.0.0.Beta3
[Host Controller] 16:17:25,453 INFO [org.xnio.nio] (MSC service thread 1-7) XNIO NIO Implementation Version 3
.0.0.Beta3
[Host Controller] 16:17:26,593 WARN [org.jboss.as] (Controller Boot Thread) No security realm defined for nat
ive management service, all access will be unrestricted.
[Host Controller] 16:17:26,593 INFO [org.jboss.as] (Controller Boot Thread) creating http management service
using network interface (management) port (9990)
[Host Controller] 16:17:26,593 WARN [org.jboss.as] (Controller Boot Thread) No security realm defined for htt
p management service, all access will be unrestricted.
[Host Controller] 16:17:26,687 INFO [org.jboss.as.remoting] (MSC service thread 1-1) Listening on /127.0.0.1:
9999
[Host Controller] 16:17:26,703 INFO [org.jboss.as.host.controller] (Controller Boot Thread) Starting server s
erver-one
16:17:26,718 INFO [org.jboss.as.process.Server:server-one.status] (ProcessController-threads - 3) Starting pr
ocess 'Server:server-one'
[Host Controller] 16:17:26,796 INFO [org.jboss.as.host.controller] (Controller Boot Thread) Starting server s
erver-two
[Server:server-one] 16:17:27,093 INFO [org.jboss.modules] (main) JBoss Modules version 1.0.1.GA
16:17:27,468 INFO [org.jboss.as.process.Server:server-two.status] (ProcessController-threads - 3) Starting pr
ocess 'Server:server-two'
[Server:server-one] 16:17:27,484 INFO [org.jboss.msc] (main) JBoss MSC version 1.0.0.GA
[Server:server-one] 16:17:27,562 INFO [org.jboss.as] (MSC service thread 1-3) JBoss AS 7.0.1.Final "Zap" star
ting
[Server:server-two] 16:17:27,828 INFO [org.jboss.modules] (main) JBoss Modules version 1.0.1.GA
[Server:server-two] 16:17:28,218 INFO [org.jboss.msc] (main) JBoss MSC version 1.0.0.GA
[Server:server-two] 16:17:28,296 INFO [org.jboss.as] (MSC service thread 1-4) JBoss AS 7.0.1.Final "Zap" star
ting
[Server:server-one] 16:17:28,328 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-8
) The Apache Tomcat Native library which allows optimal performance in production environments was not found o
n the java.library.path: C:\Program Files\Java\jdk1.6.0_26\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\
WINDOWS;C:\Program Files\Java\jdk1.6.0_26\bin;C:\Program Files\Java\jdk1.6.0_26\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Python27;.
[Server:server-two] 16:17:29,109 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-2
) The Apache Tomcat Native library which allows optimal performance in production environments was not found o
n the java.library.path: C:\Program Files\Java\jdk1.6.0_26\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\
WINDOWS;C:\Program Files\Java\jdk1.6.0_26\bin;C:\Program Files\Java\jdk1.6.0_26\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Python27;.
[Server:server-two] 16:17:29,156 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-8) Star
ting Coyote HTTP/1.1 on http--127.0.0.1-8230
When I check the console, I see that none of the servers are started; I am not sure if this is the problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
查看启动日志和部署意图,可以发现自动部署以及独立实例和域实例之间的不同方法之间存在重要区别。
您尝试部署的部署文件夹基于以下路径:
您将注意到,AS_HOME/domain/ 路径下没有这样的目录。这是因为只有独立实例才能使用热部署,而 AS7 附带了默认为管理此目录的部署扫描程序启用的自动部署功能。扫描程序将尝试部署复制到此文件夹的任何应用程序,并使用标记文件来指示部署状态。
在您的示例中,如果您使用以下脚本启动应用程序服务器的独立实例,则将部署
HelloWorld
。Windows:
Linux:
请记住,服务器首先必须处于活动状态(这听起来很愚蠢,但在测试 AS7 时很容易被忽视),并且部署文件夹将使用
..deployed
标记文件确认部署。同样,失败的部署将导致..failed
标记文件。您还可以使用管理 CLI 和管理控制台(以及通过 JBoss Developer Studio 等 IDE 甚至通过 Maven)部署示例。为了易于使用和视觉反馈,我通常选择控制台。 JBoss 开发人员的这段视频展示了所有可用的方法:http://www.youtube.com/ watch?v=OuFaYYQVJP0
对于域实例,建议您使用管理 CLI 或管理控制台。 JBoss 文档页面上有有关应用程序部署的更多信息。
https://docs.jboss.org/author/display/AS7 /Admin+Guide#AdminGuide-应用程序部署
Looking at your boot logs and deployment intentions, there is an important distinction to make regarding the automatic deployments, and the different methodologies between the standalone and domain instances.
The deployment folder that you are trying to deploy from is based under the following path:
As you will notice, there is no such directory under the AS_HOME/domain/ path. This is because only the standalone instance is able to use hot deployments, with AS7 shipping with the automatic deployment functionality enabled by default for the deployment scanner that manages this directory. The scanner will attempt to deploy any application copied to this folder, using marker files to indicate status of the deployment.
In your example, the
HelloWorld
will deploy if you spin up a standalone instance of the application server with the following script.Windows:
Linux:
Keep in mind that the server first has to be active (which sounds silly to mention, but is easily overlooked when testing AS7 out), and that the deployment folder will confirm a deployment with a
<filename>.<filetype>.deployed
marker file. Likewise a failed deployment will result in a<filename>.<filetype>.failed
marker file.You can also deploy the example using the Management CLI and the Management Console (as well as via an IDE such as JBoss Developer Studio or even via Maven). My pick is usually the Console, for sake of ease of use and the visual feedback. This video by a JBoss developer shows all of the available methods: http://www.youtube.com/watch?v=OuFaYYQVJP0
For domain instances, it is advised that you use either the Management CLI or the Management Console. There's more information on the JBoss documentation page for application deployment.
https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-Applicationdeployment
这是我之前调用
domain.bat
的启动服务器脚本。经过一番研究,我明白该脚本需要调用
standalone.bat
。进行此更改后,war 文件在启动时自动部署。
This was my previous start-server script that was calling the
domain.bat
.After some research, I understood that the script needs to call the
standalone.bat
.After this change, the war file was deployed automatically upon start.
您不能仅将存档复制到部署目录中来部署它。您应该使用控制台来部署存档。它会为你带来更好的效果。
当您将控制台调到顶部时,单击“服务器组”。在“服务器组”页面上,单击“管理部署”,您将看到“添加内容”按钮。从那里开始,只要按照向导的指示就可以了。
You can't just copy an archive into the deployments directory to deploy it. You should use the console to deploy the archive. It will work much better for you.
When you bring the console up at the top click on the Server Groups. On the Server Groups page click on Manage Deployments and you'll see an Add Content button. From there just follow the wizard and you should be good to go.