Note that there are some explanatory texts on larger screens.

plurals
  1. POjava.lang.VerifyError after running the DataNucleus Enhancer
    text
    copied!<p>I got a strange behavior after running the datanucleus enhancer. And then trying to generate the EntityManagerFactory, I ran in an java.lang.VerifyError, which is </p> <pre><code> method: setItem signature: (Ljava/lang/Object;)V) Incompatible argument to function" type="java.lang.VerifyError"&gt;java.lang.VerifyError: (class: de/suur/wr/generated/FlagType$FlagTypeRemoveFlagsItem, method: setItem signature: (Ljava/lang/Object;)V) Incompatible argument to function </code></pre> <p>The original declaration of the method is: </p> <pre><code> public void setItem(String value) { this.item = value; } </code></pre> <p>I figured out that java adds some synthetic bridge methods to the bytecode, which would indeed match the error (see below). But usually this methods can coexist peacefully. Maybe the error is not related to the enhancer at all, but however I have no other intuition I thought it is related. What could be the reasons? </p> <pre><code> // Method descriptor #53 (Ljava/lang/Object;)V // Stack: 2, Locals: 2 public bridge synthetic void setItem(java.lang.Object arg0); 0 aload_0 [this] 1 aload_1 [arg0] 2 checkcast java.lang.String [54] 5 invokevirtual de.suur.wr.generated.FlagType$FlagTypeRemoveFlagsItem.setItem(java.lang.String) : void [56] 8 return Line numbers: [pc: 0, line: 1] </code></pre> <p>and the original method:</p> <pre><code> // Method descriptor #36 (Ljava/lang/String;)V // Stack: 2, Locals: 2 public void setItem(java.lang.String value); 0 aload_0 [this] 1 aload_1 [value] 2 putfield de.suur.wr.generated.FlagType$FlagTypeRemoveFlagsItem.item : java.lang.String [33] 5 return Line numbers: [pc: 0, line: 314] [pc: 5, line: 315] Local variable table: [pc: 0, pc: 6] local: this index: 0 type: de.suur.wr.generated.FlagType.FlagTypeRemoveFlagsItem [pc: 0, pc: 6] local: value index: 1 type: java.lang.String </code></pre> <p>I'm used the datanucleus(DN) and the datanucleus maven plugin(DNM2) in servile combinations: (DN,DNM2) 1.1.4 , 2.0.0 and 2.1.1, 2.1.1 . The stacktrace is </p> <pre><code> at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) at java.lang.Class.getDeclaredMethods(Class.java:1791) at org.datanucleus.metadata.annotations.AbstractAnnotationReader.getJavaBeanAccessorAnnotationsForClass(AbstractAnnotationReader.java:238) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload