[Engine-devel] How to debug in frontend project

Vojtech Szocs vszocs at redhat.com
Mon Mar 4 15:38:01 UTC 2013


Hi,

please find some details on debugging Web Admin below:

0) Make sure to export appropriate oVirt-related environment variables, for example:
   $ export OVIRT_GIT=$HOME/workspace/ovirt-engine
   $ export JBOSS_HOME=/usr/local/dev/ovirt-jboss-as
   $ export ENGINE_DEFAULTS=$OVIRT_GIT/backend/manager/conf/engine.conf.defaults

1) Perform full oVirt build, with Web Admin GWT compilation enabled
   $ cd $OVIRT_GIT
   $ mvn clean install -Pdep,gwt-admin -Dgwt.compiler.localWorkers=8

(Note: 'dep' profile deploys engine.ear to Engine JBoss instance, 'gwt-admin' profile enables Web Admin GWT compilation, 'gwt.compiler.localWorkers' is optional and should match the number of CPU cores to speed up GWT compilation)

2) Start Engine JBoss instance (standalone mode)
   $ cd $JBOSS_HOME/bin
   $ ./standalone.sh

(Note: for server-side code debugging, you might want to edit '$JBOSS_HOME/bin/standalone.conf' and uncomment JPDA settings for remote socket debugging)

3) Launch Web Admin Development Mode session
   $ cd $OVIRT_GIT/frontend/webadmin/modules/webadmin
   $ mvn gwt:debug -Pgwtdev,gwt-admin -Dgwt.noserver=true

4) Connect to Web Admin Development Mode session from Java IDE
   > In Eclipse, create new 'Remote Java Application' debug configuration as follows:
     - host 'localhost', port 8000
     - connection type 'Standard (Socket Attach)'
     - in 'Source' tab, you might want to add related frontend projects if you previously imported them into Eclipse (Add | Java project), e.g. 'uicommonweb' and 'gwt-common'

5) Launch Web Admin in web browser
   > open http://127.0.0.1:8700/webadmin/webadmin/WebAdmin.html?gwt.codesvr=127.0.0.1:9997
   > (first-time only) you will be prompted to install GWT Developer plugin for the given browser, proceed with installation and restart the browser
   > open the URL again, GWT Developer plugin will now connect to Web Admin Development Mode ('gwt.codesvr')
   > there will be a new tab in Development Mode GUI for the given browser, including client-side logs

(Note: each time you make a client-side code change, you have to refresh the URL in web browser, causing Web Admin to restart.)

Regards,
Vojtech


----- Original Message -----
From: "Ofri Masad" <omasad at redhat.com>
To: "Wei D Chen" <wei.d.chen at intel.com>
Cc: engine-devel at ovirt.org
Sent: Tuesday, February 26, 2013 10:20:19 AM
Subject: Re: [Engine-devel] How to debug in frontend project

Hi,

Not sure this it what you've meant, but gwt allows you to debug directly from your IDE.
Here is how:
 - compile using maven
 - go to: frontend/webadmin/modules/webadmin
 - run:   mvn clean gwt:debug -Pgwt-admin,gwtdev    
   (This will invoke a maven build which will get to the line: "[INFO] Listening for transport dt_socket at address: 8000")
 - Create a debug configuration on your IDE for remote debug on host:localhost port:8000
 - Debug using the IDE
   (The IDE debug would launch a gwt tool which would allow you to activate the webadmin on you browser)
 
* after activating the webadmin on the browser via the gwt tool, be patient - it takes few minutes to load.

Ofri

----- Original Message -----
> From: "Wei D Chen" <wei.d.chen at intel.com>
> To: engine-devel at ovirt.org
> Sent: Tuesday, February 26, 2013 11:00:57 AM
> Subject: [Engine-devel] How to debug in frontend project
> 
> Hi,
> 
> How to debug the code in frontend project? I mean, print out some
> debug message from "onSave" method in the java file of
> "VmListModel.java" which is located in uicommonweb project. Thanks
> in advance.
> 
> Best Regards,
> Dave Chen
> 
> 
> _______________________________________________
> Engine-devel mailing list
> Engine-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
> 
_______________________________________________
Engine-devel mailing list
Engine-devel at ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel



More information about the Devel mailing list