MyEclipse Use tutorial: MyEclipse remote Debugging

Source: Internet
Author: User
Tags jboss jboss server tomcat server

Note : This feature was redesigned in MyEclipse 2015 and is currently unavailable.

1. Introduction

This is a high-level tutorial on discussing configuring and debugging an application running on an application server without using the MyEclipse server to start a connector, whether MyEclipse is running on the same computer or running on a different computer. For applications that are generally easy to configure and debug, it is highly recommended that the MyEclipse Service connector be available for all server operations in the application server in a detailed tutorial. Before you perform this tutorial, read it carefully.

Sometimes it is inconvenient to use the MyEclipse connector to start the application server. For example, you might need to remotely debug an instance in an integrated development environment, or your server startup script might be modified or decided to use it as part of the development process, so you simply cannot change the management of external servers, and finally myeclipse may not support the servers you need for specific debugging at all. If you are facing such problems, this tutorial will tell you if you do the following:

    • Configure your server for remote debugging
    • Deploying an application to a server
    • Configure your server to communicate using custom Eclipse boot
    • Debug your Java code on all servers
    • Debugging a JSP-compatible server in JSR-045
2. Configure remote debugging for the server

To use MyEclipse to debug your external boot server, you need to configure the application and then start the server so that the external debugger can control it through JPDA. This section describes how to configure any application server for remote debugging, and provides several specific examples to illustrate the basics of the server.

To configure a Java application (including a server) for remote debugging, some additional Java virtual machine options must be specified. So the complete documentation of the remote debugging options, as well as the definitions and examples, can be obtained directly from Sun company. In summary, the virtual machine must know the mode to start debugging and the debugger connection to listen on a specific port. The desired command-line option instance is shown below.

Debugging Options Option Description
-xdebug Enable debugging
-XRUNJDWP: These options run JDWP debugging:
Transport=dt_socket, Using socket communication
address=8000, Debugger connection listening on port 8000
Server=y, Monitor the debugger connection for an application
Suspend=n Do not let the debugger wait for the connection to continue before debugging
2.1 WebLogic Server

Depending on your operating system platform, launch a weblogic.cmd or startweblogic.sh script as an application instance launched from the command line. The script reads the environment variable named Java_options and adds specifed as the parameter setting when the WebLogic call script is started. In Windows, this can be done by opening the Cmd.exe and issuing the following command:

CD Serverbin

Setjava_options=-xdebug-xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

. startweblogic.cmd

Replace with the path above the actual location of your BEA home folder, and other versions of WebLogic can be started in a similar way. After the server has been fully booted, it can be connected and controlled to MyEclipse, as described in section 3rd.

2.2 Tomcat Server

Depending on your operating system platform, a script named Catalina.bat or catalina.sh is invoked to launch the Tomcat instance on the command line. When started in debug mode, the script reads both the Jpda_transport and jpda_address environment variables and adds the parameter settings specifed use to start Tomcat. In Windows, this can be done by opening the Cmd.exe and issuing the following command:

CD bin
Set Jpda_transport=dt_socket
Set jpda_address=8000
Catalina.bat JPDA Start

Replace with the path above the actual location of the Tomcat installation folder, and other versions of Tomcat can be started in a similar way. After the server has been fully booted, it can be connected and controlled to MyEclipse, as described in section 3rd.

2.3 Sun Java System Application Server 8. x version

Depending on your operating system platform, a script named Asadmin.bat or asadmin.sh is invoked to launch the 8th version of the Sun Java System Application Server instance on the command line. If your server domain name starts, the configuration file named Domain.xml will be read. Domain.xml contains additional JVM startup options that you can manually set to start remote debugging, edit the Domain.xml file as shown, and then start the server and start remote debugging with the Administrator command.

Edit Domain.xml to be able to debug remotely

When the server is fully booted, it can be connected and controlled to MyEclipse, as described in section 3rd.

2.4 JBoss Server

Depending on your operating system platform, a run.bat or run.sh script is invoked as a JBoss instance launched from the command line. The script reads an environment variable named java_opts and adds a parameter setting that specifies when to start the JBoss call script. In Windows, this can be done by opening the Cmd.exe and issuing the following command:

Cdbin
Setjava_opts=-xdebug-xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
. run.bat

Replace with the path above the actual location of the JBoss installation folder, and other versions of JBoss can be started in a similar way. After the server has been fully booted, it can be connected and controlled to MyEclipse, as described in section 3rd.

3. Deploying to a remote server

MyEclipse provides an integrated deployment management tool that can package and deploy any file system of your application while developing the system. The fundamentals of application deployment are described in the QuickStart for Web development and enterprise development, as this is an advanced tutorial, assuming you are familiar with the detailed deployment operations of these tutorials.

When deploying to a standard myeclipse to start an application server, the deployment location is automatically set by the MyEclipse that is selected based on the server type and deployment method. For remote server deployment, there is a "" server type, which allows the full specification of the deployment location.

Specify a remote deployment location

After the configuration is complete, the remote deployment behaves like a standard configuration, so the changes to the decomposition deployment and the project resources continue to synchronize automatically. Keep in mind that because you are deploying to a custom location, it is your responsibility to ensure that your application server loads the application at the selected location.

When application deployment and server remote debugging are configured, you can start the server at any time.

4. Debugging a remote server

MyEclipse provides a special debug boot configuration-myeclipse external boot server designed specifically to connect remote application servers and support full application debugging. Create a startup configuration for your external server, click the drop-down arrow for the appropriate icon on the Debug toolbar, and then select the Debug Configuration menu.

Open the Debug Configuration window, select myeclipse external boot server, and click the new launch configuration icon to create a debug startup configuration for connecting to the application server.

To create a new remote debugging configuration

Shows an example of a remote debug configuration for JBoss 4, similar to the settings for any server.

Configuration of the JBoss sample

When the source lookup path defaults to your debug project, you can add additional source lookup locations from the configured source page.

Configure Source Lookup Path

After configuring a new boot configuration, if your remote server is already running and listening for a debug connection, you can close it later using the click the Debug button. After the application server and the external debug configuration are started, a new debugging process is displayed in the Debug view.

Note : The debug view is not automatically displayed, so you'll need to switch to a debug perspective or manually open the view.

Connecting to an external debug server

At this point, if you use the built-in MyEclipse service connector to start a local server, the debugging application will be the same.

MyEclipse official Chinese online line, welcome to download Communication!

MyEclipse Use tutorial: MyEclipse remote Debugging

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.