|
Strong Liu, as you suggested, this appears to boil down to CL issues.
Exception caught while executing command
org.hibernate.AssertionFailure: The annotation javax.persistence.GeneratedValue does not define a parameter 'generator'
at org.hibernate.metamodel.internal.source.annotations.util.JandexHelper.getDefaultValue(JandexHelper.java:518)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.source.annotations.util.JandexHelper.getValue(JandexHelper.java:116)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.source.annotations.attribute.BasicAttribute.checkGeneratedValueAnnotation(BasicAttribute.java:331)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.source.annotations.attribute.BasicAttribute.<init>(BasicAttribute.java:141)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.source.annotations.attribute.BasicAttribute.createSimpleAttribute(BasicAttribute.java:110)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.source.annotations.entity.ConfiguredClass.createMappedAttribute(ConfiguredClass.java:500)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.source.annotations.entity.ConfiguredClass.collectAttributes(ConfiguredClass.java:352)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.source.annotations.entity.ConfiguredClass.<init>(ConfiguredClass.java:194)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.source.annotations.entity.ConfiguredClass.<init>(ConfiguredClass.java:168)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.source.annotations.entity.EntityClass.<init>(EntityClass.java:116)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.source.annotations.entity.RootEntityClass.<init>(RootEntityClass.java:101)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.source.annotations.util.EntityHierarchyBuilder.createEntityHierarchies(EntityHierarchyBuilder.java:124)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.source.annotations.AnnotationMetadataSourceProcessorImpl.extractEntityHierarchies(AnnotationMetadataSourceProcessorImpl.java:117)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.MetadataImpl.processMappings(MetadataImpl.java:484)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.MetadataImpl.<init>(MetadataImpl.java:252)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.metamodel.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:175)[71:org.hibernate.core:5.0.0.SNAPSHOT]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:982)[72:org.hibernate.entitymanager:5.0.0.SNAPSHOT]
at org.hibernate.osgi.OsgiPersistenceProvider.createEntityManagerFactory(OsgiPersistenceProvider.java:96)[73:org.hibernate.osgi:5.0.0.SNAPSHOT]
at org.hibernate.osgitest.HibernateUtil.getEntityManagerFactory(HibernateUtil.java:53)[74:org.hibernate.osgi.unmanaged-jpa:1.0.0]
at org.hibernate.osgitest.HibernateUtil.getEntityManager(HibernateUtil.java:41)[74:org.hibernate.osgi.unmanaged-jpa:1.0.0]
at org.hibernate.osgitest.DataPointServiceImpl.add(DataPointServiceImpl.java:35)[74:org.hibernate.osgi.unmanaged-jpa:1.0.0]
at org.hibernate.osgitest.command.AddCommand.execute(AddCommand.java:40)[74:org.hibernate.osgi.unmanaged-jpa:1.0.0]
at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[14:org.apache.karaf.shell.console:2.3.0]
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[14:org.apache.karaf.shell.console:2.3.0]
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0]
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0]
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:org.apache.karaf.shell.console:2.3.0]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:org.apache.karaf.shell.console:2.3.0]
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[14:org.apache.karaf.shell.console:2.3.0]
at org.apache.karaf.shell.console.jline.Console.run(Console.java:175)[14:org.apache.karaf.shell.console:2.3.0]
at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]
Caused by: java.lang.ClassNotFoundException: javax.persistence.GeneratedValue not found by wrap_mvn_org.jboss_jandex_1.1.0.Alpha1 [68]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)[org.apache.felix.framework-4.0.3.jar:]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)[org.apache.felix.framework-4.0.3.jar:]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)[org.apache.felix.framework-4.0.3.jar:]
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
at org.hibernate.metamodel.internal.source.annotations.util.JandexHelper.getDefaultValue(JandexHelper.java:504)[71:org.hibernate.core:5.0.0.SNAPSHOT]
... 31 more
Jandex is not able to find the JPA annotations. EntityManagerFactoryBuilderImpl#build utilizes "withTccl" for the old Configuration, but not when "usingNewMetadata" is true. I know "withTccl" was supposed to be a temporary band-aid. However, we still need some way to override TCCL when calling a 3rd party lib and relying on a solution like OsgiClassLoader.
Steve Ebersole, thoughts?
|