Forum Statistics

  • Forum Members: 4,499
  • Total Threads: 3,656
  • Total Posts: 2
There are 1 users currently browsing forums.

Partner Sites

Reply
Old 06-14-2009, 12:46 AM   #1 (permalink)
 
Status: Newbie
Join Date: Jun 2009
Posts: 4

Rep Power: 12 Annu is on a distinguished road



Default How to debug the MT's java code

To modify the existing migration code or to do a bugfix yourself you should use Eclipse.

After installing Eclipse you should run this short debugging test to see if everything is in place.

1) Start Eclipse.
2) Open the project found in [installdir]\java ^*
3) Open BaseJava.java from the com.mysql.grt.modules package.
4) Set a breakpoint in public static String engineVersion() on the return statement (with Ctrl+Shift+B)
4a) If the breakpoint is displayed as a small red square, select Project > Clean and clean all projects. After the rebuild is complete the breakpoint should be visualized with a blue dot.
6) Start the GRT shell with grtsh -verbose -debug
7) In Eclipse now select Run > Debug ... from the main menu. Select Remote Java Application and press [New]. Choose Connection Type: Standard (Socket Attach), Host: localhost, Port: 8000
8) Click the [Debug] button.
9) Now the blue breakpoint should have an additional checkmark, notifying that Eclipse will actually hold there.
10) Back in the GRT shell, execute \ > print(BaseJava:engineVersion())
11) If everything is configured correctly, Eclipse will ask to switch to the Debugging perspective. After doing so the line with the breakpoint will be highlighted.
12) Press F8 to continue. The GRT shell should print information about the Java engine.

^* The current release ships with an outdated [installdir]\java\.classpath file. The <classpathentry> to path="lib/mysql-connector-java-3.1.6-bin.jar" needs to be updated to path="lib/mysql-connector-java-3.1.10-bin.jar" and the entry for path="lib/ojdbc14.jar" needs to be removed before opening the project in Eclipse. This is now fixed and will be in the next release, thanks to Thorbjørn Weidemann for pointing this out.


After you have completed this simple test, you can start the Migration Toolkit with the -debug option. You can set breakpoints in all other modules like ReverseEngineeringOracle or MigrationOracle and step through the code with F5 (step in) and F6 (step over).

To inspect a variable, place the cursor on it and press Ctrl+Shift+I. For more information please read the Eclipse documentation.


In the Migration Toolkit you can select Tools > GRT Environment Shell or press F4 to get the X GRT shell. The GRT Globals Tree gives you access to the application's data. We are working on more documentation about the GRT Environment to make it easier to customize the Migration Toolkit.

_______________________

How to debug the MT's java code

______________


smart lipo cost
laser hair removal clinic
Annu is offline Add Infraction for Annu   Reply With Quote
Old 11-10-2009, 06:45 AM   #2 (permalink)
 
Status: On a mission
Join Date: Nov 2009
Posts: 34

Rep Power: 14 vikas1234 is on a distinguished road



Default

thanks for sharing it with us ...
vikas1234 is offline Add Infraction for vikas1234   Reply With Quote


Reply

Bookmarks

Tags
None


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may post new threads
You may post replies
You may post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.5.0 RC2