Tag Archives: tomcat

Record an error that the Tomcat resource publication cannot be updated:

Record an error that the Tomcat resource publication cannot be updated:

When it is found that Tomcat information is not updated after it is published, it is still the same as before; restart tomcat, delete the generated war package, and then re open it, it is found that there is no effect. After checking the configuration, it is found that there is no error. Check the resources under the published war package, and all the resources of the project are successfully published

So, after repeated operations, we finally found the error – the browser’s cache data is not cleared, delete the browser’s cache, restart, OK! No problem, Laotie

I hope my question will help you

[exception] address already in use: bind

1. Problems:

Bind Exception:Address Already in use;
Failed to start connector;
Address Already in use:bind;
EmbeddedServletContainer Excepiton:Unable to start embedder Tomcat servlet container;
IllegalState Exception:Tomcat connector in failed state;

2. Source code:

None;

3. Screenshot:

4. Summary:

Here we put it java.exe Turn it all off;

org.springframework.orm . hibernate3. Hibernatequeryexception: XXX is not mapped solution

There are several reasons as follows:
1

1. The HBM file association in spring is not configured well.

2. The fields in the HBM file are missing.

Solution:

1. Add fully qualified domain name when writing HQL (not recommended)

2. Configure HBM Association in spring (20 has been like this for several times)
in this paper, we introduce a new method to configure HBM Association in spring

When Tomcat starts: IOException while loading persistent sessions: java.io.EOFException Solutions for

This is due to the fact that when Tomcat was shut down abnormally last time, some active sessions were persisted (as some temporary files). When it was restarted, Tomcat tried to recover the persistent data of these sessions, but failed to read them. This exception does not affect the use of the system.

Solution: all the files in Catalina directory can be deleted.
all the files in Catalina directory can be deleted

When MyEclipse starts tomcat, the console doesn’t jump out

Today, I encountered a problem. Originally, when I started Tomcat through MyEclipse, the tab would automatically jump to the console to display some startup logs, but I couldn’t jump today, as shown in the figure below

The reason is due to the problem of setting, there are two solutions

1、

As shown in the figure above, click on the chart as shown in my picture.

2. Click windows – & gt; preferences – & gt; run/debug – & gt; console

Check the two show’s beginning, and it’s OK.

Just choose one of the two methods above. After setting, you can see that when we start tomcat, the next tab will automatically jump to console

Exception loading sessions from persistent storage

Tomcat error:
serious: IOException while loading persistent sessions: java.io.EOFException
Exception loading sessions from persistent storage

Error Description:
0 The session data stored in the hard disk failed to read. Eofexception indicates that the end of the file or the end of the file stream was unexpectedly reached during the input process, resulting in the failure of reading data from the session. This exception is a problem of Tomcat itself, generally because some active sessions were persisted when Tomcat was shut down abnormally last time. When Tomcat was restarted, Tomcat tried to recover these sessions N but failed to read

Solution:
find the corresponding project under Tomcat / work / Catalina / localhost session.ser File, and then delete it

The original text is reproduced from: http://blog.csdn.net/angeldhp/article/details/4742075

appear org.springframework.beans . factory.BeanCreationException Causes and solutions of abnormal

1 Abnormal description
After checking out the project from SVN and configuring it, start the Tomcat server and report the following error:

2 Abnormal Causes
By observing the abnormal information marked in the figure above, we can know

Org. Springframework. Beans. Factory. BeanCreationException: Error creating bean with the name ‘XXX’

This exception is: Injection bean failed exception.
To put it bluntly, if this exception occurs, the corresponding bean cannot be found! The reasons why bean injection can fail include but are not limited to the following:
The corresponding bean is not annotated; @service stead of dubbo; Select the wrong automatic injection method, etc.
3 Solutions
Now that we know the cause of this exception, we look back at the corresponding Bean declaration and see that the code that injected the Facade is:

@Autowired
ErrorCodeFacade errorCodeFacade;

Well, here’s the mistake! In general, when injecting interfaces at the Service and Biz layer, you can use @Autowiredfor example:

@Autowired
ErrorCodeService errorCodeService;

But, when injected into the Facade layer interface, should use the RemoteServiceFactory. GetService () , such as:

ErrorCodeFacade errorCodeFacade = RemoteServiceFactory.getService(ErrorCodeFacade.class);

That is, the exception is resolved by declaring the ErrorCodeFacade with the code above.


Warm prompt: there are many reasons for this exception, the above only lists the problems I encountered and solutions, I hope to be helpful to you!

JSON parse error: invalid UTF-8 solution series

Today, the code passed the local test and the Tomcat server was deployed. My front-end colleague gave me the following error feedback:

Request","exception":"org.springframework.http.converter.HttpMessageNotReadableException","message":"JSON parse error: Invalid UTF-8 middle byte 0x3f

I immediately started the local project and asked colleagues in the front end to connect my local project for relevant function prompts. The result was that everything was normal without any problem, and the response error messages returned by checking the front end were all 400.
The error screenshot is not saved. The format of the error response is as follows:
To be added.
 
We must be clear here: in response to the 400 error code, there are several reasons for the error:
Tomcat service transport encoding format not specified (UTF-8)
Tomcat server JAR file encoding format not specified (UTF-8)
The front-end request header parameter does not match the backend parse header parameter.
Step 1: Configure the Tomcat server to transfer the encoding format specified:
Edit the tomcat/conf/server.xml file and add encoding attributes to the Connector tag: uriEncoding =”UTF-8″

Setjava_opts =%JAVA_OPTS% -dfile.encoding =UTF-8; setjava_opts % -dfile.encoding =UTF-8

SpringMVC backend code specifies request header information:

Servlet page Jump error 500

Idea to deploy the servlet submit page jump, error 500 page report
error message jar package not add
in fact has been added to the project required jars
solution: in the tomcat lib folder under the required jars are added

Problems of accessing servlet display 404 on MyEclipse

Sometimes, when accessing a servlet in MyEclipse, a 404 page will appear. I won’t go into this if the web.xml is not configured properly or the URL is wrong, but I will talk about the situation where everything seems to be correct but I still can’t access it.
All you need to do is find the container where the servlet is running, in this case Tomcat, close it first, then locate the corresponding project in Tomcat, click ReDeploy, and then start Tomcat.

Illegalargumentexception: control character in cookie value or attribute tomcat7

It is disgusting to encounter this exception. In Tomcat7 environment, this exception will be raised if the user’s name appears in Chinese when logging in. After the exception is caused, the user who cannot log in normally needs to delete the browser’s cookie information. Later, I checked the Internet and found out that the problem was Chinese transcoding. The abnormal information is as follows:

java.lang.IllegalArgumentException: Control character in cookie value or attribute.     
    at org.apache.tomcat.util.http.CookieSupport.isV0Separator(CookieSupport.java:155)     
    at org.apache.tomcat.util.http.Cookies.processCookieHeader(Cookies.java:323)     
    at org.apache.tomcat.util.http.Cookies.processCookies(Cookies.java:157)     
    at org.apache.tomcat.util.http.Cookies.getCookieCount(Cookies.java:98)     
    at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:913)     
    at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:683)     
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:400)     
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)     
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)     
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:304)     
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)     
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)     
    at java.lang.Thread.run(Thread.java:662)   

Cookie is encoded by Unicode in Chinese and ASCII in English when storing the value, so the data needs to be transcoded when storing the Chinese value, and the data also needs to be transcoded when storing the value.
There are two solutions, one is a Cookie written in Java, and the other is a Cookie written in JavaScript.
The solution is as follows:
Java:

Encode: URLEncoder. Encode (name, “UTF-8”);
Decode.decode (name, “UTF-8”);
Decode.decode (name, “UTF-8”);

JavaScript:

Code: the escape (name);/encodeURI(name);
decode: unescape(name);/decodeURI(name);

The Servlet setting cookies to view the article: http://blog.csdn.net/twilight041132/article/details/46482983