You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chris Schild <ch...@corridortechnology.com> on 2003/01/23 23:35:18 UTC
Compile error: class file contains wrong class, bad class file???
Hi all, here is the error I get...
C:\Java\JCreator LE\MyProjects\Email\Email.java:16: cannot access ServletConfig
bad class file: C:\Java\servlet-2_3\javax\servlet\ServletConfig.class
class file contains wrong class: javax.servlet.ServletConfig
Please remove or make sure it appears in the correct subdirectory of the classpath.
code:
------------------------------------------------------------------------------
public void init(ServletConfig config) throws ServletException ^1 error
------------------------------------------------------------------------------
I have searched for answer but I get nothing?!?
The classpath is set correctly - C:\Java\classes;C:\Java\javamail-1_3\mail.jar;C:\Java\jaf-1_0_2\activation.jar;C:\Java\servlet-2_3\javax\servlet;C:\Java\jsp-1_2\servlet.jar
I can't think of anything else....
Any suggestions?
Here is the code up to the error:
code:
------------------------------------------------------------------------------
// import the JavaMail packagesimport javax.mail.*;import javax.mail.internet.*; // import the servlet packagesimport javax.servlet.*;import javax.servlet.http.*; // import misc classes that we needimport java.util.*;import java.io.*; public class Email extends HttpServlet { String smtpServer; public void init(ServletConfig config) throws ServletException { super.init(config); // get the SMTP server from the servlet properties smtpServer = config.getInitParameter("smtpServer"); } public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {I get this error whether it is from the DOS cmd line or from the case tool JCreator???Anybody know about this???
Re: Compile error: class file contains wrong class, bad class file???
Posted by Chris Schild <ch...@corridortechnology.com>.
Sorry, I figured it out. When I installed the Tomcat directory under
Apache. The compiler was picking up %tomcat_home%/servlet.jar instead of
the servlet2_03/servlet.jar defined in the classpath....
ooopsss.
----- Original Message -----
From: "Chris Schild" <ch...@corridortechnology.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, January 23, 2003 4:35 PM
Subject: Compile error: class file contains wrong class, bad class file???
Hi all, here is the error I get...
C:\Java\JCreator LE\MyProjects\Email\Email.java:16: cannot access
ServletConfig
bad class file: C:\Java\servlet-2_3\javax\servlet\ServletConfig.class
class file contains wrong class: javax.servlet.ServletConfig
Please remove or make sure it appears in the correct subdirectory of the
classpath.
code:
----------------------------------------------------------------------------
--
public void init(ServletConfig config) throws ServletException
^1 error
----------------------------------------------------------------------------
--
I have searched for answer but I get nothing?!?
The classpath is set correctly -
C:\Java\classes;C:\Java\javamail-1_3\mail.jar;C:\Java\jaf-1_0_2\activation.j
ar;C:\Java\servlet-2_3\javax\servlet;C:\Java\jsp-1_2\servlet.jar
I can't think of anything else....
Any suggestions?
Here is the code up to the error:
code:
----------------------------------------------------------------------------
--
// import the JavaMail packagesimport javax.mail.*;import
javax.mail.internet.*; // import the servlet packagesimport
javax.servlet.*;import javax.servlet.http.*; // import misc classes that we
needimport java.util.*;import java.io.*; public class Email extends
HttpServlet { String smtpServer; public void init(ServletConfig
config) throws ServletException { super.init(config);
// get the SMTP server from the servlet properties smtpServer =
config.getInitParameter("smtpServer"); } public void
doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {I get this error whether it is from
the DOS cmd line or from the case tool JCreator???Anybody know about this???
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>