Deploy servlet error(Kindly Help me please)

What the step by step method of deploying a servlet.

This what I did to deploy servlet.

1). I created a"servlet.java" File

2). Compiled it on my machine.

3). Then on the machine I want to deploy it I created a folder"TestServlet" in tomcats webapps.

4).Under"TestServlet" I created"WEB-INF" folder

5). Under"WEB-INF" I created"classes"and"lib"folder.

6). Then I kept the java and class files in"classes" folder and all the .jar files in"lib"folder

7). But I access page form web browser it gave me following error.

HTTP Status 500 -

--

type Exception report

message

description The server encountered an internal error () that prevented it from fulfillingthis request.

exception

java.lang.NullPointerException

MyPdfServlet.doGet(MyPdfServlet.java:34)

javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.

--

Apache Tomcat/5.5.9

I tried searching on the net but nothing gave me satisfactory answer.

Thanx for your help in advance.

Any help is appreciated.

:)

[1401 byte] By [nitin403a] at [2007-11-27 11:02:36]
# 1

Do you understand NullPointerExceptions?

Go to the line which caused the NPE and fix it.

BalusCa at 2007-7-29 12:44:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Do we need j2eesdk to be install on that machine has well.

Also in case if tomcat is not working properly then what do.

Because even examples of tomcat are not working properly.

Thanx for your response.

nitin403a at 2007-7-29 12:44:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Hi,

where is your web.xml

it is under WEB-INF folder,

then you implement your deployment settings,

in web.xml

*************

ex:

<servlet></servlet>

<servlet-mapping></servlet-mapping>

re check it

drvijayy2k2a at 2007-7-29 12:44:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

Hi!

Thanks for your Reply.

I found the answer for my question.

Once again Thanks a lot for your help.

nitin403a at 2007-7-29 12:44:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...