• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Lou Pelagalli
Ranch Hand
Posts: 150
1
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thank you Tim!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic