1 / 13

Web Servers and Server-Side Debugging

Web Servers and Server-Side Debugging. Jetty. In this course we are using Maven Jetty Plugin for convenience Maven plugin configuration: To run Jetty execute from Maven Web project root: mvn jetty:run. <plugin> <groupId>org.mortbay.jetty</groupId>

Download Presentation

Web Servers and Server-Side Debugging

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web Servers andServer-Side Debugging

  2. Jetty • In this course we are using Maven Jetty Plugin for convenience • Maven plugin configuration: • To run Jetty execute from Maven Web project root: mvn jetty:run <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.7.v20120910</version> </plugin>

  3. Enable remote debugging • Set environment variable MAVEN_OPTS with value -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n • E.g. create a BAT file for running Jetty: set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n mvn jetty:run

  4. Debug configuration in Eclipse > Run > Debug Configurations…

  5. Debugging • Start Jetty • Launch Debug configuration in Eclipse

  6. Debugging • Add breakpoint, e.g. in Servlet code and send HTTP request • Server will stop at breakpoint

  7. Debugging

  8. Tomcat

  9. Download Tomcat • Download the Apache Tomcat http://tomcat.apache.org • Un-zip the distribution file • Deploy your application • Copy WAR file inside <TOMCAT_HOME>\webapps • Tomcat server can be started by executing BAT script <TOMCAT_HOME>\bin\startup.bat

  10. Set up remote debugging • Stop Tomcat (Ctrl+C or close console window) • Open the startup script: startup.bat • Add the following lines at the first blank line in the file (around line 8) set JPDA_ADDRESS=8787 set JPDA_TRANSPORT=dt_socket • Change the execute line at the end to include jpda start call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS% • Run the startup script to run Tomcat in debug mode http://confluence.sakaiproject.org/display/BOOT/Setting+Up+Tomcat+For+Remote+Debugging

  11. JBoss

  12. Download JBoss • Download the JBoss application server https://www.jboss.org/jbossas/downloads/ • Un-zip the distribution file • Deploy your application • Copy WAR file inside <JBOSS_HOME>\server\workspace\deploy • JBoss server can be started by executing BAT script <JBOSS_HOME>\bin\run.bat

  13. Enableremote debugging • Stop JBoss (Ctrl+C or close console window) • Add or un-comment the following line in run.bat rem JPDA options. Uncomment and modify as rem appropriateto enable remote debugging. set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket, address=8787,server=y,suspend=n %JAVA_OPTS% 3. Create new “Remote Java Application” debug configuration in Eclipse: Run  Open Debug Dialog

More Related