After doing some more research I believe that the ant enhancer cannot enhance entities that are loaded from a jar classpath. Therfore I am changing the classpath of openjpa-foo to depend on the test-classes dir. of openjpa-persistence-jdbc.
Please correct me if I am wrong. --Thanks, Rohit Rohit Kelapure wrote: > > Dear All, > > I am writing my own L2 Cache Provider for OpenJPA 2.0. To test this > provider I am extending the > org.apache.openjpa.persistence.datacache.CacheTest abstract class. > > When executing CacheTest I need to enhance entities located in the > openjpa-persistence-jdbc project in > /src/test/java/org/apache/openjpa/persistence/datacache/common/apps > > I have copied the enhancer.xml for openjpa-persistence-jdbc to my own sub > project say open-jpa-foo > and I am calling the openjpa-persistence-jdbc enhancer from open-jpa-foo > like so... > <fileset id="enhance.path.ref" > > dir="../openjpa-persistence-jdbc/target/test-classes/org/apache/openjpa/persistence/datacache/common/apps"> > <include name="**/*.class" /> > ....... > ........ > </fileset> > > When running persistence-jdbc enhancer from my sub-project I see the > following error : > 06 xml-persistence-unit WARN [main] openjpa.Enhance - Type "class > org.apache.openjpa.persistence.datacache.common.apps.AttachB" has no > metadata; enhancing > s persistence aware. If you intended for "class > org.apache.openjpa.persistence.datacache.common.apps.AttachB" to be > persistence-capable, then this means that OpenJPA could not find any > metadata for "class > org.apache.openjpa.persistence.datacache.common.apps.AttachB". This can > happen if the directory containing your metadata is not in your CLASSPATH, > or if your metadata files are not named properly. See the documentation on > metadata placement for more information. > > java.io.FileNotFoundException: file:\C:\Documents and > Settings\Administrator\.m2\repository\org\apache\openjpa\openjpa-persistence-jdbc\2.0.0-SNAPSHOT\openjpa-p > sistence-jdbc-2.0.0-SNAPSHOT-tests.jar!\org\apache\openjpa\persistence\datacache\common\apps\AttachB.class > (The filename, directory name, or volume label syntax is incorrect.) > at java.io.FileOutputStream.<init>(FileOutputStream.java:179) > at java.io.FileOutputStream.<init>(FileOutputStream.java:70) > at serp.bytecode.BCClass.write(BCClass.java:179) > at org.apache.openjpa.enhance.PCEnhancer.record(PCEnhancer.java:595) > at org.apache.openjpa.enhance.PCEnhancer.record(PCEnhancer.java:581) > at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4609) > at > org.apache.openjpa.ant.PCEnhancerTask.executeOn(PCEnhancerTask.java:89) > at > org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:171) > at > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > I see similar WARN messages when the enhancer in persistence-jdbc is run; > however the enhancer just keeps moving on. When I run the enhancer from > the sub-project the enhancer just dies with the above exception. > > I have confirmed that AttachB.class does indeed exist in C:\Documents and > Settings\Administrator\.m2\repository\org\apache\openjpa\openjpa-persistence-jdbc\2.0.0-SNAPSHOT\openjpa-persistence-jdbc-2.0.0-SNAPSHOT-tests.jar\org\apache\openjpa\persistence\datacache\common\apps\ > > Can someone explain this issue. How do I run one project's enhancer from > some other project. > Is there a better way to test with CacheTest. ? > > Appreciate your help in this matter. > > --Thanks, > Rohit Kelapure > -- View this message in context: http://n2.nabble.com/Error-running-enhancer-tp3807918p3808733.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
