开发者

Unable to access a deployed HelloWorld application in JBoss AS7

开发者 https://www.devze.com 2023-04-08 10:24 出处:网络
I am trying out JBoss AS 7 with a simple HelloWorld application. The HelloWorld application folder has a simple hello.jsp file.

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 the jboss7.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] (Contro开发者_C百科ller 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.

Unable to access a deployed HelloWorld application in JBoss AS7


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_HOME/standalone/deployments

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:

EAP_HOME/bin/standalone.bat

Linux:

EAP_HOME/bin/standalone.sh

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


This was my previous start-server script that was calling the domain.bat.

@echo off
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_26
set JBossHome=C:\apps\jboss702

set Path=%JAVA_HOME%\bin;%Path%
cd %JBossHome%\bin
domain.bat

After some research, I understood that the script needs to call the standalone.bat.

@echo off
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_26
set JBossHome=C:\apps\jboss702

set Path=%JAVA_HOME%\bin;%Path%
cd %JBossHome%\bin
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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号