The development of the application in the local run well, but deployed to the server, application services can be started up, the operation is always a problem. For this scenario, the remote mode is more useful. The specific use is as follows: I. Using IJ to open a project
(formerly I called Idea, since the new logo is IJ, I also call it), click on the upper right corner of the edit configurations.
two. Create a new remote Debug configuration
1. Point to the upper left corner of the plus, and then select Remote, and then name Random.
2. Fill in the IP of the application server and an unused port (this port is not the application server's port),
3. Select the source code class path.
4. Copy the Java run parameters to start the servlet application server.
5. Of course, click OK button to complete configuration three. Package the current application and deploy it to the application server. four. Use the parameters just copied to start the application server.
1.jetty procedure. Using D:\jdk8\bin\java "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8081"-jar Start.jar can achieve effect to start jetty
2.tomcat procedure: Tomcat-8\bin\catalina.bat, add set java_opts= "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n, address=8081 "Then point start.bat boot can achieve effect to start Tomcat five. Back to IJ, click the Debug button in the upper-right corner. Place breakpoints where needed . Six. Open the request in the browser (this is, of course, a request to the remote server).
This approach does not apply only to a particular application server, WebLogic also applies, and Java applications should apply. The core is to start the application server with the above parameters. The code for the remote application server should be the same as the local code, No, I don't know what's going on. For greater assurance, the local full pack (not incrementally packaged) remote server can use code management such as SVN or git as well as local. Then use MAVEN or Gradle to compile the package.