I have a running Gradle Java Project which compiles fine and so far i worked with a different JPA provider and also did the enhancement via a gradle task. Now i want to switch to hibernate and added the just recently added Gradle Enhancement PLugin by hibernate (of course i removed my openJPA enhancement task).
I am getting lots of weird problem on enhancements like these.
Caused by: javassist.NotFoundException: de.netstorsys.domain.Store at javassist.ClassPool.get(ClassPool.java:450) at javassist.bytecode.Descriptor.toCtClass(Descriptor.java:592) at javassist.bytecode.Descriptor.toCtClass(Descriptor.java:542) at javassist.CtField.getType(CtField.java:371) at org.hibernate.bytecode.enhance.spi.Enhancer.resolveAttributeTypeDescriptor(Enhancer.java:1103) at org.hibernate.bytecode.enhance.spi.Enhancer.enhancePersistentAttribute(Enhancer.java:358) ... 112 more
Caused by: org.hibernate.bytecode.enhance.EnhancementException: Could not enhance entity class [de.netstorsys.domain.StorageHistory] to add field writer method [$$_hibernate_write_article] at org.hibernate.bytecode.enhance.spi.Enhancer.generateFieldWriter(Enhancer.java:916) at org.hibernate.bytecode.enhance.spi.Enhancer.enhancePersistentAttribute(Enhancer.java:359) ... 112 more Caused by: javassist.CannotCompileException: [source error] equals(de.netstorsys.domain.Article) not found in de.netstorsys.domain.Article at javassist.CtBehavior.insertBefore(CtBehavior.java:774) at javassist.CtBehavior.insertBefore(CtBehavior.java:734) at org.hibernate.bytecode.enhance.spi.Enhancer.generateFieldWriter(Enhancer.java:879) ... 113 more
It looks like a classloader issue because of these NotFound Exceptions. But as you can imagine, with Gradle one doesnt fiddle around with classpaths and stuff. I am using vanilla Java plugin and all paths are at default locations. javac works like a charm....
|