Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] How can I debug jetty using the ant plugin?

The simplest way to debug Jetty is to use one of the example embedded startup programs from the example-jetty-embedded module, for example LikeJettyXml that starts up the server in (almost) exactly the same way as Jetty is started normally. This way you could just start debugger in Eclipse for the example application and end up debugging all of Jetty.

The second best is to modify start.ini configuration file inside jetty-distribution/target/distribution directory after you did a full build using maven to add --exec option followed by your remote debugging options, when start Jetty using 'java -jar start.jar' command executed in the same directory, and then connect to the server you just started using remote debugging option in Eclipse. The drawback of this approach is that you have to manually re-build the modules and copy them to the distribution directory if you change your code a lot during debugging, but the good news is that most small changes result in Eclipse replacing the bytecode in memory and resetting to the beginning the current method.

-Michael

On Sun, May 29, 2011 at 11:32 AM, Ra Carter <spacemonkeyiv@xxxxxxxxx> wrote:
Is there a fork option in the jetty ant plugin? This doesn't work:

    <jetty tempDirectory="target/work" fork="false">
      <webApp
        name="myapp"
        warfile="target/myapp"
        contextpath="/myapp" />
    </jetty>

Thanks for your help.


On Sat, May 28, 2011 at 1:50 PM, Christian Grobmeier <grobmeier@xxxxxxxxx> wrote:
Hi,

just a guess - are you using fork in your ant-skript? Probably your
options are not passed on. Probably fork is passing only the memory
options on.

Cheers
Christian

On Sat, May 28, 2011 at 7:10 PM, Ra Carter <spacemonkeyiv@xxxxxxxxx> wrote:
> Please see this question I posted to stack
> overflow: http://stackoverflow.com/questions/6160033
> I am able to run the jetty plugin from ant but I would also like to debug
> the server. I tried updating ANT_OPTS with this command on Windows:
>
> set "ANT_OPTS=-Xms256m -Xmx1024m -XX:MaxPermSize=256m
> -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Xdebug
> -Xnoagent"
>
> However when I try to configure Eclipse with remote debugging on
> localhost:8000 I get an error.
>
> Failed to connect to remote VM. Connection timed out.
> org.eclipse.jdi.TimeoutException
>
> My app won't even start up without increasing the memory so I am led to
> believe that the jetty server is respecting the memory options, so why
> wouldn't it accept the debug options? How can I enable remote debugging with
> this setup?
> Thanks!
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
>



--
http://www.grobmeier.de
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



Back to the top