Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #33953

Re: java.lang.IncompatibleClassChangeError: Implementing class

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: java.lang.IncompatibleClassChangeError: Implementing class
Date 2016-03-13 15:54 -0400
Organization A noiseless patient Spider
Message-ID <nc4gc4$icf$1@dont-email.me> (permalink)
References <f5f2fcec-9002-432b-b4b9-15aed038e052@googlegroups.com>

Show all headers | View raw


On 3/13/2016 3:24 PM, mike wrote:
> Hi,
>
> I posted this in the group mockito.
>
> https://groups.google.com/forum/#!topic/mockito/iJHYQEh9Z3I
>
> I ran the same test cases with maven and the old version of the mocked object.
> That did not give "java.lang.IncompatibleClassChangeError: Implementing class" message.
>
> What I suspect is that I have done something in my mocked class that does not make it thread-safe anymore. Does it have to be in my mocked class or in the class it extends. To me the error message does not give me any pointers.

     Just guessing, because I've never encountered this particular
error (nor do I use Maven), BUT it doesn't appear to me that lack
of thread safety is a cause of the problem.  The JVM Specification
<http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-5.html>
describes various causes of IncompatibleClassChangeError, and they
all seem to be involved with troubles that arise while loading,
linking, or initializing a class (or interface) that the JVM hasn't
yet seen.  If the error occurs so early in the class' life cycle,
then none of the class' code has yet had a chance to execute -- so
whatever bugs might lie in that code have not yet come into play.

     Still guessing (maybe "speculating" would be better): You mention
an "old version" of your object, suggesting that there's more than
one version floating around.  And maybe there are multiple versions
of some other classes in play, too.  Could it be that Maven has an
old version of class X in a cache somewhere, and that the old X is
incompatible with the new Y you're trying to load?

     As I said: Just guessing.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

java.lang.IncompatibleClassChangeError: Implementing class mike <mikaelpetterson@hotmail.com> - 2016-03-13 12:24 -0700
  Re: java.lang.IncompatibleClassChangeError: Implementing class Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-03-13 15:54 -0400
    Re: java.lang.IncompatibleClassChangeError: Implementing class mike <mikaelpetterson@hotmail.com> - 2016-03-14 07:50 -0700

csiph-web