openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew T. Adams (Commented) (JIRA)" <>
Subject [jira] [Commented] (OPENJPA-888) Empty method in an entity causes errors while enhancing
Date Sat, 10 Mar 2012 20:58:57 GMT


Matthew T. Adams commented on OPENJPA-888:

Just hit this again myself:

[ERROR] Failed to execute goal org.codehaus.mojo:openjpa-maven-plugin:1.2:enhance (enhancer)
on project model: A type incompatibility occured while executing org.codehaus.mojo:openjpa-maven-plugin:1.2:enhance:
serp.bytecode.CodeEntry cannot be cast to serp.bytecode.Instruction
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.codehaus.mojo:openjpa-maven-plugin:1.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/matthew/.m2/repository/org/codehaus/mojo/openjpa-maven-plugin/1.2/openjpa-maven-plugin-1.2.jar
[ERROR] urls[1] = file:/home/matthew/.m2/repository/org/apache/openjpa/openjpa/2.1.1/openjpa-2.1.1.jar
[ERROR] urls[2] = file:/home/matthew/.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar
[ERROR] urls[3] = file:/home/matthew/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
[ERROR] urls[4] = file:/home/matthew/.m2/repository/net/sourceforge/serp/serp/1.13.1/serp-1.13.1.jar
[ERROR] urls[5] = file:/home/matthew/.m2/repository/org/apache/geronimo/specs/geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1.jar
[ERROR] urls[6] = file:/home/matthew/.m2/repository/commons-pool/commons-pool/1.5.4/commons-pool-1.5.4.jar
[ERROR] urls[7] = file:/home/matthew/.m2/repository/org/apache/geronimo/specs/geronimo-jpa_2.0_spec/1.1/geronimo-jpa_2.0_spec-1.1.jar
[ERROR] urls[8] = file:/home/matthew/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.7/plexus-utils-1.5.7.jar
[ERROR] urls[9] = file:/home/matthew/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] -----------------------------------------------------
[ERROR] -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following
[ERROR] [Help 1]

It's been several years since the first reporting of this bug & the associated Serp bug.
 Can you guys please fix this?
> Empty method in an entity causes errors while enhancing
> -------------------------------------------------------
>                 Key: OPENJPA-888
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2.0
>            Reporter: Simone Gianni
> I have a class subclassing another class. Both are entities. They have a method, which
has nothing to do with JPA cause it's not a getter o a setter. The subclass overrides this
method with an empty implementation, that is @Override public void theMethod() {} .
> As a result, OpenJPA throws an error while enhancing the subclass, more specifically
the stacktrace is relative at SERP internals :
> java.lang.ClassCastException: serp.bytecode.CodeEntry cannot be cast to serp.bytecode.Instruction
>         at serp.bytecode.Local.getEnd(
>         at serp.bytecode.Local.updateTargets(
>         at serp.bytecode.LocalTable.updateTargets(
>         at
>         at serp.bytecode.Attributes.readAttributes(
>         at
>         at
>         at serp.bytecode.Project.loadClass(
> Looking the Serp code and debugging it, I can confirm it is a SERP error, and opened
a bug on its tracker (
> I'm opening this bug here to track the problem, and eventually use an updated version
of SERP if/when they solve the problem.
> The most obvious workaround (which works) is to write something inside an empty method,
a plain "int i = 0" will do the job.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message