12 Replies Latest reply on Apr 17, 2007 1:52 AM by Jignesh P

    Making the application as default

    Niranjan Shetty Newbie

      Hi,
      I have deployed an web application in Jboss AS space and need to make it the default application when the user hits the server. That means if the user access the site at http://:8080/ it should load my application instead of the JBOSS home page. How can i achieve this? What conf do i need to change?

      Regards,
      Niranjan

        • 1. Re: Making the application as default
          Peter Johnson Master

          Here is one way to accomplish this. First remove the current default app at server/xxx/deploy/jbossweb-tomcat55.sar/ROOT.war (remove the whole directory). Second, add a jboss-web.xml file to your web app's WEB-INF directory and put the following it it:

          <?xml version="1.0" encoding="UTF-8"?>
          <jboss-web>
           <context-root>/</context-root>
          </jboss-web>




          • 2. Re: Making the application as default
            Niranjan Shetty Newbie

            Peter,

            After doing the configuration changes I get this error afterorg.jboss.deployers.spi.DeploymentException: Failed to create web module.......

            any idea abt this ?

            • 3. Re: Making the application as default
              Peter Johnson Master

              It would help if you posted the full stack trace...

              Also, do you get this error when you restart the app server or when you attempt to access your application via a browser?

              • 4. Re: Making the application as default
                Niranjan Shetty Newbie

                This exception occurs during the restart of the app server. The application is not accesible there after....

                Below is the exact stack trace........

                22:07:23,380 ERROR [TomcatDeployer] Error during deployment: file:/C:/JBoss/jboss-5.0.0.Beta1/server/default/deploy/ITMS.war/
                org.jboss.deployers.spi.DeploymentException: Failed to create web module
                at org.jboss.web.deployers.AbstractWarDeployer.deploy(AbstractWarDeployer.java:403)
                at org.jboss.web.deployers.AbstractWarDeployer.deploy(AbstractWarDeployer.java:78)
                at org.jboss.deployers.plugins.deployers.helpers.AbstractSimpleRealDeployer.deploy(AbstractSimpleRealDeployer.java:53)
                at org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer.commitDeploy(AbstractSimpleDeployer.java:52)
                at org.jboss.deployers.plugins.deployer.DeployerWrapper.commitDeploy(DeployerWrapper.java:145)
                at org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:440)
                at org.jboss.deployers.plugins.deployment.MainDeployerImpl.process(MainDeployerImpl.java:381)
                at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:366)
                at org.jboss.system.server.profileservice.ProfileServiceBootstrap.bootstrap(ProfileServiceBootstrap.java:246)
                at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:89)
                at org.jboss.system.server.profileservice.ServerImpl.doStart(ServerImpl.java:401)
                at org.jboss.system.server.profileservice.ServerImpl.start(ServerImpl.java:340)
                at org.jboss.Main.boot(Main.java:210)
                at org.jboss.Main$1.run(Main.java:508)
                at java.lang.Thread.run(Thread.java:595)
                Caused by: org.jboss.deployers.spi.DeploymentException: Error creating rar deployment file:/C:/JBoss/jboss-5.0.0.Beta1/server/default/deploy/ITMS.war/
                at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
                at org.jboss.web.deployers.AbstractWarDeployer.deployWebModule(AbstractWarDeployer.java:608)
                at org.jboss.web.deployers.AbstractWarDeployer.deploy(AbstractWarDeployer.java:399)
                ... 14 more
                Caused by: javax.management.MalformedObjectNameException: Unterminated key property part
                at javax.management.ObjectName.construct(ObjectName.java:465)
                at javax.management.ObjectName.(ObjectName.java:1297)
                at org.jboss.web.deployers.AbstractWarDeployer.deployWebModule(AbstractWarDeployer.java:583)
                ... 15 more

                • 5. Re: Making the application as default
                  Peter Johnson Master

                  Double check the jboss-web.xml file, you might have mistyped something. Also, if you remove the jboss-web.xml file (or remove the < context-root > entry from that file), does the war deploy properly?

                  • 6. Re: Making the application as default
                    Niranjan Shetty Newbie

                    yes .... if i remove the file the app is deployed properly....

                    I did a small change ..... added the value "/ITMS" to the <context-root> node....and restarted .....there were no errors this time....however when i accessed http://localhost:8080/ .... it brought up the index page ..... but i have removed the ROOT.war dir completely......so no idea as to where this page is fetched from.......

                    • 7. Re: Making the application as default
                      Peter Johnson Master

                      Did you remove ROOT.war from the correct server configuration? If that index page is still showing up it is still in the server configuration you are running.

                      Also, what version of JBoss AS are you using? Since you never said, I have been assuming 4.0.5.

                      • 8. Re: Making the application as default
                        Peter Goetz Newbie

                        If I may guess from the above stacktrace, it is an 5.0.0 BETA JBoss.
                        I would hint at a misspelled entry and / or the usage of a wrong JBoss runtime installation, when the index page is still coming up, although the ROOT.war has been removed. Did you delete the tmp and work directories? Perhaps the index page is being served from there.

                        Peter

                        • 9. Re: Making the application as default
                          Niranjan Shetty Newbie

                          I have deployed my application in the default configuration... So removed the root.war directory from default/deploy folder......also tried deleting the tmp and work folder ...but the index page still comes back......

                          There are root.war directories in other configuration...shud i try removing them as well.....? or is something to do with Jboss 5.0 beta....?

                          • 10. Re: Making the application as default
                            Peter Johnson Master

                            Looks like there is an issue regarding this in the 5.0 beta. I am getting the error:

                            14:48:21,759 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of
                            incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

                            *** DEPLOYMENTS IN ERROR: Name -> Error

                            vfsfile:/F:/jboss/jboss-5.0.0-beta2/build/output/jboss-5.0.0.Beta2/server/ws/dep
                            loy/jmx-console.war/ -> javax.management.MalformedObjectNameException: Unterminated key property part

                            So yes, this does appear to be a 5.0 beta issue.

                            If you have to use 5.0, you could always remove the ROOT.war and rename your war file to ROOT.war.

                            Finally, I think the home page showing up probably has to do with it being cached by the browser.

                            • 11. Re: Making the application as default
                              Niranjan Shetty Newbie

                              Deleting the ROOT.war directory and renaming the custom app to ROOT.war didnt help either. Not able to understand where things are going wrong. There is no exception in the server startup. But a page not found appears when http://localhost:8080/ is accessed. No redirection occurring as such .The jboss-web.xml file has this

                              <jboss-web>
                              <context-root>/ITMS</context-root>
                              </jboss-web>

                              where ITMS is the name of the application. Any clue?

                              • 12. Re: Making the application as default
                                Jignesh P Newbie

                                Niranjan,

                                This seems to be the problem with jboss-5.0.0.Beta1 because when i tried using jboss-4.0.5.GA it is working fine. Below is jboss-web.xml file:
                                ---------
                                <?xml version="1.0" encoding="UTF-8"?>
                                <!DOCTYPE jboss-web PUBLIC
                                "-//JBoss//DTD Web Application 2.4//EN"
                                "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">

                                <jboss-web>
                                <context-root>/</context-root>
                                </jboss-web>
                                ---------
                                When I hit the URL "http://localhost:8080" I could see my application index page.