View Single Post
  #6 (permalink)  
Old July 11th, 2012, 11:44 AM
santbir santbir is offline
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem in calling classes in simple Servlet

Hello Jomet,

I am facing the same problem. And also tried both ways but i am not successfull. I don't know why??

I have one servlet (Register.java)
and a java class(Function.java)

First I compiled Function.java successfully but
When i compiling Register.java its giving me error Function class not found

In both way :-

1. javac -cp . *.java or javac -classpath . *.java

2. copying the class path where my from my tomcat path like:-

C:\Program Files (x86)\Apache Software Foundation\Apache Tomcat 7.0.22\webapps\loginnapp\WEB-INF\classes

but in both cases i am getting a common error:-

import javax.servlet.*;
^
Register.java:4: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
Register.java:5: package javax.servlet does not exist
import javax.servlet.*;
^
Register.java:8: cannot find symbol
symbol: class HttpServlet
public class Register extends HttpServlet
^
Register.java:10: cannot find symbol
symbol : class HttpServletRequest
location: class Register
public void doGet(HttpServletRequest req, HttpServletResponse res) throw
s IOException, ServletException
^
Register.java:10: cannot find symbol
symbol : class HttpServletResponse
location: class Register
public void doGet(HttpServletRequest req, HttpServletResponse res) throw
s IOException, ServletException
^
Register.java:10: cannot find symbol
symbol : class ServletException
location: class Register
public void doGet(HttpServletRequest req, HttpServletResponse res) throw
s IOException, ServletException

^
Register.java:28: cannot access Functions
bad class file: .\Functions.class
class file contains wrong class: classes.Functions
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
Functions fe=new Functions();
^
8 errors


please help me friends i m stuck
Reply With Quote