Here's the Hello.java code:
/**
* This is a simple example of an HTTP Servlet. It responds to the GET
* and HEAD methods of the HTTP protocol.
*/
public class Hello extends HttpServlet
{
/**
* Handle the GET and HEAD methods by building a simple web page.
* HEAD is just like GET, except that the server returns only the
* headers (including content length) not the body we write.
*/
public void doGet (HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
PrintWriter out;
String title = "Test Tomcat Servlets";
// set content type and other response header fields first
response.setContentType("text/html");
// then write the data of the response
out = response.getWriter();
out.println("<HTML><HEAD><TITLE>");
out.println(title);
out.println("</TITLE></HEAD><BODY bgcolor=\"#FFFFFF\">");
out.println("<H1>" + title + "</H1>");
out.println("<H2> Congratulations, Servlets Work!<br>");
out.println("</BODY></HTML>");
out.close();
}
}
Thanks,
Dennis Bretz
[EMAIL PROTECTED]
--- Richard Yee <[EMAIL PROTECTED]> wrote:
> Date: Sun, 18 Nov 2001 23:14:57 -0800
> To: [EMAIL PROTECTED]
> From: Richard Yee <[EMAIL PROTECTED]>
> Subject: Re: newbie: Internal Servlet Error
>
> We need the Hello.java code to find the null pointer.
>
>
>
> -Richard
>
> At 10:35 PM 11/18/2001 -0800, you wrote:
> >Hello,
> >
> >I've got a pretty simple situtation (I think) set up, but I'm
> getting
> >an internal servlet error. Here's what I'm doing...
> >
> >Running Tomcat 3.2 or 3.3 on a Linux server (not standalone). I've
> got
> >a hello.jsp which links to a servlet named (cleverly) Hello.java.
> >Hello.java has a doGet which just outputs the html for "Servlets
> >work!". Previously (48 hours ago) it was working fine. Now I get
> the
> >following message:
> >
> >Error: 500
> >Location: /bretz/servlet/Hello
> >Internal Servlet Error:
> >
> >java.lang.NullPointerException
> > at java.lang.ClassLoader.resolveClass0(Native Method)
> > at java.lang.ClassLoader.resolveClass(ClassLoader.java:588)
> > at
>
>org.apache.tomcat.loader.AdaptiveClassLoader.loadClass(AdaptiveClassLoader.java:430)
> > at
>
>org.apache.tomcat.loader.AdaptiveServletLoader.loadClass(AdaptiveServletLoader.java:174)
> > at
>
>org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:265)
> > at
> > org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289)
> > at org.apache.tomcat.core.Handler.service(Handler.java:254)
> > at
>
>org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> > at
>
>org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
> > at
>
>org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
> > at
>
>org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
> > at
>
>org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> > at
>
>org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
> > at java.lang.Thread.run(Thread.java:484)
> >
> >
> >Can anyone tell what went wrong? If the exact code in the .jsp and
> >.java files would help, let me know.
> >
> >Thank you,
> >
> >Dennis Bretz
> >[EMAIL PROTECTED]
> >Lawrence, Kansas
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Find the one for you at Yahoo! Personals
> >http://personals.yahoo.com
> >
>
>___________________________________________________________________________
> >To unsubscribe, send email to [EMAIL PROTECTED] and include in
> the body
> >of the message "signoff SERVLET-INTEREST".
> >
> >Archives:
> http://archives.java.sun.com/archives/servlet-interest.html
> >Resources:
> http://java.sun.com/products/servlet/external-resources.html
> >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html