• Post Reply Bookmark Topic Watch Topic
  • New Topic

Compile error: class file contains wrong class, bad class file???

 
darren schild
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

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:
[ edited to help preserve formatting by surrounding code with the [code] and [/code] UBB Tags -ds ]
[ January 23, 2003: Message edited by: Dirk Schreckmann ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at Roedy Green's List of Compiler Error Messages for reasons why this type of error occurs. You may have a problem somehow with your J2EE installation that a reinstall could clear up.
Any luck?
 
darren schild
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't see much as far as the error msg.
I may try reinstalling java/servlet-2_3 and see what happens...
Any other ideas? Has anyone seen this before?
 
darren schild
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One other question...
Would defining servlet-2_3 & jsp-1_2 in java_home/jre/lib/ext be an issue?
Should I define them seperately and add them to the classpath or define them in the ../ext folder???
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't see much as far as the error msg.
If you search the page using "remove", you should notice four error messages suggesting similar resolutions.
I don't think anything needs to be added to your java ext directory. I would guess that somehow you've a problem with part of the J2EE library.
I'll move this to the Servlets forum. Somebody there is probably more likely to have experienced this same problem.
 
darren schild
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it.... I had servlet.jar in the Tomcat directory. Guess the compiler didn't like 2 different versions of that one.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!