How do i debug a web application running on jetty in eclipse?

后端 未结 7 2023
無奈伤痛
無奈伤痛 2021-01-31 12:24

never done web programming before. Is there a way to set breakpoints, see variable values in eclipse? The app i want to debug makes a Query string whcih i would like to easily e

相关标签:
7条回答
  • 2021-01-31 12:39

    Click External Tools Config,

    enter image description here

    Select program and click the new button top left. Set location to your maven binary working directory to local workspace and arguments to jetty:run enter image description here

    In the environment tab set the maven opts. Notice socket address = 4000 and suspend=y enter image description here

    The go to debug configurations and add a new remote application. Add a project name and set the socket address. Now run the External tool it should say:

    Listening for transport dt_socket at address: 4000

    Then you can debug the remote app and add breakpoints etc.

    enter image description here enter image description here

    0 讨论(0)
  • 2021-01-31 12:41

    I would run the application with maven using the command: mvnDebug jetty:run

    And setup a remote Java application using port 8000, in Eclipse IDE.

    See the 'Setting up Maven 2.0.8+' section of: http://docs.codehaus.org/display/MAVENUSER/Dealing+with+Eclipse-based+IDE

    0 讨论(0)
  • 2021-01-31 12:42

    The answer for this post shows you the flags need to pass to the JVM for a remote debugger to attach.

    Remote debug Jetty (no mvn, no plugins)

    This is the page that explains remote debuggers for the JVM

    http://docs.oracle.com/javase/1.3/docs/tooldocs/solaris/jdb.html

    0 讨论(0)
  • 2021-01-31 12:45

    "Trying to run it this way i get CreateProcess error=193, %1 is not a valid Win32 application."

    On windows select mvn.bat instead of mvn.exe.

    0 讨论(0)
  • 2021-01-31 12:49

    If by any chance you are using intellij. It is way easier. Make sure you have jetty plugin installed. Then

    1. In the Maven Tab on the extreme right, expand your project
    2. Expand Plugins
    3. Expand jetty
    4. Right click on jetty:run and select 'Debug DEBUG'Click to see the screenshot for refence
    0 讨论(0)
  • 2021-01-31 12:54

    I would just expand eaykin's answer as the URL is broken.

    Run the Mvn Debug as bellow...

    $ mvnDebug -Dmaven.test.skip -Denvironment=dev clean jetty:run

    This will wait on port 8000

    Preparing to Execute Maven in Debug Mode Listening for transport dt_socket at address: 8000

    Then go to the Eclipse Run --> Debug Configurations --> Remote Java Applications Define Host as 'localhost' and port as 8000 if they are not default.

    If you click on the "Debug" button, this will start the application from mvn.

    0 讨论(0)
提交回复
热议问题