Most likely because I am not familiar with Tomcat and JVM; I’ve been having problems this morning. Solve them. Write them down and understand why they happen. When the Web project starts:

1. Jrebel’s team URL issues

Team urls often expire and can be found online and not easily resolved: Use http://jrebel.yanjiayu.cn:9001/64245b6b-ef68-4bdc-aabf-7f8e85a540e4 UUID back part can be replaced, Online generated reference: https://www.uuidgenerator.net/ www.cnblogs.com/joyny/p/102…

2. The JVM memory is insufficient

Today, after starting several times, maven cannot import properly, and there is an error in maven build process or later compiler process:

# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 1338256 bytes for Chunk::new
Copy the code

Solution:

  • -xss = ‘-xss’ = ‘-xss’ = ‘-xss’ = ‘-xss’ = ‘-xss’;

    Set JAVA_OPTS=%JAVA_OPTS% -xms128m -xmx512mCatalina. bat is the most important script in Tomcat. For example, Tomcat is started and closed by Catalina. bat. Tomcat prints catalina logs on the terminal, as shown in Figure 2

    Figure 1 Catalina. bat path

  • Step 2: Check the memory and find that the memory usage is only about 50 percent.
  • Finally, check whether Tomcat processes are still running and manually kill all processes on ports 1099 and 8080. Finally solve the problem.

Why is Tomcat still running after shutdown?

3.Artifact XXX:war: Error during artifact deployment. See server log for details.

Problem: This error is reported when Tomcat is started. This is mainly because war and explode are inconsistent. Resolution: This is a common problem that I have seen online, and it is indeed the second time I have encountered it, but I still don’t know how to solve it. I can now conclude that an error will be reported if the artifact is changed but not reconfigured in Tomcat configuration. Artifact consists of two modes:

  • War: Release mode, first into a WAR package, and then release
  • War explode: Move the folder, view pages, classes, etc. into the Tomcat deployment folder and load and deploy. This approach supports hot deployment and is generally used during development; In peacetime development, the use of hot deployment, Tomcat should be set up accordingly, so that the JSP interface modification of what can be displayed in time;

Explode mode: On Update action and on Frame deactivation supports update classes and resources.


4. The Tomcat startup to org. Apache. Catalina. Startup. Catalina. Start Server star stop problem

The configuration item in the configuration file in Catalina.bat was incorrectly written, which caused the Tomcat startup error. After I fixed the third small problem, the problem no longer existed.

5. The port is occupied

This is relatively simple, Windows solution: eg: check whether port 1099 is occupied, and kill

  • Netstat aon | findstr searches, 1099 found 1099 pid is 19128
  • taskkill -f -pid 19128

6. Summary

  • Tomcat is still hard, and there are things to learn about the JVM and so on;
  • Many problems, just look at the theory is not enough, I hope to encounter more problems, promote my study progress.
  • I will revisit the BOOK of JVM virtual machine when I have time