You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafodion.apache.org by Dave Birdsall <da...@esgyn.com> on 2016/04/21 22:36:45 UTC

Using Eclipse to debug Trafodion Java code

Hi,



There used to be a page on the older Trafodion web site that had
instructions on how to debug a Trafodion process (such as an ESP or
tdm_arkcmp) using Eclipse. That is, the process though largely C++, has
Java code in it, and I want to debug that Java code. As you can tell, it’s
been several months since I’ve done this so I’ve forgotten how.



I remember there were some set-up steps (mvn eclipse perhaps?). I don’t
remember if there is a specific TCP/IP port that Trafodion processes use
for Java debugging (and I imagine that port would differ for different
instances on a development workstation).



Can someone remind me how to do this? Your reward will be that I’ll restore
these instructions to our wiki.



Thanks,



Dave

Re: Using Eclipse to debug Trafodion Java code

Posted by Hans Zeller <ha...@esgyn.com>.
Hi Qifan, maybe try a make all first before doing make eclipse. These
objects are created by building Trafodion. You may also need to start a new
shell after the build, to make sure the T2 and T4 jars are in your class
path.

Hans

On Fri, Apr 22, 2016 at 9:06 AM, Qifan Chen <qi...@esgyn.com> wrote:

> I wonder if there is something I missed to setup eclipse from my
> workstation.
>
> I issued the command "make eclipse" from the root directory of my AdvDB2.1
> branch (yesterday's version).
>
> Appreciate any help.
>
> --Qifan
>
> [INFO]
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Trafodion REST 2.1.0
> [INFO]
> ------------------------------------------------------------------------
> [WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is
> missing, no dependency information available
> [WARNING] Failed to retrieve plugin descriptor for
> org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin
> org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could
> not be resolved: Failed to read artifact descriptor for
> org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
> [INFO]
> [INFO] >>> maven-eclipse-plugin:2.10:eclipse (default-cli) @ rest >>>
> [WARNING] The POM for org.trafodion.jdbc.t4.T4Driver:t4driver:jar:2.1.0 is
> missing, no dependency information available
> [WARNING] The POM for org.trafodion.jdbc.t2.T2Driver:t2driver:jar:2.1.0 is
> missing, no dependency information available
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 1.411s
> [INFO] Finished at: Fri Apr 22 15:58:27 UTC 2016
> [INFO] Final Memory: 14M/608M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal on project dcs: Could not resolve
> dependencies for project org.trafodion:dcs:jar:2.1.0: The following
> artifacts could not be resolved:
> org.trafodion.jdbc.t4.T4Driver:t4driver:jar:2.1.0,
> org.trafodion.jdbc.t2.T2Driver:t2driver:jar:2.1.0: Failure to find
> org.trafodion.jdbc.t4.T4Driver:t4driver:jar:2.1.0 in
> http://download.java.net/maven/2/ was cached in the local repository,
> resolution will not be reattempted until the update interval of java.net
> has elapsed or updates are forced -> [Help 1]
>
> On Thu, Apr 21, 2016 at 4:25 PM, Selva Govindarajan <
> selva.govindarajan@esgyn.com> wrote:
>
> > For mxosrvr, ESP or any Trafodion SQL process, the debug port number
> would
> > be the
> >
> > $JVM_DEBUG_PORT/1000 + 1000th modulo of the pid of the process
> >
> > For eg if JVM_DEBUG_PORT is 24000  and pid of the process is 35580
> > Port no to use is 24580
> >
> > Selva
> >
> > -----Original Message-----
> > From: Hans Zeller [mailto:hans.zeller@esgyn.com]
> > Sent: Thursday, April 21, 2016 1:48 PM
> > To: dev <de...@trafodion.incubator.apache.org>
> > Subject: Re: Using Eclipse to debug Trafodion Java code
> >
> > Hi Dave
> >
> > This is what I do:
> >
> > Step 1: export JVM_DEBUG_PORT=<port you would like to use>
> >
> > Step 2: Start sqlci, it will print a message indicating that it's
> listening
> > on a port.
> >
> > Step 3: In Eclipse, go to Run -> Debug Configurations and create a
> "Remote
> > Java Application" configuration, entering "localhost" and the port you
> > chose
> > for debugging. Now you should be able to debug sqlci. It will enter the
> > debugging state once sqlci hits some Java code.
> >
> > If you want to browse classes (both Java and C++) with Eclipse, do the
> > following in the top-level directory (incubator-trafodion):
> >
> > make eclipse
> >
> >
> > then follow the instructions printed at the end of this step.
> >
> > For debugging Java UDFs, see
> >
> >
> https://cwiki.apache.org/confluence/display/TRAFODION/Tutorial%3A+The+object-oriented+UDF+interface#Tutorial:Theobject-orientedUDFinterface-DebuggingUDFcode
> > .
> >
> > I have not yet debugged mxosrvrs or ESPs, that probably adds a lot more
> > complications.
> >
> >
> > Hans
> >
> > On Thu, Apr 21, 2016 at 1:36 PM, Dave Birdsall <da...@esgyn.com>
> > wrote:
> >
> > > Hi,
> > >
> > >
> > >
> > > There used to be a page on the older Trafodion web site that had
> > > instructions on how to debug a Trafodion process (such as an ESP or
> > > tdm_arkcmp) using Eclipse. That is, the process though largely C++,
> > > has Java code in it, and I want to debug that Java code. As you can
> > > tell, it’s been several months since I’ve done this so I’ve forgotten
> > how.
> > >
> > >
> > >
> > > I remember there were some set-up steps (mvn eclipse perhaps?). I
> > > don’t remember if there is a specific TCP/IP port that Trafodion
> > > processes use for Java debugging (and I imagine that port would differ
> > > for different instances on a development workstation).
> > >
> > >
> > >
> > > Can someone remind me how to do this? Your reward will be that I’ll
> > > restore these instructions to our wiki.
> > >
> > >
> > >
> > > Thanks,
> > >
> > >
> > >
> > > Dave
> > >
> >
>
>
>
> --
> Regards, --Qifan
>

Re: Using Eclipse to debug Trafodion Java code

Posted by Qifan Chen <qi...@esgyn.com>.
I wonder if there is something I missed to setup eclipse from my
workstation.

I issued the command "make eclipse" from the root directory of my AdvDB2.1
branch (yesterday's version).

Appreciate any help.

--Qifan

[INFO]

[INFO]
------------------------------------------------------------------------
[INFO] Building Trafodion REST 2.1.0
[INFO]
------------------------------------------------------------------------
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is
missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for
org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin
org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could
not be resolved: Failed to read artifact descriptor for
org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
[INFO]
[INFO] >>> maven-eclipse-plugin:2.10:eclipse (default-cli) @ rest >>>
[WARNING] The POM for org.trafodion.jdbc.t4.T4Driver:t4driver:jar:2.1.0 is
missing, no dependency information available
[WARNING] The POM for org.trafodion.jdbc.t2.T2Driver:t2driver:jar:2.1.0 is
missing, no dependency information available
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1.411s
[INFO] Finished at: Fri Apr 22 15:58:27 UTC 2016
[INFO] Final Memory: 14M/608M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal on project dcs: Could not resolve
dependencies for project org.trafodion:dcs:jar:2.1.0: The following
artifacts could not be resolved:
org.trafodion.jdbc.t4.T4Driver:t4driver:jar:2.1.0,
org.trafodion.jdbc.t2.T2Driver:t2driver:jar:2.1.0: Failure to find
org.trafodion.jdbc.t4.T4Driver:t4driver:jar:2.1.0 in
http://download.java.net/maven/2/ was cached in the local repository,
resolution will not be reattempted until the update interval of java.net
has elapsed or updates are forced -> [Help 1]

On Thu, Apr 21, 2016 at 4:25 PM, Selva Govindarajan <
selva.govindarajan@esgyn.com> wrote:

> For mxosrvr, ESP or any Trafodion SQL process, the debug port number would
> be the
>
> $JVM_DEBUG_PORT/1000 + 1000th modulo of the pid of the process
>
> For eg if JVM_DEBUG_PORT is 24000  and pid of the process is 35580
> Port no to use is 24580
>
> Selva
>
> -----Original Message-----
> From: Hans Zeller [mailto:hans.zeller@esgyn.com]
> Sent: Thursday, April 21, 2016 1:48 PM
> To: dev <de...@trafodion.incubator.apache.org>
> Subject: Re: Using Eclipse to debug Trafodion Java code
>
> Hi Dave
>
> This is what I do:
>
> Step 1: export JVM_DEBUG_PORT=<port you would like to use>
>
> Step 2: Start sqlci, it will print a message indicating that it's listening
> on a port.
>
> Step 3: In Eclipse, go to Run -> Debug Configurations and create a "Remote
> Java Application" configuration, entering "localhost" and the port you
> chose
> for debugging. Now you should be able to debug sqlci. It will enter the
> debugging state once sqlci hits some Java code.
>
> If you want to browse classes (both Java and C++) with Eclipse, do the
> following in the top-level directory (incubator-trafodion):
>
> make eclipse
>
>
> then follow the instructions printed at the end of this step.
>
> For debugging Java UDFs, see
>
> https://cwiki.apache.org/confluence/display/TRAFODION/Tutorial%3A+The+object-oriented+UDF+interface#Tutorial:Theobject-orientedUDFinterface-DebuggingUDFcode
> .
>
> I have not yet debugged mxosrvrs or ESPs, that probably adds a lot more
> complications.
>
>
> Hans
>
> On Thu, Apr 21, 2016 at 1:36 PM, Dave Birdsall <da...@esgyn.com>
> wrote:
>
> > Hi,
> >
> >
> >
> > There used to be a page on the older Trafodion web site that had
> > instructions on how to debug a Trafodion process (such as an ESP or
> > tdm_arkcmp) using Eclipse. That is, the process though largely C++,
> > has Java code in it, and I want to debug that Java code. As you can
> > tell, it’s been several months since I’ve done this so I’ve forgotten
> how.
> >
> >
> >
> > I remember there were some set-up steps (mvn eclipse perhaps?). I
> > don’t remember if there is a specific TCP/IP port that Trafodion
> > processes use for Java debugging (and I imagine that port would differ
> > for different instances on a development workstation).
> >
> >
> >
> > Can someone remind me how to do this? Your reward will be that I’ll
> > restore these instructions to our wiki.
> >
> >
> >
> > Thanks,
> >
> >
> >
> > Dave
> >
>



-- 
Regards, --Qifan

RE: Using Eclipse to debug Trafodion Java code

Posted by Selva Govindarajan <se...@esgyn.com>.
For mxosrvr, ESP or any Trafodion SQL process, the debug port number would
be the

$JVM_DEBUG_PORT/1000 + 1000th modulo of the pid of the process

For eg if JVM_DEBUG_PORT is 24000  and pid of the process is 35580
Port no to use is 24580

Selva

-----Original Message-----
From: Hans Zeller [mailto:hans.zeller@esgyn.com]
Sent: Thursday, April 21, 2016 1:48 PM
To: dev <de...@trafodion.incubator.apache.org>
Subject: Re: Using Eclipse to debug Trafodion Java code

Hi Dave

This is what I do:

Step 1: export JVM_DEBUG_PORT=<port you would like to use>

Step 2: Start sqlci, it will print a message indicating that it's listening
on a port.

Step 3: In Eclipse, go to Run -> Debug Configurations and create a "Remote
Java Application" configuration, entering "localhost" and the port you chose
for debugging. Now you should be able to debug sqlci. It will enter the
debugging state once sqlci hits some Java code.

If you want to browse classes (both Java and C++) with Eclipse, do the
following in the top-level directory (incubator-trafodion):

make eclipse


then follow the instructions printed at the end of this step.

For debugging Java UDFs, see
https://cwiki.apache.org/confluence/display/TRAFODION/Tutorial%3A+The+object-oriented+UDF+interface#Tutorial:Theobject-orientedUDFinterface-DebuggingUDFcode
.

I have not yet debugged mxosrvrs or ESPs, that probably adds a lot more
complications.


Hans

On Thu, Apr 21, 2016 at 1:36 PM, Dave Birdsall <da...@esgyn.com>
wrote:

> Hi,
>
>
>
> There used to be a page on the older Trafodion web site that had
> instructions on how to debug a Trafodion process (such as an ESP or
> tdm_arkcmp) using Eclipse. That is, the process though largely C++,
> has Java code in it, and I want to debug that Java code. As you can
> tell, it’s been several months since I’ve done this so I’ve forgotten how.
>
>
>
> I remember there were some set-up steps (mvn eclipse perhaps?). I
> don’t remember if there is a specific TCP/IP port that Trafodion
> processes use for Java debugging (and I imagine that port would differ
> for different instances on a development workstation).
>
>
>
> Can someone remind me how to do this? Your reward will be that I’ll
> restore these instructions to our wiki.
>
>
>
> Thanks,
>
>
>
> Dave
>

Re: Using Eclipse to debug Trafodion Java code

Posted by Hans Zeller <ha...@esgyn.com>.
Hi Dave,

This is what I do:

Step 1: export JVM_DEBUG_PORT=<port you would like to use>

Step 2: Start sqlci, it will print a message indicating that it's listening
on a port.

Step 3: In Eclipse, go to Run -> Debug Configurations and create a "Remote
Java Application" configuration, entering "localhost" and the port you
chose for debugging. Now you should be able to debug sqlci. It will enter
the debugging state once sqlci hits some Java code.

If you want to browse classes (both Java and C++) with Eclipse, do the
following in the top-level directory (incubator-trafodion):

make eclipse


then follow the instructions printed at the end of this step.

For debugging Java UDFs, see
https://cwiki.apache.org/confluence/display/TRAFODION/Tutorial%3A+The+object-oriented+UDF+interface#Tutorial:Theobject-orientedUDFinterface-DebuggingUDFcode
.

I have not yet debugged mxosrvrs or ESPs, that probably adds a lot more
complications.


Hans

On Thu, Apr 21, 2016 at 1:36 PM, Dave Birdsall <da...@esgyn.com>
wrote:

> Hi,
>
>
>
> There used to be a page on the older Trafodion web site that had
> instructions on how to debug a Trafodion process (such as an ESP or
> tdm_arkcmp) using Eclipse. That is, the process though largely C++, has
> Java code in it, and I want to debug that Java code. As you can tell, it’s
> been several months since I’ve done this so I’ve forgotten how.
>
>
>
> I remember there were some set-up steps (mvn eclipse perhaps?). I don’t
> remember if there is a specific TCP/IP port that Trafodion processes use
> for Java debugging (and I imagine that port would differ for different
> instances on a development workstation).
>
>
>
> Can someone remind me how to do this? Your reward will be that I’ll restore
> these instructions to our wiki.
>
>
>
> Thanks,
>
>
>
> Dave
>