7 Replies Latest reply on Jun 19, 2006 12:51 PM by Peter Johnson

    Deploying web app

    Burnham Fox Newbie

      Hi,

      JBoss newbie and web app newbie as well. Can someone point me toward a resource (online, book, whatever), that can guide my through the procedure for packaging a .war file and deploying the application within JBoss? I know I just need to copy the .war file to the [JBOSS_HOME]/server/default/deploy directory and JBoss will take care of the rest. But what rules/standards do I need to follow in building the .war file? How do I then access my .jsp page [http://localhost:8080/?????/myjsp.jsp]?

      Anything that would provide as much hand-holding and step-by-step detail would be great!

      TIA-

      Burnie

        • 1. Re: Deploying web app
          Peter Johnson Master

          Here are the contents of one of my war files, as listed by jar:

          >jar -tf info.war
          META-INF/
          META-INF/MANIFEST.MF
          WEB-INF/
          WEB-INF/jsp/
          WEB-INF/lib/
          image/
          image/blue/
          WEB-INF/info-servlet.xml
          WEB-INF/jsp/footer.jsp
          WEB-INF/jsp/header.jsp
          WEB-INF/jsp/home.jsp
          WEB-INF/jsp/include.jsp
          WEB-INF/jsp/props.jsp
          WEB-INF/lib/commons-logging.jar
          WEB-INF/lib/info-1.0.jar
          WEB-INF/lib/jstl.jar
          WEB-INF/lib/log4j-1.2.8.jar
          WEB-INF/lib/spring.jar
          WEB-INF/lib/standard.jar
          WEB-INF/web.xml
          image/blue/body.gif
          image/blue/th_data.gif
          index.jsp
          info.css
          port.jsp
          props.jsp
          request.jsp


          URL to access home page: http://localhost:8080/info/index.jsp


          • 2. Re: Deploying web app
            Peter Johnson Master

            One more thing. If you want to find out what goes into a war file and how all of the parts work, one good resource is http://pdf.moreservlets.com/

            • 3. Re: Deploying web app
              Burnham Fox Newbie

              Thanks for the info. Between posting my original message and getting your response, I did find the web site you mentioned. Very helpful.

              I've got my .jsp page working, but when I try to invoke the servlet (either by clicking "submit" on my JSP page, or directly, I get the same 404 result:

              type Status report

              message /pnp/PnpAuth

              description The requested resource (/pnp/PnpAuth) is not available.

              My .war file looks like this:

              META-INF/
              META-INF/MANIFEST.MF
              WEB-INF/
              WEB-INF/classes/
              WEB-INF/classes/pnp/
              WEB-INF/classes/pnp/certs/
              WEB-INF/lib/
              images/
              WEB-INF/classes/pnp/PnpAuth.class
              WEB-INF/classes/pnp/PnpAuth.properties
              WEB-INF/classes/pnp/PnpLoggerConfig.txt
              WEB-INF/classes/pnp/certs/RSACA.crt
              WEB-INF/classes/pnp/certs/VSIGN1.CRT
              WEB-INF/classes/pnp/certs/VSIGN2.CRT
              WEB-INF/classes/pnp/certs/VSIGN3.CRT
              WEB-INF/classes/pnp/certs/VSIGNSS.CRT
              WEB-INF/classes/pnp/certs/VSIGNTCA.CRT
              WEB-INF/classes/pnp/certs/serverbasic.crt
              WEB-INF/classes/pnp/certs/vsign.crt
              WEB-INF/lib/javax.servlet.jar
              WEB-INF/lib/log4j.jar
              WEB-INF/lib/pnpapi.jar
              WEB-INF/web.xml
              images/logo.gif
              mmmi_pnp.jsp

              And my web.xml looks like this:

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

              Plug-N-Pay credit card authorization application

              <session-config>
              <session-timeout>
              30
              </session-timeout>
              </session-config>
              <welcome-file-list>
              <welcome-file>
              mmmi_pnp.jsp
              </welcome-file>
              </welcome-file-list>

              <servlet-name>PnpAuth</servlet-name>
              <servlet-class>pnp.PnpAuth</servlet-class>

              <!--
              <servlet-mapping>
              <servlet-name>PnpAuth</servlet-name>
              <url-pattern>/mmmi_pnp.jsp</url-pattern>
              </servlet-mapping>
              -->
              </web-app>

              pnp.PnpAuth is the servlet. So what am I missing? I have a feeling it's going to be something fundamental and simple, but I just can't see it.

              Sorry for the brain dump -- any help anyone could provide would be greatly appreciated!

              Thanks!

              Burnie

              • 4. Re: Deploying web app
                Peter Johnson Master

                The problem is with the url-pattern.

                According to the error message, clicking on the "submit" button requests a resource named "/pnp/PnpAuth". But the url-pattern identifies a resource whose name would be "/pnp/mmmi_pnp.jsp". Change your url-pattern to "/PnpAuth" (the prefix "/pnp" is assumed based on your war file name).

                • 5. Re: Deploying web app
                  Burnham Fox Newbie

                  That fixed it. I knew it would be something simple. I see now that I had misunderstood the url-mapping tag and the servlet-mapping node generally. That clarified things for me.

                  Thanks a ton!

                  Burnie

                  • 6. Re: Deploying web app
                    Sheida Kourangi Newbie

                    Hello,

                    When I try to deploy a JSP to Jboss, I get the following error.
                    The JSP file is in the C:\...\jboss-4.0.4RC1\server\default\deploy\FRStest.war folder.

                    HTTP Status 404 - /test.war/date.jsp

                    The requested resource (/test.war/date.jsp) is not available.


                    Appreciate any help!

                    • 7. Re: Deploying web app
                      Peter Johnson Master

                      It would appear that you are using the url http://locahost:8080/test.war/date.jsp. You should, instead, be using http://locahost:8080/test/date.jsp. Note that JBoss uses the .war extension to identify the type of component being deployed, but that extension does not appear in the web context.

                      P.S. You should have started a new post rather than appending to an existing one.