2

I am using the link below for byte enhancement:
https://vladmihalcea.com/hibernate-4-bytecode-enhancement/

I used Maven hibernate plugin – Enhance

<build>
  <plugins>
    <plugin>
      <groupId>org.hibernate.orm.tooling</groupId>
      <artifactId>hibernate-enhance-maven-plugin</artifactId>
      <executions>
        <execution>
          <phase>compile</phase>
          <goals>
            <goal>enhance</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

I have the following error below:

Failed to execute goal org.hibernate.orm.tooling:hibernate-enhance-maven-plugin:5.2.9.Final:enhance (default) on project MavenHibernateExample: Execution default of goal org.hibernate.orm.tooling:hibernate-enhance-maven-plugin:5.2.9.Final:enhance failed: Unable to load the mojo 'enhance' in the plugin 'org.hibernate.orm.tooling:hibernate-enhance-maven-plugin:5.2.9.Final' due to an API incompatibility:
org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/hibernate/orm/tooling/maven/MavenEnhancePlugin : Unsupported major.minor version 52.0

I took a look at the generated classes but the classes are the same as input - nothing is transient or modified. I am not sure what is going on here. I searched across the web but no luck. does anyone know?

Vlad Mihalcea
  • 142,745
  • 71
  • 566
  • 911
  • `Unsupported major.minor version 52.0` usually suggests that you have JRE version incompatibility. What JRE are you using? What is the minimum requirement for the plugin? – prasanth Apr 05 '17 at 00:28
  • http://stackoverflow.com/questions/22489398/unsupported-major-minor-version-52-0 – prasanth Apr 05 '17 at 00:28
  • Welcome to Stack Overflow! I've edited your question a bit - removed the "Thanks", because that's considered noise on Stack Overflow. (Yes, that may seem a little weird, but you'll get used to it). I also put the error message in "quote markdown". All in all, it's a well-asked question. Should you find more information, that can help us diagnose the problem, they by all means [edit] it into the question. Good luck, hope you'll get an answer! – S.L. Barth is on codidact.com Apr 05 '17 at 06:44
  • thanks! i did modify and it *seems* to not throw an error and i see:Successfully enhanced class [src.foo.App] Successfully enhanced class [src.foo.Main] Successfully enhanced class [src.foo.Person] Successfully enhanced class [src.foo.Item] . However, when i open the .class file with java decompiler i dont see any "enhanced" code as mentioned in the link i used. Any ideas what could be it? i am use mapping not annotations but i didnt see any references saying i have to use annotations. –  Apr 05 '17 at 15:28

0 Answers0