Idea debug a program deployed on a server

Source: Internet
Author: User

    • Ask questions:

    a program, deployed on their own computer,debug debugging, I believe everyone will, However, if I want debug debug Non-local deployment of the program what to do. For example, a program deployed on a test server.

In fact, such a demand is often, such as a large project has many modules, there are many of their own or external dependence, it is impossible to build a complete set of environment on their own computer. No matter how complex, sometimes the company's computer configuration does not give force, the deployment of a large program is even worse. Typically such programs are deployed directly into a dedicated development or test environment. Testing is rarely deployed on your own computer. Plus, with an automated deployment tool like Jenkins, deployment is just a matter of a few clicks of a button. No more work than a tomcat on the local. It is even more unnecessary to test the local deployment program. This includes developing self-test and testing personnel. Of course this is just a slightly bigger item. It is convenient to deploy tests on a small, standalone project locally.

Well, to get to the point, since the deployment to other places, you want to debug step-by-step debugging can not be as local deployment. This is the question raised at the beginning of the article.

    • Solve the problem:

In fact, it's easy to solve.

    • set up Tomcat

      In the Tomcat catalina.sh file that the target program runs, add

      java_opts="-xdebug-xnoagent-djava.compiler=none-xrunjdwp:transport=dt_socket,server=y,suspend=n, address=26310"

      Of course, this may be just a minimal configuration to enable remote debug, which can of course be set with other JVM parameters. Parameters like common settings for heap memory size, garbage collector, GC log printing, stack dump, and so on.

      Well, that's all the settings the target Tomcat needs to do, simple.Note the settings hereAddress=26310, which is the port for local and remote program communication, and is set in the IDE tool later.having done the work, it was almost half done.
    • Idea Settings

      Click Location

      

    then click "Edit configurations ..."

      

The following screen appears, then click the plus sign in the upper left corner

      

appear as the interface, click Remote

      

      

      

      

      

finished setting click Apply

If you want to remotely debug, select the location you just set.

then click on the Debug button to break the point on your machine to debug your remote deployment's code

    

    • Other IDE Tools I do not how to use, I do not know how to set up, need to study under their own.

Idea debug a program deployed on a server

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.