• Post Reply Bookmark Topic Watch Topic
  • New Topic

IncompatibleClassChangeError in servlet

 
yen hoang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm fresh man in web application. I'm trying to create sample project, but I have a problem that I can't solve
My web application is very simple, it has a html form with 2 field id and password, after user inputs and submits, two values are sent to a Servlet, named Login


and here are code of other relative classes


I tried many time, but it all results to error IncompatibleClassChangeError. And I tried to recompile all classes but everything stays the same
Please help me! Thanks!
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post your error message so I can see where exactly it chokes?

Also, do not use instance variables in Servlets. These are Singletons and used over multiple threads.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please watch your tone and use a meaningful subject. I have adjusted the title of this topic for you.
 
yen hoang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sebastian Janisch wrote:Could you post your error message so I can see where exactly it chokes?

Also, do not use instance variables in Servlets. These are Singletons and used over multiple threads.

Here is the error message

please tell my how to solve this error?
Thanks so much!
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Description

An IncompatibleClassChangeError or one of its subclasses is thrown when a class refers to another class in an incompatible way. This situation occurs when the current definition of the referenced class is incompatible with the definition of the class that was found when the referring class was compiled. For example, say class A refers to a method in class B. Then, after class A is compiled, the method is removed from class B. When class A is loaded, the run-time system discovers that the method in class B no longer exists and throws an error.


found on http://docstore.mik.ua/orelly/java/fclass/ch12_28.htm
 
yen hoang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sebastian Janisch wrote:
Description

An IncompatibleClassChangeError or one of its subclasses is thrown when a class refers to another class in an incompatible way. This situation occurs when the current definition of the referenced class is incompatible with the definition of the class that was found when the referring class was compiled. For example, say class A refers to a method in class B. Then, after class A is compiled, the method is removed from class B. When class A is loaded, the run-time system discovers that the method in class B no longer exists and throws an error.


found on http://docstore.mik.ua/orelly/java/fclass/ch12_28.htm

thanks in advance! I solved my problem!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!