• Welcome to KonaKart Community Forum. Please login or sign up.
 

Debug konakart from Eclipse

Started by sergionni, September 27, 2010, 01:38:20 pm

Previous topic - Next topic

sergionni

Hi konakart developers.
How did you tune debugging from Eclipse?

Seems,that StartAndLaunchKonaKart.bat should be started with jpda,but it doesn't help.

Eclipse config:
host:localhost
port:8780

Env. variables:
JPDA_ADDRES = 8780
JPDA_TRANSPORT = dt_socket

Thank you for help.
--
sergionni

Brian

FYI  In the next release (v5.2.0.0) there is an ANT target that will create an Eclipse project that you can use to develop the store front easily under Eclipse.

sergionni

Quote from: Brian on September 27, 2010, 01:48:12 pm
FYI  In the next release (v5.2.0.0) there is an ANT target that will create an Eclipse project that you can use to develop the store front easily under Eclipse.


Hi Brian, thanks for information. What is preliminary time of this release?

--
sergionni

Brian

I'm not sure.  Likely to be mid to end October (2010 !)

sergionni

Hi Brian, so is there any wiki or howto about Eclipse debug for Konakart?

Thanks.

--
sergei

sergionni

Can't launch catalina jpda start even.

Got error:
java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port)
is normally permitted.

But it loosk like port isn't not busy,at least localhost:8780 doesn't respond.

Help,plz :-\

Alexandar_Zikic

It would seem your port is allready in use, most likely by tomcat itself.
Have you tried a different port than the one tomcat is running on?


However I can offer an alternative to the jdpa approach:

I too develop in eclipse and use remote debugging to connect to the tomcat server.
By adding following line to your startkonakart.bat (or .sh if you run on linux) tomcat will start with a open debug port:

set CATALINA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -XX:PermSize=512m -XX:MaxPermSize=512m -Xmx800m -Dsolr.solr.home="%CATALINA_HOME%/solr"

In Eclipse open the debug configurations and create a new "Remote Java Application", the default values should be fine. Select your eclipse project containing konakart and your finished.

To debug konakart has to be allready started, click the debug configuration you just created and it should work.

While this isn´t as comfortable as "real" debugging it get´s the job done.

Important:

For all of this to work you have to modify the build.xml. In all <javac/> task you need to change the attribute "debug" to "on" or "yes". Without that change ant won´t compile any debug information into the source code (line numbers etc.) and debuging will be almost impossible. I suggest you create a new variable for this and place it in all <javac/> Tasks so you only have to change a single line in the future.