The only solution to this if using grails appears to be run the ant task that google supply to enhance the classes; but this isn't initially obvious.
A bit of googling and the solution came up as being that if using Eclipse you needed to have the Google Plugin for Eclipse installed. This itself wasn't entirely helpful as the plugin was installed so why wasn't it working? Well since I'm using the grails app-engine plugin the project had been created outside Eclipse and wasn't linked to the plugin. Right clicking on the project and going:
Google -> App Engine Settings and selecting Use Google App Engine
Resulted in the output DataNucleus Enhancer starting to run.
DataNucleus Enhancer (version 1.1.4) : Enhancement of classes
DataNucleus Enhancer completed with success for 0 classes. Timings : input=43 ms, enhance=0 ms, total=43 ms. Consult the log for full details
DataNucleus Enhancer completed and no classes were enhanced. Consult the log for full details
DataNucleus Enhancer completed with success for 0 classes. Timings : input=43 ms, enhance=0 ms, total=43 ms. Consult the log for full details
DataNucleus Enhancer completed and no classes were enhanced. Consult the log for full details
So now that it was running why weren't any of the classes being enhanced? Well it seemed likely that this is due to the groovy files not being picked up by the google plugin and indeed there's a defect raised on googleappengine for the plugin not working on anything other than .java files.
Fortunately google provide another method in the ant task; not surprising it turns out that the Grails app-engine plugin makes use of this when you deploy the project. So what does this mean? Basically until the Google plugin picks up other source files than just .java you'll need to make sure that you use the grails app-engine plugin from the command line and not the Google Eclipse plugin.
For reference the exception that kept getting thrown was:
Error 500: javax.jdo.JDOFatalUserException: No meta data for com.maxieduncan.download.DownloadCount. Perhaps you need to run the enhancer on this class? NestedThrowables: org.datanucleus.exceptions.NucleusUserException: No meta data for com.maxieduncan.download.DownloadCount. Perhaps you need to run the enhancer on this class?
Servlet: grails
URI: /grails/software/download.dispatch
Exception Message: No meta data for com.maxieduncan.download.DownloadCount. Perhaps you need to run the enhancer on this class?
Caused by: javax.jdo.JDOFatalUserException: No meta data for com.maxieduncan.download.DownloadCount. Perhaps you need to run the enhancer on this class? NestedThrowables: org.datanucleus.exceptions.NucleusUserException: No meta data for com.maxieduncan.download.DownloadCount. Perhaps you need to run the enhancer on this class?
Servlet: grails
URI: /grails/software/download.dispatch
Exception Message: No meta data for com.maxieduncan.download.DownloadCount. Perhaps you need to run the enhancer on this class?
Caused by: javax.jdo.JDOFatalUserException: No meta data for com.maxieduncan.download.DownloadCount. Perhaps you need to run the enhancer on this class? NestedThrowables: org.datanucleus.exceptions.NucleusUserException: No meta data for com.maxieduncan.download.DownloadCount. Perhaps you need to run the enhancer on this class?
No comments:
Post a Comment