I was fiddling with a couple sample applications to use with
they each wrap a Google OpenSocial Gadget to
provide the social networking UI.
So I had a couple new web apps that I created with NetBeans. With the jMaki plugin, I dragged some
SocialSite widgets into the pages and ran the projects.
"Unable to create an
instance of jmaki.widgets.socialsite.search.Widget. Enable logging for more
details.." Oops. Turning on debugging in jMaki's
at my web root, I see that the gadgetizer-core.js file on which the widgets rely
was not found. In fact, it was missing from my project completely, when it should
have been copied into /resources/socialsite/resources in my web root as described
All of the SocialSite widgets live in /resources/socialsite/widget-name-here, and
each depends on a file, by convention, in /resources/socialsite/resources/. I can
specify this file in a widget.json configuration file, and two things are
supposed to happen. First, the jMaki plugin for my IDE copies this file into
the web app when I add a widget. Second, the jMaki runtime loads this file
page is viewed. In my case, I see that my resources aren't being added properly
in my web apps. Even after I add them manually, I still see errors with
the file not found in certain web frameworks.
The culprit? Well, I guess I am. I wrote the original widget.json files for
our widgets, and somewhere along the way I messed up one tiny detail. Here is
the widget.json file for our search widget. This version works:
'name': 'Search Widget',
'description': 'Let\\'s a user search for people and/or groups .',
What I had, however, was a URL in the config entry that was relative to the root
of the web app:
While this worked at runtime for some JSP apps, it failed in other cases where
the routing to resource balked at the path I was using. Looking through some existing
jMaki widgets (if using NetBeans, you can see all the code in
$HOME/.netbeans/<version>/jmakicomplib), I found my mistake. I probably took some hasty notes early in our development, or somewhere along the way the files
or jMaki changed.
We hope that Project SocialSite, besides being a useful addition to your own sites,
also serves as a good example for writing your own Google Gadgets and/or jMaki widgets.
If you're following along, though, make sure you pick up this change. Learning from
your mistakes is good; learning from my mistakes saves you time.