Simple problem (hopefully) and I've been here before, but for some reason I can't find my way through this error.
Here's the scenario:
I've written a servlet which I'm deploying in Tomcat 5.5 using Apache 2.2 as the web server. The servlet is a controller for one domain I have on my server (lets call it the 'abc' domain.) The servlet is bundled into a war file and deploys into Tomcat with no errors. The servlet-mapping in the web.xml file defines the following:
When I point my browser at http://localhost:8080/abc, I get the same Tomcat error "The requested resource (/abc) is not available.", so the Apache configuration is irrelevant.
Something is wrong with the way I have things set up in Tomcat.
Did you deploy your application as the default app within Tomcat? By default, Tomcat ships with the ROOT app (found under the webapps directory) as it's default app.
If so, how did you configure abc to be the default app?
No, I didn't install the app as the default Tomcat app (at least I didn't mean to). This instance of Tomcat will eventually host 3 web apps for me, and I wanted each to be wholy and completely seperate. The ROOT app in Tomcat still exists, and when I point a browser to http://localhost:8080/ it displays the default Tomcat page (with links to the manager, examples, etc. in the left-hand menu).
I had wanted to manage things by URL so that if the URL pattern '/abc' came in, it would map to the web app I am trying to deploy.
Is this not correct? In the past I seem to remember having been able to do this, and I was able to get things configured properly. Unfortunately this was a few years ago, and I no longer remember how I did it.
Thanks,
Darren
[ July 19, 2006: Message edited by: Darren Hall ] [ July 19, 2006: Message edited by: Darren Hall ]
Darren Hall
Greenhorn
Joined: Jan 22, 2006
Posts: 12
posted
0
I've resolved the issue.
Essentially the war file was named 'foo.war' and was deploying to the webapps/foo/ directory, yet I was looking for the abc/ url mapping for my servlet.
By renaming my war to abc.war and having it deploy in the webapps/abc/ directory the mapping worked correctly and the servlet could be reached.
I'm not sure if this is the "correct" answer, but it does work, so I'll take it for now. [ July 24, 2006: Message edited by: Darren Hall ]
Hi, I experienced the same problem. I've been executing some examples from the Java book. After two days of exploring, I discovered that the solution was very simple:
Appache server is sensitive to capital letters and therefore it makes the difference between "web.XML" and "web.xml". The file named "web.XML" is not recognized by the Apache as valid web.xml file. It must be "web.xml"!
Following is my web.xml file. I am building OMT.war and trying to deploy it on Tomcat server , following error comes:The requested resource (/OMT/) is not available.
I am trying localhost:8080/OMT/ and I guess OMT.html should be displayed.
And yes I have seen the log files and it does not show any error message.Does my xml needs some correction?
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12325
1
posted
0
I am guessing that for some reason, Tomcat does not recognize OMT as a valid web application.
Where did you place the OMT.war? Did Tomcat expand it to an OMT directory?
Bill
Vaibhav Agrawal
Greenhorn
Joined: Jul 15, 2011
Posts: 4
posted
0
OMT.war is placed in project folder OMT/ and yes tomcat expands it to seperate OMT folder.
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12325
1
posted
0
Checking your file with XML SPY - it identifies a problem at your second servlet element:
"Unexpected child element 'servlet'
If I remove that element XML SPY says its valid.
Right offhand I can't see what it doesn't like but that diagramServlet element is what it is objecting to.
Bill
Vaibhav Agrawal
Greenhorn
Joined: Jul 15, 2011
Posts: 4
posted
0
Thank you for pointing out the error , i will look into that.