-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: EnhancementException with Enums
PostPosted: Thu Jan 02, 2014 4:16 pm 
Newbie

Joined: Thu Apr 10, 2008 9:09 am
Posts: 5
Hi,

on enhancing my entity classes with the (new) gradle plugin, i am getting this:

Unable to enhance class [/Users/ml/Development/java/projects/Netstorsys/build/classes/main/de/logentis/bwh/model/ConsignmentImport.class]
org.hibernate.bytecode.enhance.EnhancementException: Unable to enhance persistent attribute [de.logentis.bwh.model.ConsignmentImport:consignmentType]
at org.hibernate.bytecode.enhance.spi.Enhancer.enhancePersistentAttribute(Enhancer.java:367)
at org.hibernate.bytecode.enhance.spi.Enhancer.enhancePersistentAttributes(Enhancer.java:346)
at org.hibernate.bytecode.enhance.spi.Enhancer.enhanceAsEntity(Enhancer.java:257)
at org.hibernate.bytecode.enhance.spi.Enhancer.enhance(Enhancer.java:243)
at org.hibernate.bytecode.enhance.spi.Enhancer.enhance(Enhancer.java:177)
at org.hibernate.bytecode.enhance.spi.Enhancer$enhance.call(Unknown Source)
at org.hibernate.tooling.gradle.EnhancerTask$_enhance_closure1.doCall(EnhancerTask.groovy:76)
at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
at groovy.lang.Closure.call(Closure.java:412)
at groovy.lang.Closure.call(Closure.java:425)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1376)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1348)
at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.hibernate.tooling.gradle.EnhancerTask.enhance(EnhancerTask.groovy:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:530)

ConsignmentType is defined as following:

@Basic
@Enumerated(EnumType.STRING)
@Column(name = "constype")
ConsignmentType consignmentType;

Also for other enums. Is there something i miss regarding enums? I just switched from openjpa to Hibernate and with openjpa enhancement, i ve never had issues with Enums.

Thanks for infos.

Marc


Top
 Profile  
 
 Post subject: Re: EnhancementException with Enums
PostPosted: Thu Jan 02, 2014 6:27 pm 
Newbie

Joined: Thu Apr 10, 2008 9:09 am
Posts: 5
Dont know if its a enum issue. I get also errors like this one:

Caused by: javassist.NotFoundException: de.netstorsys.domain.enums.ConfigurationKey
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

or

Caused by: org.hibernate.bytecode.enhance.EnhancementException: Could not enhance entity class [de.netstorsys.domain.ConsignmentOrder] to add field writer method [$$_hibernate_write_consignmentImport]
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.logentis.bwh.model.ConsignmentImport) not found in de.logentis.bwh.model.ConsignmentImport
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
Caused by: compile error: equals(de.logentis.bwh.model.ConsignmentImport) not found in de.logentis.bwh.model.ConsignmentImport


Looks like a classpath issue which shouldnt be there because of gradle style convention behavior. Anyone there with Gradle Plugin experience?

MArc


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.