• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

The requested resource is not available

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

<!-- Controller Servlet Configuration -->
<servlet>
<servlet-name>controller</servlet-name>
<servlet-class>com.abc.framework.controller.ControlServlet</servlet-class>
</servlet>

<!-- Controller Servlet Mapping -->
<servlet-mapping>
<servlet-name>controller</servlet-name>
<url-pattern>/abc</url-pattern>
</servlet-mapping>

I've configured my httpd-vhosts.conf file to do a proxy pass through as follows:

<VirtualHost www.abc.com>
DocumentRoot /work/abc/abc-app/deploy/var/www/htdocs/abc
ServerName www.abc.com
ServerPath /abc
ErrorLog logs/abc/www.abc.com-error_log
CustomLog logs/abc/www.abc.org-access_log common

ProxyRequests Off
ProxyPass / http://localhost:8080/abc
ProxyPassreverse / http://localhost:8080/abc
</VirtualHost>

When I point my browser at http://www.abc.com/, I get a Tomcat error "The requested resource (/abc) is not available."

This indicates to me that the proxy pass through is working properly in Apache, but that Tomcat is not handing off the request to my serlvet.

What have I done wrong?

Thanks for the help.

Darren Hall
[ July 18, 2006: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the Tomcat forum.
 
Darren Hall
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more thing I tried -

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.

Any ideas?

Thanks,

Darren
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Darren Hall
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply Ben.

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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad you've resolved it.
Thank you for posting back with your solution.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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"!
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.



Help me out.Stuck on this for a long time
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Exactly what is the URL you are trying?
2. Have you checked the log files for more information?

Bill
 
Vaibhav Agrawal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for pointing out the error , i will look into that.
 
reply
    Bookmark Topic Watch Topic
  • New Topic