This suggests that the extension descriptor is not on classpath. Usually an
extension is bundled as a jar, which contains the descriptor. So if you are
using this jar, it should work. If you are using an exploded form, then
make sure the descriptor is on classpath.

2015-07-02 17:51 GMT+02:00 Ralph Johnson <[email protected]>:

> I'm using a package called gprof that profiles Groovy code, and it has
> been very useful.
>
> You are supposed to be able to write
>
> profile {your code goes here}.prettyPrint()
>
> and it will print out a profile of your code on the console.   But that
> doesn't work for me.  I read the code and found what I thought was the
> definition of "profile" in ProfileStaticExtension
>
> Its definition is
>
> public class ProfileStaticExtension {
>
>     static Report profile(Object selfType, Callable profiled) {
>
>         return new Profiler().run(profiled);
>
>     }
>
>     static Report profile(Object selfType, Map options, Callable
> profiled) {
>
>         return new Profiler().run(options, profiled);
>
>     }
>
> }
>
> So, I tried writing
>
> ProfileStaticExtension.profile(null, {your code goes here}).prettyPrint()
>
> and that worked!   Do you have any idea why the syntax that they
> advertised doesn't work?  It certainly is a nicer syntax than what I am
> using.  I'm using it in Eclipse and I thought maybe I had the class path
> set up incorrectly, but it looks good to me.
>
> new Profiler.profile({your code here}).prettyPrint() works, too.
>

Reply via email to