-
1. Re: Accessing web application deployed in servicemix
lvisnick Jul 6, 2009 11:38 AM (in response to ankit.vernekar)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 Jul 6, 2009 11:53 PM (in response to lvisnick)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 Jul 7, 2009 6:06 AM (in response to ankit.vernekar)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 Jul 7, 2009 6:00 AM (in response to joe.luo)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 Jul 7, 2009 6:24 AM (in response to ankit.vernekar)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:
-
6. Re: Accessing web application deployed in servicemix
ankit.vernekar Jul 7, 2009 6:36 AM (in response to joe.luo)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 Jul 7, 2009 6:47 AM (in response to ankit.vernekar)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 Jul 7, 2009 7:05 AM (in response to joe.luo)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 Jul 7, 2009 8:39 AM (in response to ankit.vernekar)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.