Cannot find symbol class error

hi there ,
i am creating a min class that links several classes and i am doing the following
public class Main{
     public static void main(String[] args){
     classOne a = new classOne();
classTwo b = new classTwo();
classThree c = new classThree();
// more classes with the same as above
i am saving all the classes in the same folder , and i am having this error twice with each line that i creat an instance for a class
cannot find symbol
symbol : class classOne

are your classes all in the same package? do you in fact use packages?
Your best bet to get help here is by creating a Short, Self Contained, Correct (Compilable), Example or SSCCE. This is a small application that you create that is compilable and runnable, and demonstrates your error, but contains no extraneous, unnecessary code that is not associated with your problem. To see more about this and how to create this, please look at this link:
http://homepage1.nifty.com/algafield/sscce.html
Remember, this code must be compilable and runnable.
Also, if you do post your code, please use code tags so that your code will be well-formatted and readable. To do this, either highlight your code block and press the "code" button at the top above the message block or place the tag [code] at the top of your block of code and the tag [/code] at the bottom, like so:
[code]
   // your code block goes here
[/code]

Similar Messages

  • "cannot find symbol : class Scanner"  error message

    I have an error message that says:
    "cannot find symbol : class Scanner"
    I tried typing at the top of the program
    import java.util.Scanner;but I still have the same error message.
    What should I do ?
    Thank you in advance

    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html
    Since:
    1.5
    look at the javadoc, it says since 1.5 so it's not there in earlier versions.
    just a guess

  • "cannot find symbol class studentList" error

    Hi I get this error
    "cannot find symbol class studentList", but this class is at the same file and also it is in the same folder. so what's wrong .. and I checked the spelling it's the same.
    I should create an object named myList of type studentList
    and second, I call method menu() and pass it myList as actual parameter.
    so I called the function menu which is should be in the main too
    like this
    myList.menu();
    and menu method accepts as parameter an object of type studentList. and display the menu for the user to choose..
    here is part my program:
    public class ListTest
    {  public void menu(Student L) // accepts parameter
                   System.out.println("");
                System.out.println("Choose a number between 1 to 4");
                      System.out.println("1-Print Info of A Student ");          
                System.out.println("2-Print Info of All Students ");                          
               System.out.println("3-Display grade of A Specific student");                           
                System.out.println("4-Exit");
                System.out.println("");        
              int choice = Stdin.readInteger();
              while (choice != 5)
             switch (choice) {
                 case 1:
             L.PrintAStudent(int L);
             break;
              case 2:
            L.PrintAll();
            break;     
              case 3:
              L.DisplayGPA();
              break;
                 case 3:
                System.exit(0);
               break;
               default:
               System.out.println("wrong Number");
              System.out.println("Enter a number between 1 to 4 ");
               System.out.println("Enter 4 to Exit");
                break;
                System.out.println("");
                System.out.println("Choose a number between 1 to 4");
                System.out.println("1-Print Info of A Student ");          
                System.out.println("2-Print Info of All Students ");                          
               System.out.println("3-Display grade of A Specific student");                           
                System.out.println("4-Exit");
                System.out.println(""); 
                choice = Stdin.readInteger();
         }// end method menu
         public static void main(String args[ ])
         { studentList myList = new studentList();//myList object is created
    myList.menu();
                             }//end main
    }// end of class ListTest
              

    you have mentioned about the class "studentList" but that class is not to be found in the code you have pasted. its instead "ListTest". And the "menu" function seems to b a part of "ListTest" class. Can you provide the structure of the classes "studentList" and "Student" so that the problem can be more clearly understood?
    also you are using the variable "Stdin" in the line int choice = Stdin.readInteger(); where as you have not declared this variable.
    in the "switch" statement you are calling two different functions for the same case "3" where as it should be "case 3" and "case 4" respectively.
    in the "main" you are calling the "menu" function without any parameter while you actually want to pass argument of type "studentList".

  • Cannot find symbol class Scanner

    hi all
    i'm defining a class within a project so i can use the class inside my program, but the line:
    Scanner keyboard = new Scanner(System.in);generates an error with my compiler:
    cannot find symbol class Scanner
    please help

    you aren't using jdk 5 or higher then. that's when scanner was added to the jdk.
    download a modern jdk and you'll be fine.
    %

  • Cannot find symbol     class Usernamebean

    hi i am new in j2ee
    can some body help to give the solution.
    i am always thankfull to everybody
    i have a servlet where i am calling a bean of same package but servlet not compile giving that error
    cannot find symbol class Usernamebean
    servlet code
    package ecomm; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; import bengalcom.*; public class Loginservelet extends HttpServlet { public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException { try {         String accnum=req.getParameter("username");   String pinnum=req.getParameter("password"); try { Class.forName("com.mysql.jdbc.Driver"); Connection dbcon=DriverManager.getConnection("jdbc:mysql://localhost/ecomm","root",""); PreparedStatement s = dbcon.prepareStatement("select * from vendordetails where email = ? and password = ? and blocking='No' "); s.setString(1,accnum); s.setString(2,pinnum); ResultSet result=s.executeQuery(); boolean rowfound=false; rowfound=result.next();   if(rowfound==true) { String vname=result.getString("fname"); String  vid=result.getString("vid"); String email=result.getString("email");   UsernameBean nameBean =new UsernameBean();   nameBean.setFirstName(accnum); HttpSession session = req.getSession(true); session.setAttribute("vname",vname); session.setAttribute("vid",vid); session.setAttribute("email",email);   RequestDispatcher dispatcher=getServletContext().getRequestDispatcher("/earea.jsp?vname=vname&vid=vid&email=email"); dispatcher.forward(req,res); dbcon.close(); } else{ RequestDispatcher dispatcher=getServletContext().getRequestDispatcher("/eblock.jsp"); dispatcher.forward(req,res); }   } catch(ClassNotFoundException e) { } } catch(SQLException e) { System.out.println(e.toString()); } } public void doPost(HttpServletRequest req, HttpServletResponse res)         throws ServletException, IOException     {         doGet(req, res);     } }

    Hi,
    java is case sensitive, Check the case in class name.
    Regards,
    Ram

  • Cannot find symbol - class whatever ... Arraylists!

    Hi all,
    Having a problem creating an Arraylist. Firstly, I thought you could have an ArrayList of what ever you wanted. For example, private ArrayList<Anything> myarraylist... that would be an ArrayList of "anything".
    I'm trying to create an ArrayList to store locations. However, these locations are stored inside the objects of another class (as a field).
    When I go to do private ArrayList<Locations> it says it cannot find symbol - class locations. Obviously it's looking for a class that doesn't exist. How would I store the locations of rallies into the collection, that are stored inside the object of another class (i.e. a RoadTrip object which has details of dates, location, codes etc).
    Hope you can understand that...!
    Cheers

    You can create as many RoadTrip ArrayLists as you want, as long as the variables that point to the ArrayLists have unique names.
    ArrayList<RoadTrip> al1 = new ArrayList<RoadTrip>();
    ArrayList<RoadTrip> al2 = new ArrayList<RoadTrip>();Nothing wrong with that.

  • Cannot find symbol class

    I am having a "Cannot find symbol" problem. My Java is a bit rusty so I'm not exactly sure what it could be. I have two classes, City and SisterCities. The SisterCities references the City class. The City class compiles fine. Both classes are part of the same package. However, when I compile SisterCities, I get the error. Could you please tell me how to get the second class to recognize the first (import, extends, not really sure. I've tried alot) Here are those two classes so far...
    ****** City ********
    package hw01;
    public class City
         public final String name;
         public final String country;
         public final City [] sisters;
    public City (String name, String country)
              // throw new RuntimeException ("Not implemented yet.");
              this.name = name;
              this.country = country;
              this.sisters = new City [0];
    public City (String name, String country, City [] sisters)
              // throw new RuntimeException ("Not implemented yet.");
              this.name = name;
              this.country = country;
              this.sisters = new City [sisters.length];
              for (int i = 0; i < sisters.length; i++) {
                   this.sisters[i] = sisters;
    public void setSisters (City [] sisters)
              // throw new RuntimeException ("Not implemented yet.");
              for (int i = 0; i < sisters.length; i++) {
                   this.sisters[i] = sisters[i];
    public String getName ()
              // throw new RuntimeException ("Not implemented yet.");
              return this.name;
    public String getCountry ()
              // throw new RuntimeException ("Not implemented yet.");
              return this.country;
    public City [] getSisters ()
              // throw new RuntimeException ("Not implemented yet.");
              return this.sisters;
    ******** SisterCities *********
    package hw01;
    import java.util.LinkedList;
    public class SisterCities
         public final LinkedList cityList;
    public SisterCities ()
              // throw new RuntimeException ("Not implemented yet.");
    public void addCity (City city)
              // throw new RuntimeException ("Not implemented yet.");
              this.cityList.add(city);
    public int getNumCities ()
              // throw new RuntimeException ("Not implemented yet.");
    public City getCity (int i)
              // throw new RuntimeException ("Not implemented yet.");

    final attribute members like "cityList" must be initialised when they're declared or inside the constructors
    if you want to compile, you'll also have to uncomment the "throws" in your methods (or return a value)
    (pay attention to the error messages the compiler gives you and paste them all when posting questions)

  • Cannot find symbol class ParseException

    I have this in my code how ever
    DateFormat formatter = new SimpleDateFormat("ddMMyyyy");
    dDateStamp = (Date)formatter.parse(dateStamp);
    When I pass in say
    dateStamp=safsadssad sa;
    I get an error which is fine.
    I can not seem to catch this error with try catch
    When I use the one below it says it cannot find the symbol
    When i use the Exception it still throws and error to jsp page
    cannot find symbol
    symbol : class ParseException
    }catch(ParseException e){   
    symbol : class ParseException
    }catch(ParseException e){   
    Any One know I csn trap this?
    Thanks in advance

    Well, it's in the j2se API. Not sure what to tell you...

  • Cannot find symbol class entry

    .\ListGraph.java:26: cannot find symbol
    symbol : class Entry
    location: class Map
    for(Map.Entry<Stad,List<ListEdge>> me : nodes.entrySet())
    ^
    1 error
    this is what i get when i try to compile this code, its the lowest part thats getting errors:
    import java.util.*;
    import java.util.Map.*;
    import java.util.Map.Entry;
    class ListGraph{
         private HashMap<Stad,List<ListEdge>> nodes =
              new HashMap<Stad,List<ListEdge>>();
         public void addNode(Stad ny){
              nodes.put(ny, new ArrayList<ListEdge>());
         public void connect(Stad from, Stad to, String n, int v){
              List<ListEdge> fromList = nodes.get(from);
              List<ListEdge> toList = nodes.get(to);
              ListEdge e1 = new ListEdge(to, n, v);
              fromList.add(e1);
              ListEdge e2 = new ListEdge(from, n, v);
              toList.add(e2);
         public String toString(){
              String ret = "";
              for(Map.Entry<Stad,List<ListEdge>> me : nodes.entrySet())
                   ret += me.getKey()+": "+me.getValue()+"\n";
              return ret;
    }

    Bananen123 wrote:
    .\ListGraph.java:26: cannot find symbol
    symbol : class Entry
    location: class MapI don't get the same error, so I'm not sure what code you are actually trying to compile. Do you happen to have defined another class named Map in the default package?
    Also, please use code tags when posting code. Example: import java.util.*;
    import java.util.Map.*;
    import java.util.Map.Entry;
    class ListGraph{
        private HashMap<Stad,List<ListEdge>> nodes =
            new HashMap<Stad,List<ListEdge>>();
        public void addNode(Stad ny){
            nodes.put(ny, new ArrayList<ListEdge>());
        public void connect(Stad from, Stad to, String n, int v){
            List<ListEdge> fromList = nodes.get(from);
            List<ListEdge> toList = nodes.get(to);
            ListEdge e1 = new ListEdge(to, n, v);
            fromList.add(e1);
            ListEdge e2 = new ListEdge(from, n, v);
            toList.add(e2);
        public String toString(){
            String ret = "";
            for(Map.Entry<Stad,List<ListEdge>> me : nodes.entrySet())
                ret += me.getKey()+": "+me.getValue()+"\n";
            return ret;
    class Stad {}
    class ListEdge{ ListEdge(Stad s, String str, int i) {} }~

  • Cannot find symbol : class ! problem

    Hello,
    I have 2 java files (CD.java & CDCatalog.java) in a package called "testPackage". I can compile CD.java, but CDCatalog.java (that creates CD instances) gives following error - cannot find symbol symbol : class CD
    Below are the 2 files, please tell me why I get this errors , thanks!
    1) CDCatalog.java
    package testPackages;
    import java.util.Hashtable;
    //import testPackages.CD;
    public class CDCatalog {
    /** The CDs, by title */
    private Hashtable catalog;
    public CDCatalog( ) {
    catalog = new Hashtable( );
    // Seed the catalog
    addCD(new CD("Nickel Creek", "Nickel Creek", "Sugar Hill"));
    addCD(new CD("Let it Fall", "Sean Watkins", "Sugar Hill"));
    addCD(new CD("Aerial Boundaries", "Michael Hedges", "Windham Hill"));
    addCD(new CD("Taproot", "Michael Hedges", "Windham Hill"));
    public void addCD(CD cd) {
    if (cd == null) {
    throw new IllegalArgumentException("The CD object cannot be null.");
    catalog.put(cd.getTitle( ), cd);
    2) CD.java
    package testPackages;
    public class CD {
    private String title;
    private String artist;
    private String label;
    public CD( ) {
    // Default constructor
    public CD(String title, String artist, String label) {
    this.title = title;
    this.artist = artist;
    this.label = label;
    public String getTitle( ) {
    return title;
    public void setTitle(String title) {
    this.title = title;
    public String getArtist( ) {
    return artist;
    public void setArtist(String artist) {
    this.artist = artist;
    public String getLabel( ) {
    return label;
    public void setLabel(String label) {
    this.label = label;
    public String toString( ) {
    return "'" + title + "' by " + artist + ", on " +
    label;
    }

    just tried it as well, no problems, provided you
    compile CD.java firstI just tried from the shell ans look at this...
    E:\testPackages>dir
    Volume in drive E is MYFLASHDISK
    Volume Serial Number is 483B-B160
    Directory of E:\testPackages
    05/24/2006  07:48 PM    <DIR>          .
    05/24/2006  07:48 PM    <DIR>          ..
    05/24/2006  07:20 PM             1,143 CD.java
    05/24/2006  07:50 PM             1,053 CD.class
    05/24/2006  07:56 PM               972 CDCatalog.java
                   3 File(s)          3,168 bytes
                   2 Dir(s)   1,024,503,808 bytes free
    E:\testPackages>javac -cp e:\testPackages CDCatalog.java
    CDCatalog.java:30: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
        public void addCD(CD cd) {
                          ^
    CDCatalog.java:24: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
            addCD(new CD("Nickel Creek", "Nickel Creek", "Sugar Hill"));
                      ^
    CDCatalog.java:25: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
            addCD(new CD("Let it Fall", "Sean Watkins", "Sugar Hill"));
                      ^
    CDCatalog.java:26: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
            addCD(new CD("Aerial Boundaries", "Michael Hedges", "Windham Hill"));
                      ^
    CDCatalog.java:27: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
            addCD(new CD("Taproot", "Michael Hedges", "Windham Hill"));
                      ^
    5 errors
    E:\testPackages>I am now officially confused. I even specified the exact path to the CD.class file and javac still didnt like it.
    I'll dig some more. It has to be related to the classpath some how..
    JJ
    Still Stumped.. I'll sleep on it..
    Message was edited by:
    Java_Jay

  • Cannot find Symbol :class CLOB

    Hi,
    I am using JDK1.5.0_06 and Oracle8.1.7.
    When i compile java program I am getting the following error
    cannot find symbol
    symbol : class CLOB
    I have added classes12.zip into classpath.
    Can anybody tell me why this errpr comes? Is there any other files instead of classes12.zip to be added (since its JDK1.5 version? )
    Thanks in advance
    neema

    you have mentioned about the class "studentList" but that class is not to be found in the code you have pasted. its instead "ListTest". And the "menu" function seems to b a part of "ListTest" class. Can you provide the structure of the classes "studentList" and "Student" so that the problem can be more clearly understood?
    also you are using the variable "Stdin" in the line int choice = Stdin.readInteger(); where as you have not declared this variable.
    in the "switch" statement you are calling two different functions for the same case "3" where as it should be "case 3" and "case 4" respectively.
    in the "main" you are calling the "menu" function without any parameter while you actually want to pass argument of type "studentList".

  • Cannot find symbol "console" error

    hi there ~
    Here is environment:
    winXP Pro
    jdk1.5.0_04
    here is part of my code:
            System.out.print("Enter Bit length   \t:");
            int bitlen = Console.readInt();
         System.out.print("Enter integer to be encrypted  :");
         BigInteger big = new BigInteger(Console.readString());here is the error msg:
    C:\Program Files\Java\jdk1.5.0_04\bin>javac myRSA.java
    myRSA.java:115: cannot find symbol
    symbol : variable Console
    location: class myRSA
    int bitlen = Console.readInt();
    ^
    myRSA.java:157: cannot find symbol
    symbol : variable Console
    location: class myRSA
    BigInteger big = new BigInteger(Console.readString());
    ^
    2 errors
    thx for your help in advance.

    The javac compiler does not understand what "Console" means in your code. (BTW, to follow recommended coding conventions, you class should be named MyRSA - using coding conventions will get you better help.)
    It appears that Console is a class you wrote or was given to you. You need to import it, if it is not in the same package as myRSA. And, the compiler needs to be able to find it through the Classpath.

  • Wrapper cannot find servlet class error

    Hi all!
    I'm receiving a mysterious error when I try to run my web ap. "Wrapper cannot find servlet class com.ruffalocody.report.ReportServlet or a class it depends on"
    I'm running it on JBoss 3.2.7, and I have another web ap, made almost identical to this one which does not display the same error/exception.
    If anyone could give me advice on what I should do to fix this, I'd very much appreciate it. :)
    Full exception message:
    javax.servlet.ServletException: Wrapper cannot find servlet class com.ruffalocody.report.ReportServlet or a class it depends on
         org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
         org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:162)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
         org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
         org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         java.lang.Thread.run(Thread.java:534)
    root cause
    java.lang.ClassNotFoundException: com.ruffalocody.report.ReportServlet
         java.net.URLClassLoader$1.run(URLClassLoader.java:199)
         java.security.AccessController.doPrivileged(Native Method)
         java.net.URLClassLoader.findClass(URLClassLoader.java:187)
         java.lang.ClassLoader.loadClass(ClassLoader.java:289)
         java.lang.ClassLoader.loadClass(ClassLoader.java:235)
         org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
         org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:162)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
         org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
         org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         java.lang.Thread.run(Thread.java:534)the servlet class file ReportServlet.class is located in:
    WEB-INF\classes\com\ruffalocody\report
    web.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <servlet>
            <servlet-name>RprtSrvlt</servlet-name>
            <servlet-class>com.ruffalocody.report.ReportServlet</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>RprtSrvlt</servlet-name>
            <url-pattern>/reports</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
         <welcome-file>
                index.jsp
            </welcome-file>
        </welcome-file-list>
        <!-- Context Param -->
        <context-param>
        <param-name>crystal_image_uri</param-name>
        <param-value>crystalreportviewers10</param-value>
        </context-param>
        <!-- Context Param End -->
    </web-app>It's called from the index.jsp page w/ ulr: "reports?goTo=view"
    Servlet code (not sure if it's useful, but including just in case):
    * ReportServlet.java
    * Created on February 1, 2007, 11:04 AM
    package com.ruffalocody.report;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactory;
    import com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2;
    import com.crystaldecisions.sdk.occa.report.reportsource.IReportSource;
    import com.crystaldecisions.report.web.viewer.CrystalReportViewer;
    import com.crystaldecisions.sdk.occa.report.lib.ReportSDKExceptionBase;
    * @author aerohner
    * @version
    public class ReportServlet extends HttpServlet
        String rptLoc = "CR10_JRC_BeginHere.rpt";
        /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
         response.setContentType("text/html;charset=UTF-8");
         String goTo = request.getParameter("goTo");
         if(goTo != null && goTo.equals("view"))
             viewReport(request, response);
         }// end goTo view
         else if(goTo != null && goTo.equals("export"))
             exportReport(request, response);
         }// end go to export
         else
             RequestDispatcher view = request.getRequestDispatcher("index.jsp");
             view.forward(request,response);
        private void viewReport(HttpServletRequest request,
             HttpServletResponse response) throws ServletException, IOException
         IReportSource rptSrc = setUpReportSource(request);
         if (rptSrc != null)
             // create viewer
             CrystalReportViewer viewer = new CrystalReportViewer();
             try
              viewer.setReportSource(rptSrc);
              forward(request, response, viewer);
             catch(ReportSDKExceptionBase e)
              e.printStackTrace();
         }// if rptsrc not null
         else
             log("rptSrc is null");
         }// end else not null
        }// end viewReport(.)
        private void exportReport(HttpServletRequest request, HttpServletResponse response)
        }// end exportReport(.)
        private IReportSource setUpReportSource(HttpServletRequest request)
         IReportSourceFactory2 rptFact = new JPEReportSourceFactory();
         IReportSource rptSrc = null;
         try
             rptSrc = (IReportSource)
              rptFact.createReportSource(rptLoc, request.getLocale());
         }// end try
         catch (Exception e)
         return rptSrc;
        }// end setUpReportSource()
        private void forward(HttpServletRequest request,
             HttpServletResponse response, Object viewer)
             throws ServletException, IOException
         request.setAttribute("viewer", viewer);
         RequestDispatcher view = request.getRequestDispatcher("viewer.jsp");
         view.forward(request,response);
        }// end forward(...)
        // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
        /** Handles the HTTP <code>GET</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
         processRequest(request, response);
        /** Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
         processRequest(request, response);
        /** Returns a short description of the servlet.
        public String getServletInfo()
         return "Short description";
        // </editor-fold>
    }Thanks :)

    I'm curious. Could you strip off the "java." part of the package, so both in your sourcefile as in the directory structure? It may be that the java package is not allowed, but then I wouldn't know why you didn't get a compile error...

  • Cannot Find Servlet class Error

    Hello Everybody,
    i have written a simple servlet and compiled it using j2sdk1.4 version and jsdk.jar.But when i try to load the servlet on the javawebserver2.0 it says it is unable to find servlet class though i have put the class file in the servlets directory.i even put the class in the classes directory.It works fine when i compile the same class using j2sdk1.3 version and jsdk.jar.
    Please guide me as to what should be done to overcome this problem.
    Thanks in Advance
    Manikantan Iyer

    Hi mani2k_in ,
    JavaWebserver2.0 --> This web server, by default uses JDK 1.1.8.
    If you have compiled your classes using heigher versions, Webserver won't be able to find those classes which were added after JDK1.1.8.
    That was the first problem regarding the J2sdk versions you have used.
    You can override the default JVM usage of JavaWebServer2.0
    Second the servlet problem.
    Your environment should able to lookup the classes dyanmically jsdk.jar or servlet.jar.
    If you are able to compile the servlet successfully, place it in servlets directory and access the servlet from a browser using the url http://servername:portnumber/servlet/Servletclass
    Although you have placed your class file in servlets directory, you should access by using servlet in the URL.
    If it doesn't solve your problem, please come back with more details.
    Thanks,
    Sanath Kumar

  • Java:57: cannot find symbol class _cls2

    Due to our loss of a software engineer who started this ongoing project many many moons ago I've come to compile it, but have the following error.
    I'm using netbeans 5.5 and JKD1.5 U12
    I've fixed all of the errors apart from this one:-
    table = new _cls2(model);
    Now the _cls2 class has not be defined anywhere, so I presume it should have been included within an old library file.... or have I got this worng.
    Any help appreciated I seem to be coming across the same websites over and over again whilst searching.....

    if its included in some other library you have somewhere then you need to import that library.

Maybe you are looking for

  • How many iphones can i have on one account?

    My under 13 kids each got an iphone for Christmas.  I want to add their iphones to my account to download apps and music.  They won't have access to my account (ie., i will need to login for them to get an app or music).  Is there a limit to the numb

  • Issue with Monitoring of Subscription Orders

    Dear Experts , Recently we are facing an issue in the monitoring of subscription orders. We have scheduled the Monitoring ( Tcode : JKRM) in the background during the night time. Since last few days, our basis guy is complaining about creation of too

  • ATV2 HDMI Audio Distortion

    Hi All, I have seen rumblings about this but no solutions. I have 2 new ATV Second Gen units that are overdriving the sound through HDMI to my receiver. The version 1 units never had this issue with digital out, but the new ones do. Music, video, it

  • How can I return my photos from my passport backup to my macbook pro?

    Somehow I have lost my photo library- hopefully it is all on my passport back up- question is, how do I get it from the passport back to the macbook? Thanks!

  • How to download all spool order

    hello: i would like ask one favor, i make a program and i dicided to ejecuted in batch(because the ejecution could have many data), that bathc generated a job and spool order , but when i try to open it , the system send me a message, 'you will only