12 Replies Latest reply on Dec 24, 2010 10:05 AM by Roger Lee

    JBoss 6 <context-root>

    Roger Lee Apprentice

      Having got my JBoss 4.2.3 EJB3, Seam App deployed on JBoss 6 CR1 release I am trying to run the “web site”.

       

       

      Previously in JBoss 4.2.3 I could enter in the browser;

       

       

      http://localhost:8080/WeEatWell

       

       

      and it would pick up the home.seam and work.

       

       

      I have the context in (from JBoss 4.2.3) in application.xml;

       

       

      {code:xml}

      <?xml version="1.0" encoding="UTF-8"?>

      <application xmlns="http://java.sun.com/xml/ns/javaee"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"

      version="5">

       

      <display-name>WeEatWell</display-name>

       

      <module>

      <web>

      <web-uri>WeEatWell.war</web-uri>

      <context-root>/WeEatWell</context-root>

      </web>

      </module>

       

      <module>

      <ejb>WeEatWell.jar</ejb>

      </module>

       

      <!-- Seam and EL -->

      <module>

      <ejb>jboss-seam.jar</ejb>

      </module>

       

      </application>

      {code}

       

       

      and in the jboss-web.xm (JBoss 6.x)l;

       

       

      {code:xml}

      <!DOCTYPE jboss-web PUBLIC

      "-//JBoss//DTD Web Application 5.0//EN"

      "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">

       

      <jboss-web>

      <!-- A security domain that restricts access

      <security-domain>java:/jaas/JBossWS</security-domain>

      -->

       

      <context-root>/WeEatWell</context-root>

      </jboss-web>

      {code}

       

       

      However now I just get;


      Internet Explorer cannot display the webpage.

      Any suggestions?

      Thanks.

        • 1. Re: JBoss 6 <context-root>
          Wolfgang Knauf Master

          Hi,

           

          I don't know whether this is the reason, but the "context-root" elements I saw up to now never started with a leading "/".

           

          "http://localhost:8080/WeEatWell" should be the default URL for your web app if no different context root is specified.

           

          Are the deployment errors on your JBoss console?

           

          Hope this helps

           

          Wolfgang

          • 2. Re: JBoss 6 <context-root>
            jaikiran pai Master

            And do you have any welcome file?

            • 3. Re: JBoss 6 <context-root>
              Roger Lee Apprentice

              Wolfgang,

               

              No deployment errors, only warnings. In a live App with a domain name I use;

              <module> 

                  <web>

                      <web-uri>NOTiFYPiNPOiNT.war</web-uri>

                      <context-root>/</context-root>

                  </web>

              </module>

               

               

              If I deploy a local(host) version to test I just use;

               

              http://localhost:8080/

               

              To test it using NOTiFYPiNPOiNT I use

               

              <context-root>/NOTiFYPiNPOiNT</context-root>

               

              and then in the browser;

               

              http://localhost:8080/NOTiFYPOiNT

               

              This is of course on JBoss 4.2.3.GA/

               

              Thanks

              • 4. Re: JBoss 6 <context-root>
                Roger Lee Apprentice

                As per my 4.2.3.GA working versions I have an index.xhtml;

                 

                <html><head><meta http-equiv="Refresh" content="0; URL=home.seam"/></head></html>

                 

                and a home.xhtml.

                 

                • 5. Re: JBoss 6 <context-root>
                  jaikiran pai Master

                  AFAIK, index.xhtml isn't considered as a default welcome page. If you want that to be your welcome page, then add it to the welcome file list section of your web.xml. Or try renaming index.xhtml to index.html and place it at the root of the .war.

                  • 6. Re: JBoss 6 <context-root>
                    Roger Lee Apprentice

                    Has this changed in JBoss 6.x?

                     

                    Because everything works fine in JBoss AS 4.2.3.GA both on test (localhost) and when on the live server using my domain name.

                    • 7. Re: JBoss 6 <context-root>
                      jaikiran pai Master

                      Roger Lee wrote:

                       

                      Has this changed in JBoss 6.x?

                       

                       

                      No it's the same as it was in earlier versions.

                       

                      Roger Lee wrote:

                       

                       

                      Because everything works fine in JBoss AS 4.2.3.GA both on test (localhost) and when on the live server using my domain name.

                      Make sure your web.xml contents (especially the welcome file listing) is the same as in 4.2.3.

                       

                      By the way, did you try adding it to welcome file listing and see if it works?

                      • 8. Re: JBoss 6 <context-root>
                        Roger Lee Apprentice

                        I didn't use a Welcome file listing in my web.xml in 4.2.3.GA. Worked though.

                         

                        Have added one to my web.xml in v.6 as so;

                         

                         

                        <welcome-file-list>

                         

                         

                            <welcome-file>index.html</welcome-file>

                         

                         

                        </welcome-file-list>

                         

                        Didn't make a scap of difference I'm afraid. I get;

                         

                        Internet Explorer cannot display the webpage

                         

                        If I type localhost:8080 I get the JBoss 6 "Manage this JBoss AS Instance" so it must work!

                         

                        When JBoss starts I get;

                         

                        16:07:11,317 INFO  [ServletContextListener] Welcome to Seam 2.2.1.CR2

                         

                         

                         

                         

                         

                        and;

                         

                        16:07:15,717 INFO  [config] Initializing Mojarra 2.0.3 (SNAPSHOT 20100726) for context '/WeEatWell'

                         

                        • 9. Re: JBoss 6 <context-root>
                          Wolfgang Knauf Master

                          Hi,

                           

                          is there a small typo?

                           

                          Should you use "index.xhtml" instead of "index.html"?

                           

                          <welcome-file-list>

                              <welcome-file>index.html</welcome-file>

                          </welcome-file-list>

                           

                          Best regards

                           

                          Wolfgang

                          • 10. Re: JBoss 6 <context-root>
                            Roger Lee Apprentice

                            Afraid not ...

                             

                            You use index.html to start the Seam web app, which calls home.xhtml (home.seam)

                             

                            <html><head><meta http-equiv="Refresh" content="0; URL=home.seam"/></head></html>

                             

                            Still not working with WeEatWell as context with or without a "/"!

                             

                            • 11. Re: JBoss 6 <context-root>
                              Roger Lee Apprentice

                              No matter what I put in the <context-root> I can't get my "home" seam web page to display under JBoss 6.x.

                               

                              Everything deploys with only "info" messages and a single "warnings".

                               

                              With the context set to "/WeEatWell" and entering in the browser;

                               

                              http://localhost:8080/WeEatWell

                               

                              I get "Internet Explorer cannot display the webpage".

                               

                              When I go into the JBoss AS 6 Admin Console I can see my EJBs and WAR files deployed with the Context "WeEatWell".

                               

                              Embedded Web Application (WAR)s

                                WeEatWell.war


                                invoker.war

                                Enterprise Application (EAR)s


                                WeEatWell.ear

                               

                              General Properties
                              Name: WeEatWell.war
                              Version: --
                              Description: an embedded web application (WAR)

                              Traits
                              Parent: vfs:///C:/jboss-6.0.0.20101110-CR1/server/default/deploy/WeEatWell.ear 
                              Context Root: WeEatWell 
                              Virtual Hosts: localhost

                               

                              Looks like I'm doomed to use 4.2.3 forever!

                              • 12. Re: JBoss 6 <context-root>
                                Roger Lee Apprentice

                                Regenerated my project using Seam-Gen from;

                                 

                                jboss-seam-2.2.1.CR3 (released 22/12/2010)

                                 

                                "Today was released last candidate for 2.2.1 - Seam 2.2.1.CR3. This version was still focused on bug fixing and on JBoss AS 6 CR1 as runtime deployment"

                                 

                                successfully deployed on running on;

                                 

                                jboss-6.0.0.20101110-CR1

                                 

                                 

                                Looks like it was maybe a Seam issue.