Hi, We are trying to do build-time enhancement of our JPA entity classes as per the instructions given at http://openjpa.apache.org/entity-enhancement.html. We use OSGi blueprint specification . We use gradle as our build tool and using the instructions in the link above, we invoke the corresponding ant task from gradle to do the build -time enhancement. All our entity classes are not packaged as part of persistence bundles which means that all of them do not have persistence.xml inside their java projects. We tried to do build-time enhancement using the above and got the following error:
To see all tasks and more detail, run with --all. :com.ibm.sc.core.persistence:enhance [ant:openjpaenhancer] <openjpa-2.2.1.1-SNAPSHOT-r422266:1431746 fatal user error> org.apache.openjpa.util.MetaDataException: MetaDataFactory could not be configured (conf.newMetaDat aFactoryInstance() returned null). This might mean that no configuration properties were found. Ensure that you have a META-INF/persistence.xml file , that it is available in your cl asspath, or that the properties file you are using for configuration is available. If you are using Ant, please see the <properties> or <propertiesFile> attributes of the task's nes ted <config> element. This can also occur if your OpenJPA distribution jars are corrupt, or if your security policy is overly strict. [ant:openjpaenhancer] at org.apache.openjpa.meta.MetaDataRepository.initializeMetaDataFactory (MetaDataRepository.java:1940) [ant:openjpaenhancer] at org.apache.openjpa.meta.MetaDataRepository.endConfiguration (MetaDataRepository.java:1921) [ant:openjpaenhancer] at org.apache.openjpa.lib.conf.Configurations.configureInstance (Configurations.java:531) [ant:openjpaenhancer] at org.apache.openjpa.lib.conf.Configurations.configureInstance (Configurations.java:456) [ant:openjpaenhancer] at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104) [ant:openjpaenhancer] at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate (MetaDataRepositoryValue.java:68) [ant:openjpaenhancer] at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83) [ant:openjpaenhancer] at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance (OpenJPAConfigurationImpl.java:967) [ant:openjpaenhancer] at org.apache.openjpa.ant.PCEnhancerTask.executeOn (PCEnhancerTask.java:88) [ant:openjpaenhancer] at org.apache.openjpa.lib.ant.AbstractTask.execute (AbstractTask.java:184) [ant:openjpaenhancer] at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:291) [ant:openjpaenhancer] at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) [ant:openjpaenhancer] at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:88) [ant:openjpaenhancer] at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:55) [ant:openjpaenhancer] at java.lang.reflect.Method.invoke(Method.java:613) [ant:openjpaenhancer] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [ant:openjpaenhancer] at groovy.util.AntBuilder.performTask (AntBuilder.java:260) [ant:openjpaenhancer] at groovy.util.AntBuilder.nodeCompleted (AntBuilder.java:220) [ant:openjpaenhancer] at org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted (BasicAntBuilder.java:71) [ant:openjpaenhancer] at groovy.util.BuilderSupport.doInvokeMethod (BuilderSupport.java:147) [ant:openjpaenhancer] at groovy.util.AntBuilder.doInvokeMethod (AntBuilder.java:170) [ant:openjpaenhancer] at org.gradle.api.internal.project.ant.BasicAntBuilder.doInvokeMethod (BasicAntBuilder.java:86) [ant:openjpaenhancer] at groovy.util.BuilderSupport.invokeMethod (BuilderSupport.java:64) [ant:openjpaenhancer] at org.gradle.api.internal.project.DefaultAntBuilder.super$3$invokeMethod (DefaultAntBuilder.groovy) [ant:openjpaenhancer] at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) [ant:openjpaenhancer] at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:88) [ant:openjpaenhancer] at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:55) [ant:openjpaenhancer] at java.lang.reflect.Method.invoke(Method.java:613) [ant:openjpaenhancer] at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) [ant:openjpaenhancer] at groovy.lang.MetaMethod.doMethodInvoke (MetaMethod.java:233) [ant:openjpaenhancer] at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:1047) [ant:openjpaenhancer] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN (ScriptBytecodeAdapter.java:128) [ant:openjpaenhancer] at org.gradle.api.internal.project.DefaultAntBuilder.invokeMethod (DefaultAntBuilder.groovy:37) [ant:openjpaenhancer] at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call (PogoMetaClassSite.java:45) [ant:openjpaenhancer] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall (CallSiteArray.java:42) [ant:openjpaenhancer] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call (AbstractCallSite.java:108) [ant:openjpaenhancer] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call (AbstractCallSite.java:116) [ant:openjpaenhancer] at build_5vocoggfukrck9di6s4cdq8vda $_run_closure39_closure102.doCall(C:\Soumitra\IBM\Security Control\TS GA2 _ CMVC\src\powersc\ts\server\build.gradle:602) [ant:openjpaenhancer] at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) [ant:openjpaenhancer] at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:88) [ant:openjpaenhancer] at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:55) [ant:openjpaenhancer] at java.lang.reflect.Method.invoke(Method.java:613) [ant:openjpaenhancer] at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) [ant:openjpaenhancer] at groovy.lang.MetaMethod.doMethodInvoke (MetaMethod.java:233) [ant:openjpaenhancer] at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod (ClosureMetaClass.java:272) [ant:openjpaenhancer] at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:877) Can build time enhancement be done on any class or does it have to be necessarily a JPA persistence bundle with a persistence.xml ? i e Is persistence.xml a pre-requisite to do build time enhancement or can it be done on JPA entity classes which are packaged without persistence.xml ( i e as simple OSGi projects) ? Thanks & Regards, Divya
