Skip to main content

Where is the error log and how do I view it?

5 replies [Last post]
bowmanmc
Offline
Joined: 2007-05-06

Hello!

I am writing a jMaki widget and I keep getting the error:

"Unable to create instance of foo.bar.TabPanel.Widget. See error log for more details."

Where is this error log and how do I view it? No errors show up in the firebug console...

Thanks!
-Michael

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmurray71
Offline
Joined: 2003-07-31

Hi,

This error is caused by 1 of two things:

1. The constructor for your widget was not found.

Constructor names for jmaki widgets must be namespaced under:

jmaki.widgets.WIDGET_PATH.Widget

So in your case for a widdget named "foo.bar.TabPanel" the constructor must be :

jmaki.widgets.foo.bar.TabPanel.Widget = function(wargs) {
jmaki.debug = true; // turns on the built in logger
jmaki.log("TabPanel Widget loaded");
}

Before the constructor you may want to call :

jmaki.namespace("jmaki.widgets.foo.bar.TabPanel");

jmaki.widgets.foo.bar.TabPanel.Widget = function(wargs) {

}

to create all the objects if they are not found.

The component.js and component.htm files for this widget would need to be located in:

WEB_ROOT/resources/foo/bar/TabPanel/component.js
WEB_ROOT/resources/foo/bar/TabPanel/component.htm

2. The error console would be the browser debug console or in your case Firebug.

From looking at your code I suspect the issue really is the widget name.

Let Carla or I know if this doesn't work for you.

Message was edited by: gmurray71

bowmanmc
Offline
Joined: 2007-05-06

Ok, the problem for me was in widget.json. I had prepended the application context in the libs definition. So I had something like:
...
'libs' : [
'/foo/resources/ext/adapter/yui/yui-utilities.js',
...
and it should have been just:
...
'libs' : [
'/resources/ext/adapter/yui/yui-utilities.js',
...

So the problem was that it couldn't find the yui-utilities.js that is used by my component.js file.

The helpful comments in your post were:
jmaki.debug = true; // turns on the built in logger
jmaki.log("TabPanel Widget loaded");

So to summarize, there is no separate error log. Everything should show up at the bottom of the screen in red. jmaki.log creates a yellow div on the page and outputs there. Nothing is logged to the application server logs, nothing is going to a separate error log on the filesystem, and nothing is going to the firebug console.

"see error log for detials" really means turn on debugging for more verbose output to the screen.

Thanks to you both for helping me through this!
-Michael

carlavmott
Offline
Joined: 2005-02-10

Hi Michael,

Look at your web server log file. Unfortunately, since I don't know what server you are using I can't give you more info.

HTH,
Carla

bowmanmc
Offline
Joined: 2007-05-06

I'm using Tomcat 5.5, but nothing is printing to catalina.out, the localhost log, or the console.

-Michael

carlavmott
Offline
Joined: 2005-02-10

Hmmm,, I guess it is possible that nothing is getting written out. Can you send me the widget code? I need the component.js and supporting files if there are any. Also a description of the resources directory. Where is your widget under resources dir?

I'll try and take a look.

email to carlavmott at dev.java.net

Thanks,