The embedded appclient is not supported in v2. And in v3, it currently has an issue, which we are working on. Until then, you could try deploying the java class as an appclient and invoke it using the appclient CLI.
[Message sent by forum member 'nitkal' (nithya.subramanian_at_sun.com)]
http://forums.java.net/jive/thread.jspa?messageID=390114