Hey, Roo add-on people...
I am wondering if this is me - I am putting together a jqueryui add-on as a sample for the upcoming MEAP add-on chapter of Roo in Action. I am working in trunk, because by the time the book is finished and published we'll all be on the 1.2 line, and I would like to be as accurate as possible.
I'm not sure if I'm doing something wrong, or if there is a bug in the metadata container. I used addon create simple to set up my add-on, and am busy copying files into the project structure to install jQuery. Looking through the other add-ons, I'm extending the AbstractOperations class to provide file directory copy commands, but it's failing in this simple add-on.
The OperationsImpl class is defined this way:
Then, in a command (for the curious, jqueryui setup), I do this:Code:@Component @Service public class JqueryuiOperationsImpl extends AbstractOperations implements JqueryuiOperations { private static final char SEPARATOR = File.separatorChar;
Incidentally, for those getting started, quick tip: you can always add the debugging flags to your roo.sh script:Code:String webappPath = projectOperations.getPathResolver().getIdentifier(Path.SRC_MAIN_WEBAPP, "/"); copyDirectoryContents("js/*.js", webappPath + "js", true); copyDirectoryContents("images/*.png", webappPath + "images", true); copyDirectoryContents("style/*.css", webappPath + "css", true);
and then use the remote debugger to run. I'm using the osgi start and osgi uninstall commands to add and remove the add-on bundles. Don't forget the development mode command to turn on stack traces.Code:# Hop, hop, hop... java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 \ -Dis.apple.terminal=$APPLE_TERMINAL $ROO_OPTS -Droo.args="$*" -DdevelopmentMode=false -Dorg.osgi.framework.storage="$ROO_
Anyhoo...
I get a NPE because when the projectOperations asks for the path resolver, via the Project Meta-Data, it gets hung up looking for the meta-data and returns a null. Therefore the projectOperations.getPathResolver() call is null, which throws a null pointer exception for the .getIdentifier() method. Seems like the metadata isn't there.
I am using the nightly CI build of 1.2 from 8/7. I would be happy to share my add-on code (as I plan on donating it with roobot once the chapter is going).
Soooo.... is this a bug or something I'm doing wrong?
Thanks,
Ken


Reply With Quote
