RE: javax.servlet.ServletException: Cannot allocate servlet instancefor path /servlet/HelloWorld

2007-08-02 Thread Caldarale, Charles R
 From: Fabbris Pierluigi [mailto:[EMAIL PROTECTED] 
 Subject: javax.servlet.ServletException: Cannot allocate 
 servlet instancefor path /servlet/HelloWorld
 
 java.lang.IllegalAccessException: Class 
 org.apache.catalina.core.StandardWrapper can not access a 
 member of class HelloWorld with modifiers 

You've likely not used the public modifier on your doGet(), etc.,
methods.

If that's not the case, post your servlet code to the list.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: javax.servlet.ServletException: Cannot allocate servlet instancefor path /servlet/HelloWorld (repost I don't resolve the problem with your reply)

2007-08-02 Thread Hassan Schroeder
On 8/2/07, Fabbris Pierluigi [EMAIL PROTECTED] wrote:

 javax.servlet.ServletException: Cannot allocate servlet instance for path 
 /servlet/HelloWorld

 *My first servlet in directory classes is:*

Uh, well -- this *isn't* a servlet. I'm guessing that's the problem :-)
javax.servlet.Servlet is an interface -- your servlet needs to extend
it (actually HttpServlet in this case).

 class HelloWorld {
   public static void main(String[] args)
  {
System.out.println(Hello World!);
  }
 }

See the examples packaged with Tomcat, and take a look at the
Servlet  Spec JavaDocs.

HTH,
-- 
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]