This question might have been asked quite a few times and might have been answered as well.I have searched for quite some time for the answer and havent found it yet.
Lets start from the begining .

I have jdk 8 installed on my c: drive in program files in java folder
C:\Program Files\java\

I extracted the installed apache tomcat in C:\Program Files\Apache Software Foundation\apache-tomcat-8.0.5\

i have setup a CATALINA\_HOME variable pointing to apache directory and a java home variable pointing to jdk 8 directory as entioned above.
Path is set to C:\Program Files\Java\jdk1.8.0\bin; 
and classpath is set to C:\Program Files\Apache Software Foundation\apache-tomcat-8.0.5\lib\servlet-api.jar
i ran tomcat buy going to command promt and catalina\_home/lib/statup.bat and it ran successfully and i could see the server's homepage when i typed the url localhost:8080
now i have setup folders in the catalina\_home as follows
C:\Program Files\Apache Software Foundation\apache-tomcat-8.0.5\webapps\ch03\WEB-INF\classes\com\wrox\projsp\ch03\myfirstwebapp (this was mentioned in a book of wrox publications from which i was trying to read)in the "myfirstwebapp" folder i created a MyFirstServlet.java file which has the following code 

```
    package com.wrox.projsp.ch03.myfirstwebapp;
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import javax.servlet.ServletException;

public class MyFirstServlet extends HttpServlet
{
    public void doGet(HttpServletRequest request,HttpServletResponse response)
        throws ServletException,IOException
    {
        response.setContentType("text/plain");

        PrintWriter out=response.getWriter();
        out.println("this is my first servlet");    
    }
}

```

After that i compiled the .java file by typing in the command promt "javac MyFirstServlet.java" which created a MyFirstServlet.class file in the same folder.But When i try to access it from the browser by typing 

```
http://localhost:8080/ch03/servlet/com.wrox.projsp.ch03.MyFirstServlet

```

it gives an error saying " The requested resource is not available." why is that so?
I think i have done all the necessary steps .What is the reason for it?And apologies in advance if i have miss communicated .My writing skills are poor . And please dont down grade this post as i have put a lot of effort in it and only posted this question after i have no other options left .Thanks in advance

```
type Exception report

message Error instantiating servlet class com.wrox.projsp.ch03.MyFirstServlet

description The server encountered an internal error that prevented it from fulfilling this request.
Exception:

    javax.servlet.ServletException: Error instantiating servlet class com.wrox.projsp.ch03.MyFirstServlet
        org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
        org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526)
        org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1017)
        org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652)
        org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:277)
        org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2451)
        org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2440)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        java.lang.Thread.run(Thread.java:744)
    root cause

    java.lang.ClassNotFoundException: com.wrox.projsp.ch03.MyFirstServlet
        org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1328)
        org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1175)
        org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
        org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526)
        org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1017)
        org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652)
        org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:277)
        org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2451)
        org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2440)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        java.lang.Thread.run(Thread.java:744)

```