This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat doesn't find sevlet I know is there

 
Charles Knell
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working my way through Head First Servlets and JSP. I am in Chapter 3.

When I call the servlet,Tomcat reports this error:

root cause

java.lang.ClassNotFoundException: com.example.web.BeerSelect


The relevant portion of my web.xml file is:


There are two packages involved. The first contains a single class declared:


The second also contains only one class declared as:


Both compiled successfully and I placed the .class files in these directories:
  • Tomcat 5.5/webapps/Beer-v1/com/example/model/BeerExpert.class
  • Tomcat 5.5/webapps/Beer-v1/com/example/web/BeerSelect.class



  • I have stopped and re-started Tomcat after placing the files in the directories noted above.
    Can someone tell me, based on this information, where I'm going wrong?

    [ March 23, 2006: Message edited by: Charles Knell ]
    [ March 23, 2006: Message edited by: Charles Knell ]
     
    Manesh Kumar
    Ranch Hand
    Posts: 94
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Tomcat 5.5/webapps/Beer-v1/classes/com/example/model/BeerExpert.class
    Tomcat 5.5/webapps/Beer-v1/classes/com/example/web/BeerSelect.class


    Should have under WEB-INF folder

    Tomcat 5.5/webapps/Beer-v1/WEB-INF/classes/com/example/model/BeerExpert.class
    Tomcat 5.5/webapps/Beer-v1/WEB-INF/classes/com/example/web/BeerSelect.class

    Also web.xml should also be under
    Tomcat 5.5/webapps/Beer-v1/WEB-INF


    Then try to restart the server.
     
    Charles Knell
    Greenhorn
    Posts: 25
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Dilip Kumar Jain:


    Should have under WEB-INF folder

    Tomcat 5.5/webapps/Beer-v1/WEB-INF/classes/com/example/model/BeerExpert.class
    Tomcat 5.5/webapps/Beer-v1/WEB-INF/classes/com/example/web/BeerSelect.class

    Also web.xml should also be under
    Tomcat 5.5/webapps/Beer-v1/WEB-INF

    Thanks. I've just got too many balls in the air to keep track of everything. It always happens this way when mastering a new skill. I'll remember this now.
    Then try to restart the server.

    [Bear edit: fixed quoting problem]
    [ March 23, 2006: Message edited by: Bear Bibeault ]
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic