How to Debug/Trace client side code when deploying Tomcat

71 views
Skip to first unread message

joe young

unread,
Feb 25, 2009, 2:35:11 PM2/25/09
to Google Web Toolkit
I'm using NetBeans to develope my GWT applicaiotn.

Everything works fine when i deploy to gwt-shell-hosted. However when
I deploy to tomcat 6 with netbeans, many little problems occur. Such
as.

I have a TreePanel that display all the regions. When the TreePanel
first create, it will call RPC to retreive data
service.getGeoRootNode(new AsyncCallback() {
public void onSuccess(Object result) {

GeoNode rootNode = (GeoNode) result;

rootTreeNode.setText(rootNode.getNodeDesc());

rootTreeNode.setIconCls(rootNode.getNodeName() + "-
icon");

buildChildTreeNode(rootNode, rootTreeNode); // build
the children nodes

setRootNode(rootTreeNode);
}
});
However the tree building stop right after the rootNode is created. I
cannot trace the code because GWT.log() cannot print to tomcat logging
(I'm using log4J for server side logging) thus I don't know what
happen....

Question1: How can we trace the client side code? Is it possible that
ask GWT.log dump to log4J?

Question 2: Is it because buildChildTreeNode(rootNode, rootTreeNode)
is outside of onSuccess() so it cannot be run??


Thanks for your help in advance!

mars1412

unread,
Feb 26, 2009, 4:26:24 AM2/26/09
to Google Web Toolkit
you could use firebug for firefox
it will display the logmessages in the console
also Iron (type of Chrome) has a java-script console where you can see
the logs

Allahbaksh Asadullah

unread,
Feb 26, 2009, 5:55:51 AM2/26/09
to Google Web Toolkit
Hi,
As Martin pointed out you can use FireBug or Google Chrome inbuilt
feature. But if you have problem debugging on different browser on
your platform then I would suggest the build of OOPH is what is
required. By using OOPHM you can debug your application on any browser
of your choice.

Building OOPHM is simple and it is listed on my blog http://allahbaksh.blogspot.com
Regards,
Allahbaksh Mohammedali Asadullah
http://allahbaksh.blogspot.com

Arthur Kalmenson

unread,
Feb 26, 2009, 11:15:37 AM2/26/09
to Google-We...@googlegroups.com
> Question1: How can we trace the client side code? Is it possible that
> ask GWT.log dump to log4J?

You can do tracing in GWT using the logging library in the incubator:
http://code.google.com/docreader/#p=google-web-toolkit-incubator&s=google-web-toolkit-incubator&t=Logging
or Fred Sauer's gwt-log project: http://code.google.com/p/gwt-log/

--
Arthur Kalmenson

joe young

unread,
Feb 26, 2009, 1:14:09 PM2/26/09
to Google Web Toolkit
Hi Allahbaksh, Arthur and mars1412~

Thanks for your suggestions!! FireBug suits me perfectly Thanks

I found out that while building the children node with recurrsive
method, it stops when I set the node to disable()

if (theObject.getDeprecated().equals("1")) {
childTreeNode.disable(); <-----------------------
this will stop the funciton and the tree cannot built.
} else {
childTreeNode.enable();
}
firebug give me this error:
this.getOwnerTree() is undefined
[Break on this error] Ext.tree.TreeNode=function(A){A=A||{};if...
(this.ui.destroy){this.ui.destroy()}}});

and chrome's javascript console output this error
Uncaught TypeError: Cannot call method 'getSelectionModel' of
undefined http://localhost:8084/DMTAdmin/com.....DMTAdmin/js/ext/ext-all.js
(line 102)


What is that suppose to mean and how can it be resolve?!?!

Thanks again for your help!

On Feb 26, 5:55 am, Allahbaksh Asadullah <a.allahba...@gmail.com>
wrote:
> Hi,
> As Martin pointed out you can use FireBug or Google Chrome inbuilt
> feature. But if you have problem debugging on different browser on
> your platform then I would suggest the build of OOPH is what is
> required. By using OOPHM you can debug your application on any browser
> of your choice.
>
> Building OOPHM is simple and it is listed on my bloghttp://allahbaksh.blogspot.com
> Regards,
> Allahbaksh Mohammedali Asadullahhttp://allahbaksh.blogspot.com

Adligo

unread,
Feb 27, 2009, 8:18:55 AM2/27/09
to Google Web Toolkit
Hi,

If you use the commons logging port i_log (GPL2) that I wrote, you
can use it in production settings (when gwt is actually running in a
web browser). It sends log messages over rpc, and you can display
them via the Adligo Gwt Log Server (Costs $$), or you can just send
them to your a file via log4j on the server side (Costs Your Time).

http://www.adligo.com/#Products
http://www.adligo.com/#Source
(source and compiled jars)
http://www.adligo.com/dist2/gwt/gwt_main_v3_0/
(last nights build)

Example bootstrap
http://cvs.adligo.org/viewvc/gwt_util_demo/src/org/adligo/gwt/util/demo/client/UtilEntryPoint.java?view=markup

public void onModuleLoad() {
// just info
//String log_config_file = "adligo_log.properties";

try {
GwtPlatform.init();
new GwtLogFactory();
} catch (Exception x) {
x.printStackTrace();
log.error(x.getMessage(), x);
}

You need these jars (i_util, i_log, adi, gwt_util).

adligo_log.properties comes from your public folder (where your
module.html file is).


Cheers,
Scott



On Feb 26, 12:14 pm, joe young <keven.c...@gmail.com> wrote:
> Hi Allahbaksh, Arthur and mars1412~
>
> Thanks for your suggestions!! FireBug suits me perfectly Thanks
>
> I found out that while building the children node with recurrsive
> method, it stops when I set the node to disable()
>
> if (theObject.getDeprecated().equals("1")) {
> childTreeNode.disable(); <-----------------------
> this will stop the funciton and the tree cannot built.
> } else {
> childTreeNode.enable();
> }
> firebug give me this error:
> this.getOwnerTree() is undefined
> [Break on this error] Ext.tree.TreeNode=function(A){A=A||{};if...
> (this.ui.destroy){this.ui.destroy()}}});
>
> and chrome's javascript console output this error
> Uncaught TypeError: Cannot call method 'getSelectionModel' of
> undefinedhttp://localhost:8084/DMTAdmin/com.....DMTAdmin/js/ext/ext-all.js
Reply all
Reply to author
Forward
0 new messages