9 Replies Latest reply on Jul 7, 2009 8:39 AM by Joe Luo

    Accessing web application deployed in servicemix

    Ankit Vernekar Newbie

      Hi All,

               I had a war file of a web application.I deployed this web application in servicemix and  got a bundle with a id.How do I access this web application now?

       

      Thanks in advance

       

      Regards,

      Ankit

        • 1. Re: Accessing web application deployed in servicemix
          lorinda visnick Newbie

          Ankit,

             I see you were working this general issue under thread ID 1009.  What is your web app/what is it trying to do?

           

          How did you create it?

          How would you otherwise invoke it?

           

          We need more context in order to try to offer advice.

           

          Lorinda

          • 2. Re: Accessing web application deployed in servicemix
            Ankit Vernekar Newbie

            Lorinda,

             

            I have a .war file of a web application that has jsp pages and java implementation on it.The web application was developed in eclipse and so i have the war file

             

            Also the web application can be run by deploying it on tomcat.

             

            I have declared the http port in the ops4j.web.cfg file.Also the war has been successfully deployed as a bundle on servicemix.But when i try to access it on a browser through the url and its context path i get 404 not found error.It uses jetty.

             

            Please do suggest a method to access this web application after being deployed in servicemix. Thank you in advance.

             

            Ankit

            • 3. Re: Accessing web application deployed in servicemix
              Joe Luo Novice

              The file name for configuring OSGI http port is "org.ops4j.pax.web.cfg", for more detail please have a look at this thread here and it needs to be placed under "etc/" directory.

               

              Just give it a try to see if you could get rid of 404 error.

               

              Edited by: joeluo on Jul 7, 2009 10:05 AM

              • 4. Re: Accessing web application deployed in servicemix
                Ankit Vernekar Newbie

                Yes i did the same.  org.ops4j.pax.web.cfg in etc folder.

                 

                The error i am getting is 404 not found error and below it shows powered by jetty.

                • 5. Re: Accessing web application deployed in servicemix
                  Joe Luo Novice

                  Ok, it looks like the configured OSGI http port was up and listening but the web app context was not correct.

                   

                  Just a couple of questions here:

                  1. how did you invoke "osgi/install" command to deploy your war file onto the ESB 4 container?

                  2. are you sure the bundle was up and running? you can check it with "osgi/list" and the bundle should have status of "active".

                   

                  If you did not specify "Webapp-Context" when you deploy your war, it will use default symbolic name of the bundle as your web app context.

                   

                  There are two ways to fix this:

                  1. find out the bundle's "Bundle-SymbolicName" from it's bundles Manifest.mf file and use it as your web context and then try access it with:

                  http://localhost:/myTestApp

                  • 6. Re: Accessing web application deployed in servicemix
                    Ankit Vernekar Newbie

                    Thank you for the help but that solution dint work.

                     

                    i have the war file.Which i kept in the /deploy folder.On starting servicemix console it automatically created a bundle.

                     

                    Now i also tried the bundle-context solution i.e  http://localhost: but it still shows the same error.Is there any other possibility to access the web application.

                    • 7. Re: Accessing web application deployed in servicemix
                      Joe Luo Novice

                      Have you tried with the second solution? Just manually install it using command below from your war file:

                      smx@jluo:/> osgi/install war:file:///C:/temp/myWarFile.war?Webapp-Context=myTestApp

                       

                      Note, you will need to uninstall the bundle using "osgi/uninstall <bundle-ID>" and remove your war file from "deploy" directory before doing the re-deployment manually.

                       

                      If none of them works, then do you mind attach your simple web app so that I can do some test here?

                      • 8. Re: Accessing web application deployed in servicemix
                        Ankit Vernekar Newbie

                        Thank you.

                        The manual installation of war file solved the issue.

                         

                        But I am unable to understand why with the previous method employed of war been kept in deploy folder and forming a bundle automatically dint work even with the Webapp-context provided in manifest file being used to access the application.

                         

                        Thanks a million for the help

                         

                        Regards,

                        Ankit

                        • 9. Re: Accessing web application deployed in servicemix
                          Joe Luo Novice

                          The first solution should work as well. If you place the war file onto "deploy" directory, the ESB will automatically convert it to an OSGI bundle and deploy it using PAX URL but without a web app context unless you have already had an entry of "Webapp-Context" in your war Manifest.mf file, for instance:

                           

                          ...

                          Webapp-Context: myTestApp

                          ...

                           

                           

                          In absense of the "Webapp-Context", the "Bundle-SymbolicName" value will be used as web app context.

                           

                          Not sure why it did not work for you.