• 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

Tomcat4.0.1 : Problem running servlets

 
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have installed Tomcat4.0.1 on one new machine , and setup all paths as required .
Tomcat example servlets are running fine
( In fact all the settings are same as my other machine , on which Tomcat is working fine )
Now when i try to run my own servlets on newly installed Tomcat , for eg with following settings:
In folder %Tomcat_Home%\webapps\meriapp folloing files are there :
- index.html
- WEB-INF\classes\MeriServlet.class
- WEB-INF\web.xml
MeriServlet.class is simple servlet , which prints "Hello" to response , nothing else.
web.xml is :

which seems correct to me .
Now when i request : http://localhost:8080/meriapp
tomcat responds with 'index.html' correctly
But when i request : http://localhost:8080/meriapp/servlet/Serve
Tomcat give a 'Internal Server error' like of :
javax.servlet.ServletException: Cannot allocate servlet instance for path /meriapp/servlet/Serve
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:415)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...
...
...
goes on and on and on....
...
...

i have tried many configuration settings etc . but in vain
plz help
------------------
Gagan (/^_^\) SCJP2
Die-hard JavaMonk -- little Java a day , keeps u going .
 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've seen problems on Tomcat in the past using the default package. Maybe try putting your servlet class in a package.
 
Gagan Indus
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thankx Max !
I tried putting servlets in different packages
still with no luck
any other idea?
------------------
Gagan (/^_^\) SCJP2
Die-hard JavaMonk -- little Java a day , keeps u going .
 
Gagan Indus
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
I got it solved !
silly-overlook chaosed myself , aaaggrh.. simple fundamental !
The simple servlet 'MeriServlet' has to be declared 'public' ... lol..of course how can i forget Tomcat is a legitimate java-code , it wont be able to access non-public class !
sorry for inconvience

------------------
Gagan (/^_^\) SCJP2
Die-hard JavaMonk -- little Java a day , keeps u going .
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic