surinder-insonix / datanucleus-appengine

Automatically exported from code.google.com/p/datanucleus-appengine
0 stars 0 forks source link

cannot persist classes in external jars #235

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Ok I have been looking for days for an answer, so I am going to post an issue 
here:

My scenario is this.

I have an app engine project which uses annotated classes which are embedded in 
an external jar.  when ever i try to persist these classes i get a 
ClassNotPersistableException.  

If copy these classes to my app engine project and then try to persist them it 
works like a charm ...  so it looks like jdo, datanucleus or whatever is not 
able to see annotations when they are embedded in external jars.

I am at a loss as to how to fix this problem though.  I would be gratefull for 
any ideas.

cheers

Original issue reported on code.google.com by Ib.Ros...@gmail.com on 18 Jun 2011 at 3:02

GoogleCodeExporter commented 8 years ago
The log (at debug level) would tell you what DataNucleus can see. Obviously you 
cannot enhance a class that is part of a jar, and neither does the DataNucleus 
docs claim that you can. Unpack your jar (easiest), or enhance using javaagent.

Original comment by googleco...@yahoo.co.uk on 20 Jun 2011 at 12:28

GoogleCodeExporter commented 8 years ago
Hi thanks for the quick response.  I am actually a C# developer (just playing 
with Java). which may be why I am unfamiliar with the whole concept of 
enhancing classes.

Anyway I figured out a solution yesterday.  for anyone else interested I 
downloaded the Dataneucleus plugin for eclipse and ran that over my library 
project. I was then able to export the project  with the enhancements included 
inside the exported Jar.  the only tricky bit i found was that you need to 
press F5 after the enhancement sometimes or you will get an error when doing 
the export.

anyway thanks for all your help.

cheers

Original comment by Ib.Ros...@gmail.com on 20 Jun 2011 at 12:36

GoogleCodeExporter commented 8 years ago

Original comment by googleco...@yahoo.co.uk on 26 Jun 2011 at 5:57

GoogleCodeExporter commented 8 years ago
But is there any doc in DataNucleus could not enhance a class which is in a jar 
package?

Original comment by ed...@66fabu.com on 22 Jan 2012 at 3:05