Tag Archives: tomcat

Tomcat — failed to start, flash back

Tomcat server failed to start

Reason: the project was configured before, but the project folder was accidentally deleted later. As a result, when the project was started, an error was flashed back.

Solution: open the server.xml configuration file in the conf folder of Tomcat installation directory and delete it

<Context path="" docBase="..." reloadable="true"/>

This is just one line of code.

Tomcat error: 500 The server encountered an internal error that prevented it from fulfilling this request

Background:
I use JDK1.8 and tomcat8.0, but I encounter the following two problems


then I made a new tomcat, and its version is as follows:

and it succeeded…..

The reason: Tomcat version is higher than JDK version

In addition, I have problems with my code
here is the error code:

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="computer"%>
<html>
The three values entered a,b,c (representing the three sides of a triangle or the upper base, lower base and height of a trapezoid);
<body color=cyan>
        <form action="" method=get name=form> 
        <%--Get parameters to submit to yourself--%>
        <table>
        <tr><td>Enter value a: </td>
            <td><input type="text" name="a"></td>
        </tr>
        <tr><td>input value b: </td>
            <td><input type="text" name="b"></td>
        </tr>
        <tr><td>input value c: </td>
            <td><input type="text" name="c"></td>
        </tr>
        </table>
        <input type="radio" name="r" value="triangle">stands for triangle
        <input type="radio" name="r" value="lader">stands for trapezoid
        <br>
        <input type="submit" name="submit" value="submit" name=submit>stands for submit button
        </form>
        <% String a=request.getParameter("a");
           String b=request.getParameter("b");
           String c=request.getParameter("c");
           String cd=request.getParameter("r");
           if(a==null||b==null||c==null){
              a="0";
              b="0";
              c="0";
              cd="0";
                      
           }
           if(a.length()>0&&b.length()>0&&c.length()>0){
        %>
           <computer:Getarea numberA="<%=a%>" numberB="<%=b%>"
                             numberC="<%=c%>" condition="<%=cd%>"/>
           
           
           <br><%= message%>
           <br><%= area %>
        
        <% }
        %>
        </body>
        </html>


            
        

The reason for the error is that there are two more spaces. The error report is the same
here is the correct code:

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="computer"%>
<html>
The three values entered a,b,c (representing the three sides of a triangle or the upper base, lower base and height of a trapezoid);
<body color=cyan>
        <form action="" method=get name=form> 
        <%--Get parameters to submit to yourself--%>
        <table>
        <tr><td>Enter value a: </td>
            <td><input type="text" name="a"></td>
        </tr>
        <tr><td>input value b: </td>
            <td><input type="text" name="b"></td>
        </tr>
        <tr><td>input value c: </td>
            <td><input type="text" name="c"></td>
        </tr>
        </table>
        <input type="radio" name="r" value="triangle">stands for triangle
        <input type="radio" name="r" value="lader">stands for trapezoid
        <br>
        <input type="submit" name="submit" value="submit" name=submit>stands for submit button
        </form>
        <% String a=request.getParameter("a");
           String b=request.getParameter("b");
           String c=request.getParameter("c");
           String cd=request.getParameter("r");
           if(a==null||b==null||c==null){
              a="0";
              b="0";
              c="0";
              cd="0";
                      
           }
           if(a.length()>0&&b.length()>0&&c.length()>0){
        %>
           <computer:Getarea numberA="<%=a%>" numberB="<%=b%>"
                             numberC="<%=c%>" condition="<%=cd%>"/>
           
           
           <br><%=message%>
           <br><%=area %>
        
        <% }
        %>
        </body>
        </html> 

JAVA Error Illegal access: this web application instance has been stopped already. Could not load net.sf

This exception occurs when you restart tomcat, but it does not affect the normal function.

Exception code:

Message: Illegal access: this web application instance has been stopped already.  Could not load net.sf.ehcache.store.disk.DiskStore$KeySet.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1776)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1734)
	at net.sf.ehcache.store.disk.DiskStore.keySet(DiskStore.java:521)
	at net.sf.ehcache.store.disk.DiskStorageFactory$DiskExpiryTask.run(DiskStorageFactory.java:828)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

Exception analysis: restart Tomcat repeatedly and frequently, resulting in the thread in the last tomat not closing normally
solutions:

Change the reloadable in server.xml in Tomcat from true to false.

After setting reloadable = “true”, Tomcat will monitor the source code of the project in real time, and restart the Tomcat server in case of any change. When debugging a program, relaodable = true is usually not set. It is unreasonable to restart Tomcat frequently. If you set reloadable = false, or do not set this property, only when you add, delete or rename method or instance fields, do you require the service to restart, which is suitable for you to debug programs.

File settings: server.xml & gt; reloadable=“false”。

Tomcat start error: severe: error listener start

Tomcat start error: severe: error listener start

problem

Today, we deal with a problem. After modifying the code and deploying it to the server, we report an error when starting Tomcat. The error message is as follows:

org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/projectname] startup failed due to previous errors

error listener this error message is too vague. Check it web.xml We need more detailed log information to know what caused the error, so that we can quickly locate the error point. So we need to modify the log level of Tomcat to output what we need.

method

Create a new file called in the WEB-INF/classes directory logging.properties , as follows

handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler  

org.apache.juli.FileHandler.level = FINE  
org.apache.juli.FileHandler.directory = ${catalina.base}/logs  
org.apache.juli.FileHandler.prefix = error-debug.   

java.util.logging.ConsoleHandler.level = FINE  
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter 

In this way, Tomcat's own log is used for log output.

After adding the log output configuration file, you can see the detailed error report after restart. After looking at the log, I found my own error, because the JDK version used by my local compilation environment is higher than that of the server. As a result, spring failed to initialize the bean, and Tomcat started with an error.
Everyone's mistakes are not the same, so I won't repeat the following mistakes.

Eclipse Tomcat Error creating bean with name ‘sqlSessionFactory’ defined in URL…

[operation environment]

jdk1.8+eclipse+apache tomcat v7.0

 

[phenomenon]

Code running error org.apache.catelina . core.StandardContext listenerStart

Error creating bean with name ‘sqlSessionFactory’ defined in URL [file:/E:/apache-tomcat-7.0.63-windows-x64

 

Tomcat error

 

Reason: no Tomcat jar package added

Select the project, right-click, select build path — & gt; add Libraries… — & gt; select server runtime — & gt; next — & gt; select Apache Tomcat v7.0 — & gt; OK.

 

 

 

 

 

IntelliJ idea solves Tomcat error: error listener start

When using idea, Tomcat can’t start normally, error prompt: org.apache.catalina . core.StandardContext.startInternal Error listener start. No more detailed error information.
Google has a plan to record Tomcat log details: create a new one in the project resource directory logging.properties File, enter the following into the file:

  handlers = org.apache.juli.FileHandler,java.util.logging.ConsoleHandler 
 org.apache.juli.FileHandler.level = FINE 
 org.apache.juli.FileHandler.directory = ${catalina.base}/logs 
 org.apache.juli.FileHandler.prefix = error-debug.

java.util.logging.ConsoleHandler.level = FINE 
 java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

Restart tomcat, you will find more detailed error information under server.
My error message here:
caused by: org.springframework.context . annotation.ConflictingBeanDefinitionException : Annotation-specified bean name ‘newsManagerController’ for bean class [ com.qf.official . controller.NewsManagerController ] conflicts with existing, non-compatible bean definition of same name and class [ com.qf.bookbar . news.controller.NewsManagerController ].
because the name of a class has been modified before, which is duplicate with the class name in the system, the problem is solved by modifying the class name.

[Tomcat] an error is reported when Tomcat starts ERROR:transport error 202:bind failed:Address already

Software testing technology exchange group: 429183023
2

A service of the test environment, which was good last week, suddenly couldn’t get up this week. I’m very puzzled.

But because of the test environment, the development was not very attentive, so I decided to solve it by myself. After observing the Catalina log, it is found that an error is reported

Tomcat start error ERROR:transport error 202:bind failed:Address already

So check it out start.sh File to see if there is a wrong address. When you see the remote debugging, you add a listening port, and the remote debugging of another service is also listening to this port before, so this port conflicts. The service can’t get up all the time. Delete – Xdebug- Xrunjdwp:transport=dt_ Socket, suspend = n, server = y, address = * * * *, perfect solution.

This admonishes us, because there are many services, when debugging a service remotely, we must restore the scene after debugging it!!! Because the test environment is shared, if someone else also uses this port for remote debugging, it will be GG

Start Tomcat and report error occurred during initialization of VM could not reserve enough space for object

Double click the mouse to start cattom startup.bat Flashback and operation error occurred, localhost:8080 Naturally, web pages can’t be opened.

1. Can be edited in startup.bat , add a line at the end to view the information of running error. In order to see the information in more detail, let’s change another sentence: find call% executable% “run% CMD_ LINE_ Args% replaces start with run.

pause

2. After joining, save and run startup.bat Error occurred during initialization of VM could not reserve enough space for object heap catalina.sh The Tomcat memory parameter of the file is too large, which is caused by exceeding the total available memory of the machine. You can modify it to an appropriate value.

3. Find it in the bin directory of Tomcat catalina.bat Edit and join, save and exit startup.bat That’s it.

set JAVA_OPTS=-server -Xms512m -Xmx512m  -XX:PermSize=256m -XX:MaxPermSize=256m