I'm trying to install the sample ear from the WAS 4.0 Developer handbook. I have some questions regarding the context root setting in the application.xml. I have been reading primarily EJB material only, so I'm sure these are basic web application installation questions. Is the context root in the application.xml entry an abstract one, or does it match to a physical file directory structure. For example, the context root entry for the admin console application is <context-root>/admin</context-root>. It's the only application mapped to port 9090. So localhost:9090/admin gets me into the application. Does this mean the physical directory structure of the files used to create the admin.war had a /admin subdirectory? I would like to look at the original admin.war source directory... but how? I can use the earexpander to recreate the ear file from the installed application directory. Is there also something equivalent for recreating a war? Also, the sample applications for WAS 4.0 are tied to the default_host. Based on what I've read, localhost:9080 should bring up the sample applications. However, localhost:9080 brings "page cannot found". The sample applications seems to start from localhost/WSsamples/index.html. I would think, therefore, localhost:9080/WSsamples/index.html would work, but I get "cannot find page". ?? I would also have expected localhost/WSsamples by itself to work, with index.html being a default page served up, but it doesn't. If I try that, I end up with the url localhost./WSsamples. Again, my goal is install the examples ear file from the WAS 4.0 Developers Workbook. I did the following. 1) setup a new virtual host (pigbank_host 9081) 2) installed the ear, and selected the pigbank_host during installation. I would expect localhost:9081 to run the application, but I get "cannot find page". What am I missing? (I'm sure alot) ... Mike
You have to specify the exact context root for your URL. So it may be: http://host:9081/mybank/ instead of http://host:9081/ BEA has default WebApp concept, which is their properitary implementation. IBM's Servlet engine code is mostly based on Tomcat. You may notice other differences from BEA's to IBM's servlet engine. EAR is deployed into installedApps folder under WAS, so if you change the context root, you can easily rename the folder without regenerate ear and deploy it. It works in my environment, give a try.
Certified Entperise Developer of Websphere
Simon, You will have to excuse my ignorance on web application deployment. I have been focusing on EJBs. You said: "EAR is deployed into installedApps folder under WAS, so if you change the context root, you can easily rename the folder without regenerate ear and deploy it. It works in my environment, give a try." Yeah, I know where the applications are installed, but I don't understand the file structure you are talking about. That was the reason for my questions "Is the context root entry abstract, or can I find that physical structure (I assumed is was hidden in the war file), but you seem to be suggesting I could see the admin subdirectory under installedApps. I have an admin.ear directory and an admin.war subdirectory. But then, all war files seem to be subdirectories of the .ear subdirectory. For example, the YourCo.war file is a subdirectory of the samples.ear, and the application.xml file for the samples application has the following entry...
<"web-uri">YourCo.war<"/web-uri"> <"context-root">/WebSphereSamples<"/context-root"> <"/web"> I don't see /WebSphereSamples as a physical directory under installedApps. Also, you said I may need to put in the full url. It would seem that an index.html file found at the context root would be served up by default. In fact I would think you would be able to name what your default files would be (i.e. like IIS). That probably would happen with the HTTP server admin. By the way, "what is the name" and "Where is" the physical web server plug-in file that gets saved? Confused. Mike [ April 22, 2002: Message edited by: Mike Jones ]
Hi Mike, If ur sure that your HTTP server is running (one way to double check this is via Control Panel->Services. Alternative is the TM) then u can access ur samples page using http://localhost/WSsamples/index.html I don't mean to digress but I noticed something interesting - I cannot access the same page by using the embedded HTTP server as in http://localhost:9080/WSsamples/index.html Why does this happen? Is it because once the plugin-cfg.xml is generated access to 9080 (for this page/app) is disabled? Not sure ...I'm yet reach that chapter :-( On ur first question - context paths are logical paths u define while creating ur WARs. HTH, PJ [ April 22, 2002: Message edited by: Prashanth Joisha ]
"I don't see /WebSphereSamples as a physical directory under installedApps" If you have HTTPServer outside of WAS, then this sample may be located under that HTTPServer. For example, HTDOCS of Apache/IHS.
In WAR, this context root is kind of logical name. There is no physical sub directory related. Servlet engine can have FileServlet to serve static contents in the WAR. So they are aware of how to interprete the context. If you use HTTPServer outside of Servlet engine, or not using FileServlet(coz of performance, whatever), then you must have a physically mapped subfolder for that context root. Hope this clarifies... WAS HTTPServer plug-in are named as plugin-cfg.xml under config folder. You can refer to WAS4.0 Handbook for how this file is helping the HTTP Request routed.
Certified Entperise Developer of Websphere
"On ur first question - context paths are logical paths u define while creating ur WARs." Ok.. that makes sense. You could basically put what you want in context-root and force the url to include it. Has NOTHING to do with directory structure. Correct??? Now the rest of your response has me doubting what I thought I already knew. I'm running AEs, and I assumed I ONLY had the imbedded HTTP server. I did the typical install, and it was installed at C:\IBM HTTP Server. And yes, I do check for it via the control panel, and it is running. When I stop it, I don't seem to be able to browse, so I would assume that is the imbedded server. ??? AEs does have me save the plug-in. Again, does anyone know what file that is, and where is it saved? Maybe you were referring to AE and not AEs. With AE, maybe you can use both the imbedded and the external.
Simon, Thanks, I looked at the plugin-cfg.xml. I think I had read where that was located before, but had forgot. There are URI Name entries in this file which I'm guessing have something to do with the fact that /localhost/WSsamples/index.html gets a hit, while /localhost:9080/WSsamples/index.html does not. You mention the WAS 4.0 AE handbook for reference. I have just completed the WAS 4.0 Development Handbook, and didn't see any reference to war deployment, so I will assume you are talking about this one. http://publib-b.boulder.ibm.com/Redbooks.nsf/RedbookAbstracts/sg246176.html?Open [ April 22, 2002: Message edited by: Mike Jones ]
No Mike, I was referring to AEs in my earlier post. I'm not sure why u have it that way but on my desktop for a AEs install I have 2 directories - one for FrontEnd HTTP server (c:\IBM HTTP Server) and the other for App Server (c:\WebSphere\AppServer). Now when u do http://localhost:9080 ur actually talking to the embedded HTTP server (the AppServer comes with its own lightweight HTTP server). http://localhost will route ur call via the front-end HTTP server. PJ
Prashanth, Sorry, I think I misled you. Sometimes it's a bit of a challenge on a message board. I didn't mean everything was installed in C:/IBM HTTP Server.... just the http server. I do have c:/WebSphere/Appserver. So you are saying I have an embedded server that is an automatic part of the appserver when I start it. It looks like I have two services installed and running... IBM HTTP Server and IBM HTTP Adminstration. I shut down both external services and restarted the application server. //localhost:9080 does not bring anything up. Neither does //localhost:9080/WSsamples/index.html. However, //localhost:9090/admin does work, so I'm convinced. I'm just not clear how to launch the sample applications now, with the imbedded server. It looks like the link from "first steps" and from the start menu item installed in Windows expects to run from the external server. Thanks for the help. This definitely clears some things up. Mike [ April 22, 2002: Message edited by: Mike Jones ]
Mike, I am really having trouble to understand which problem is resolved to you, and what's the remaining. It will be nice if you can open a new thread. In WAS, there are 2 http server. One is called embedded server, which listens to port 9080. And supposedly it resides in Servlet engine, so it uses FileServlet to serve static content. This is equivalent to BEA WLS default installation. WAS can have external http server connected to WAS servlet engine, so you can easily load balancing your http server. You don't need it for testing purpose, but for production you definitely will go with it. IHS/Apache can be installed along with AEs/AE, they usually listen to port 80. So it totally depends on how your application is installed, you can access it via port 80(if external http server is active and your plugin config has it) or port 9080(if WAS is the only running instance). WAS 4.0 Handbook is about WAS AE, it is for administrator different from Dev book. It is sg246176 on redbooks site.
Certified Entperise Developer of Websphere