aspose file tools*
The moose likes Tomcat and the fly likes The requested resource (/servcart/Welcome) is not available. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "The requested resource (/servcart/Welcome) is not available." Watch "The requested resource (/servcart/Welcome) is not available." New topic
Author

The requested resource (/servcart/Welcome) is not available.

Lou Pelagalli
Ranch Hand

Joined: Nov 11, 2003
Posts: 150
    
    1
Hi,

Apache Tomcat/7.0.5
Java version
C:\Java Dev\Project Shopping Cart>java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

C:\Java Dev\Project Shopping Cart>

I am getting the message "The requested resource (/servcart/Welcome) is not available."

I used ant to build servcart.war and deployed it to C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps. When I start Tomcat it extracts the war file contents into C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\servcart with the correct packages.

The war file includes package com.ordering were Welcome.class servlet exists.

C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\servcart\WEB-INF\web.xml contents include


All was fine using folders, but when I added the war file process I started getting the error.

Can someone please show me where I went wrong?
Lou Pelagalli
Ranch Hand

Joined: Nov 11, 2003
Posts: 150
    
    1
Disregard, I got it.

Package identification goes in <servlet-class>, not <url-pattern>.

Doh!

Now I'm getting ClassNotFoundException: com.ordering.Welcome.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16054
    
  21

You should have a file: WEB-INF/classes/com/ordering/Welcome.class.

If it's not located there and you're not packaging the class in a JAR located in WEB-INF/lib, the class won't be found.

Please remember that both class and filenames are case-sensitive, even in Windows, where the OS itself disregards filename case.


Customer surveys are for companies who didn't pay proper attention to begin with.
Lou Pelagalli
Ranch Hand

Joined: Nov 11, 2003
Posts: 150
    
    1
Thank you Tim!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: The requested resource (/servcart/Welcome) is not available.