• 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 (/servcart/Welcome) is not available.

 
Ranch Hand
Posts: 150
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 150
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Disregard, I got it.

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

Doh!

Now I'm getting ClassNotFoundException: com.ordering.Welcome.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Lou Pelagalli
Ranch Hand
Posts: 150
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Tim!
 
reply
    Bookmark Topic Watch Topic
  • New Topic