Cytoscape app - Debugging by using breakpoints ?

184 views
Skip to first unread message

lindfo...@gmail.com

unread,
Mar 12, 2015, 7:23:49 AM3/12/15
to cytoscape...@googlegroups.com
Hi all,

Is it possible to debug a Cytoscape (3.x) app by using breakpoints?

In other words, I would like to set breakpoints in my Cytoscape app code and then see the values of variables at stages when the execution has reached the breakpoints, like illustrated in http://agile.csc.ncsu.edu/SEMaterials/tutorials/eclipse-debugger/ for a stand-alone java app.

So far I have been debugging Cytoscape apps by printing variables to System.out (System.out.println) and then looking into output.log (in Cytoscape's installation directory). I am increasing feeling breakpoints would make the debugging smoother.

At least I could not find any this type of solution in http://wiki.cytoscape.org/Cytoscape_3/CoreDevelopment/Debugging.

Thanks,
Erno Lindfors

piet molenaar

unread,
Mar 12, 2015, 7:51:04 AM3/12/15
to cytoscape-helpdesk
Hi Erno,
It definitely is, I do it all the time; the trick is to start Cytsocape in debug mode in a command line terminal (I use a terminal within eclipse).This will startup cytoscape on a socket that you can have eclipse listen to. I work on win so use the .bat script, otherwise you'd use .sh

cytoscape.bat -debug

This will give you this response:
Listening for transport dt_socket at address: 12345

In eclipse you setup a debug configuration for remote java applications as below:

Inline image 1

If you run this cytoscape will start in debug mode.
You can start your app from the same console by using the install command.
From within eclipse you now can set breakpoints assuming you have setup your app development as described here: 
Hope this helps
Piet

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at http://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.



--
Piet Molenaar
piet...@gmail.com
Department of Oncogenomics, M1-131
Academic Medical Center
University of Amsterdam
Meibergdreef 9
1105 AZ Amsterdam
the Netherlands

tel (+31) 20-5666592
fax (+31) 20-6918626

lindfo...@gmail.com

unread,
Mar 12, 2015, 8:49:49 AM3/12/15
to cytoscape...@googlegroups.com

Hi Piet and others,

Thanks very much for the help!

I use Ubuntu 14.04.
I am trying to start the Cytoscape in debug mode from the command line but cannot do it.
The command and error message below in yellow. 

Any idea why this happens and how to fix it?

Thanks,
Erno

erno@erno-HP-Elite-7500-Series-MT:~/Cytoscape_v3.2.1$ ./cytoscape.sh -debug
             _                                    
   ___ _   _| |_  ___  ___  ___  __ _ _ __   ___  
  / __| | | | __|/ _ \/ __|/ __|/ _` | '_ \ / _ \ 
 | (__| |_| | |_| (_) \__ \ (__| (_| | |_) |  __/ 
  \___|\__, |\__|\___/|___/\___|\__,_| .__/ \___| 
       |___/                         |_|          

Cytoscape 3.2.1

Hit '<tab>' for a list of available commands
   and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Cytoscape.

Cytoscape 3.2.1> usage: cytoscape.{sh|bat} [OPTIONS]
 -h,--help             Print this message.
 -N,--network <file>   Load a network file (any format).
 -P,--props <file>     Load cytoscape properties file (Java properties
                       format) or individual property: -P name=value.
 -R,--rest <port>      Start a rest service
 -s,--session <file>   Load a cytoscape session (.cys) file.
 -S,--script <file>    Execute commands from script file
 -v,--version          Print the version number.
 -V,--vizmap <file>    Load vizmap properties file (Cytoscape VizMap
                       format).

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: 'factory' must not be null.
at org.cytoscape.view.vizmap.gui.internal.view.VizMapPropertyBuilder.buildProperty(VizMapPropertyBuilder.java:150)
at org.cytoscape.view.vizmap.gui.internal.view.VisualPropertySheetItem.getPropSheetPnl(VisualPropertySheetItem.java:511)
at org.cytoscape.view.vizmap.gui.internal.view.VisualPropertySheetItem.getMappingPnl(VisualPropertySheetItem.java:471)
at org.cytoscape.view.vizmap.gui.internal.view.VisualPropertySheetItem.getMappingBtn(VisualPropertySheetItem.java:617)
at org.cytoscape.view.vizmap.gui.internal.view.VisualPropertySheetItem.getTopPnl(VisualPropertySheetItem.java:436)
at org.cytoscape.view.vizmap.gui.internal.view.VisualPropertySheetItem.init(VisualPropertySheetItem.java:378)
at org.cytoscape.view.vizmap.gui.internal.view.VisualPropertySheetItem.<init>(VisualPropertySheetItem.java:149)
at org.cytoscape.view.vizmap.gui.internal.view.VizMapperMediator.createVisualPropertySheetItems(VizMapperMediator.java:920)
at org.cytoscape.view.vizmap.gui.internal.view.VizMapperMediator.access$2500(VizMapperMediator.java:121)
at org.cytoscape.view.vizmap.gui.internal.view.VizMapperMediator$22.run(VizMapperMediator.java:839)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:738)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:699)
at java.awt.EventQueue$3.run(EventQueue.java:697)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:708)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

On Thursday, March 12, 2015 at 12:51:04 PM UTC+1, Piet wrote:
Hi Erno,
It definitely is, I do it all the time; the trick is to start Cytsocape in debug mode in a command line terminal (I use a terminal within eclipse).This will startup cytoscape on a socket that you can have eclipse listen to. I work on win so use the .bat script, otherwise you'd use .sh

cytoscape.bat -debug

This will give you this response:
Listening for transport dt_socket at address: 12345

In eclipse you setup a debug configuration for remote java applications as below:

Inline image 1

If you run this cytoscape will start in debug mode.
You can start your app from the same console by using the install command.
From within eclipse you now can set breakpoints assuming you have setup your app development as described here: 
Hope this helps
Piet
On Thu, Mar 12, 2015 at 12:23 PM, <lindfo...@gmail.com> wrote:
Hi all,

Is it possible to debug a Cytoscape (3.x) app by using breakpoints?

In other words, I would like to set breakpoints in my Cytoscape app code and then see the values of variables at stages when the execution has reached the breakpoints, like illustrated in http://agile.csc.ncsu.edu/SEMaterials/tutorials/eclipse-debugger/ for a stand-alone java app.

So far I have been debugging Cytoscape apps by printing variables to System.out (System.out.println) and then looking into output.log (in Cytoscape's installation directory). I am increasing feeling breakpoints would make the debugging smoother.

At least I could not find any this type of solution in http://wiki.cytoscape.org/Cytoscape_3/CoreDevelopment/Debugging.

Thanks,
Erno Lindfors

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpdesk+unsub...@googlegroups.com.

To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at http://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.

Mike Kucera

unread,
Mar 12, 2015, 9:22:31 AM3/12/15
to cytoscape...@googlegroups.com
You can run Cytoscape in debug mode from the Eclipse toolbar by creating an External Tool Configuration. This wiki page describes how: http://wiki.cytoscape.org/Cytoscape_3/AppDeveloper/Cytoscape_App_Ladder/Launch_And_Debug_From_Eclipse


piet molenaar

unread,
Mar 12, 2015, 9:27:18 AM3/12/15
to cytoscape-helpdesk
Woops this is also an error on my behalf; the command is  
cytoscape.sh debug
so without the -

But following Mike's suggestions is better; I forgot to look into the brand new app developer ladder where everything is explained.
Thanks Mike!

lindfo...@gmail.com

unread,
Mar 13, 2015, 11:45:46 AM3/13/15
to cytoscape...@googlegroups.com
Thanks both, this indeed works!
Erno
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpdesk+unsub...@googlegroups.com.

To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at http://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.
--
Piet Molenaar
piet...@gmail.com
Department of Oncogenomics, M1-131
Academic Medical Center
University of Amsterdam
Meibergdreef 9
1105 AZ Amsterdam
the Netherlands

tel (+31) 20-5666592
fax (+31) 20-6918626

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpdesk+unsub...@googlegroups.com.

To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at http://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpdesk+unsub...@googlegroups.com.

To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at http://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages