Go into the catalina.sh, and add the following settings to your JAVA_OPTS:
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

In my case I have:
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server
-Xms1024m -Xmx1536m -XX:NewSize=256m -XX:MaxNewSize=256m
-XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

Im' using
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server
-Xms1024m -Xmx1536m -XX:NewSize=256m -XX:MaxNewSize=256m
-XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC -Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

You can now use Eclipse to remote debug. Go to Debug->Debug
Configuration->Remote Java Application. You should see your Eclipse
projects, select the right now and enter the information for "host"
and "port".

Set a breakpoint in the source code of the OpenLaszlo server, e.g. the
LzServlet, and load any LZX file in the browser. Eclipse should catch
the breakpoint and you can start debugging.

That even works when you take an OpenLaszlo server without the source
code, deploy the application, configure a dynamic web project in
Eclipse, point the WebContent folder to the LPS folder, and attach the
source code for the lps JAR file in Eclipse. I'll upload a short video
to Vimeo, since other people might be interested in it.

On Wed, Apr 20, 2011 at 2:35 AM, Henry Minsky <[email protected]> wrote:
> I managed to follow your instructions to get the lps server to compile,
> thanks for making
> such complete notes!
>
> When you want to debug the compiler (invoked via 'lzc' ) do you run it under
> Eclipse in order to use the debugger? And do you know of a way to attach the
> Eclipse debugger to an LPS server running under Tomcat? Just wondering...
> I've
> been using print statements to the log for so long, it would be cool to have
> a way to set breakpoints for
> more interactive debugging.
>
>
> Also, when  you are working on the LFC, and you go to rebuild an LFC for one
> or more runtimes, do you also use Eclipse to run the LFC compilations, or do
> you use the command line buildlfc scripts?
>
>
>
> On Sat, Apr 16, 2011 at 3:44 PM, André Bargull <[email protected]>
> wrote:
>>
>> I've added a little how-to for building the server from within Eclipse to
>> the wiki. Let me know if some steps are unclear or don't work for you!
>>
>> - André
>>
>>
>> [1] http://wiki.openlaszlo.org/Build_Server_with_Eclipse
>
>
>
> --
> Henry Minsky
> Software Architect
> [email protected]
>
>
>

Reply via email to