Tag Archives: abnormal

Mongodb — startup exception, error report ERROR:NUMBER 100

When doing sharding — replica set, I missed a port and wanted to restart one of mongod, but I always reported an error

 

 

[ root@centos mongodb]# mongod –port 28018 –shardsvr –replSet shard1 –dbpath=/usr/local/mongodb/shard1_ 3 –logpath=/usr/local/mongodb/shard1_ 3/shard1_ 3.log –logappend –fork
Fri Apr 11 13:24:48.136
Fri Apr 11 13:24:48.136 warning: 32-bit servers don’t have journaling enabled by default. Please use –journal if you want durability.
Fri Apr 11 13:24:48.136
about to fork child process, waiting until server is ready for connections.
all output going to: /usr/local/mongodb/shard1_ 3/shard1_ 3.log
forked process: 5281
ERROR: child process failed, exited with error number 100

I checked online and found that it seems that I used violence to shut down DB before, resulting in data locking.

You need to enter the database directory and delete it mongod.lock Then, restart. That’s it.

 

 

In addition, the correct way to close mongodb.

1.kill -2 PID

2.use admin;

  db.shutdownServer ()



More attention is paid to the official account “Python column”. The background reply to “Tencent architecture resource 1” gets the big data resources prepared by Tencent architects.

Summary of common runtimeException exceptions

Common runtimeException summary in development or interview

The common types are as follows:

 

NullPointerException – null pointer reference exception
ClassCastException – type cast exception.
Illegalargumentexception – pass illegal parameter exception.
Arithmeticexception – arithmetic operation exception
arraystoreexception – storing objects incompatible with declared types into an array exception
indexoutofboundsexception – subscript out of bounds exception
negativearraysizeexception – creating an array with negative size error exception
numberformatexception – number format exception
SecurityException – Security Exception
exception Unsupported operationexception – unsupported operation exception

 

Arithmetic exception class: arithmeticexception
null pointer exception class: NullPointerException
type coercion exception: ClassCastException
array negative subscript exception: negativearrayexception
array subscript out of bounds exception: ArrayIndexOutOfBoundsException
security violation exception: SecurityException
file ended exception: eofexception
exception File not found exception: FileNotFoundException
string converted to number exception: numberformatexception
operation database exception: sqlexception
input/output exception: IOException
method not found exception: nosuchmethodexception

Java.lang.AbstractMethodError
Abstract method error. Thrown when an application attempts to call an abstract method.

java.lang.AssertionError
Wrong assertion. Used to indicate the failure of an assertion.

java.lang.ClassCircularityError
Class loop dependency error. When initializing a class, if a circular dependency between classes is detected, the exception is thrown.

java.lang.ClassFormatError
Class format error. Thrown when the Java virtual machine attempts to read a Java class from a file and detects that the contents of the file do not conform to the valid format of the class.

java.lang.Error
Wrong. Is the base class for all errors and is used to identify serious program running problems. These problems usually describe anomalies that should not be captured by the application.

java.lang.ExceptionInInitializerError
Initializer error. Thrown when an exception occurs during the execution of a class’s static initializer. Static initializers are static statements directly contained in classes.

java.lang.IllegalAccessError
Illegal access error. When an application attempts to access, modify the field of a class or call its method, but violates the visibility declaration of the field or method, it throws the exception.

java.lang.IncompatibleClassChangeError
Incompatible class change error. This exception is thrown when the class definition on which the executing method depends is changed incomparably. Generally, it is easy to cause this error when the declaration definition of some classes in the application is modified without recompiling the whole application.

java.lang.InstantiationError
Instantiation error. This exception is thrown when an application attempts to construct an abstract class or interface through Java’s new operator.

this exception is thrown java.lang.InternalError
Internal error. Used to indicate that an internal error has occurred in the Java virtual machine.

java.lang.LinkageError
Link error. This error and all its subclasses indicate that a class depends on other classes. After the class is compiled, the dependent class changes its class definition and does not recompile all the classes, thus causing an error.

java.lang.NoClassDefFoundError
Class definition error not found. This error is thrown when a Java virtual machine or class loader attempts to instantiate a class and cannot find its definition.

java.lang.NoSuchFieldError
There are no errors in the domain. This error is thrown when an application attempts to access or modify a domain of a class, but there is no definition of the domain in the definition of the class.

java.lang.NoSuchMethodError
Method has no errors. This error is thrown when an application attempts to call a method of a class and there is no definition of the method in the definition of the class.

java.lang.OutOfMemoryError
Out of memory error. This error is thrown when the available memory is insufficient for the Java virtual machine to allocate to an object.

java.lang.StackOverflowError
Stack overflow error. This error is thrown when the level of an application recursive call is too deep to cause a stack overflow.

java.lang.ThreadDeath
The thread ends. This error is thrown when the stop method of the thread class is called to indicate the end of the thread.

java.lang.UnknownError
Unknown error. Used to indicate that an unknown fatal error has occurred in the Java virtual machine.

java.lang.UnsatisfiedLinkError
Unsatisfied link error. Thrown when the Java virtual machine does not find a native language definition of a class declared as a native method.

java.lang.UnsupportedClassVersionError
Unsupported class version error. When the Java virtual machine attempts to read a class file from, but finds that the major and minor version numbers of the file are not supported by the current Java virtual machine, this error is thrown.

java.lang.VerifyError
Validation error. This error is thrown when the verifier detects an internal incompatibility or security problem in a class file.

java.lang.VirtualMachineError
Virtual machine error. It is used to indicate that the virtual machine is damaged or insufficient resources are needed to continue the operation.

java.lang.ArithmeticException
The arithmetic condition is abnormal. For example: integer divided by zero and so on.

java.lang.ArrayIndexOutOfBoundsException
Array index out of bounds exception. Thrown when the index value to the array is negative or greater than or equal to the size of the array.

java.lang.ArrayStoreException
Array storage exception. Thrown when a non array declaration type object is placed in an array.

java.lang.ClassCastException
Class shape exception. Suppose that there are classes a and B (a is not the parent or child of B), and O is an instance of a, then this exception will be thrown when o is forced to be constructed as an instance of class B. This exception is often referred to as a cast exception.

java.lang.ClassNotFoundException
Class exception not found. When the application attempts to construct a class according to the class name in the form of a string, and cannot find the class file with the corresponding name after traversing the classpath, it throws this exception.

java.lang.CloneNotSupportedException
Clone exception is not supported. When the Cloneable interface is not implemented or the clone method is not supported, the clone () method will throw this exception.

java.lang.EnumConstantNotPresentException
Enumeration constant has no exception. This exception is thrown when an application attempts to access an enumeration object by name and enumeration type, but the enumeration object does not contain a constant.

java.lang.Exception
Root exception. Describes what the application wants to capture.

java.lang.IllegalAccessException
Illegal access exception. This exception is thrown when an application attempts to create an instance of a class, access its properties, and call its methods through reflection, but it cannot access the definition of class, property, method, or construction method.

java.lang.IllegalMonitorStateException
Illegal monitoring status is abnormal. This exception is thrown when a thread tries to wait for a monitor of an object (o) that it does not own, or notifies other threads to wait for the monitor of the object (o).

java.lang.IllegalStateException
The illegal state is abnormal. When the Java environment and application are not in the legal calling state of a method, and the method is called, the exception is thrown.

java.lang.IllegalThreadStateException
Illegal thread state exception. When a method is called while it is not in legal calling state, an exception is thrown.

java.lang.IndexOutOfBoundsException
Index out of bounds exception. When the index value of accessing a sequence is less than 0 or greater than or equal to the sequence size, the exception is thrown.

java.lang.InstantiationException
Instantiation exception. This exception is thrown when an attempt is made to create an instance of a class that is an abstract class or interface through the newinstance() method.

java.lang.InterruptedException
Aborted exception. When a thread is in a long waiting, sleeping or other pause state, and other threads terminate the thread through the interrupt method of thread, this exception is thrown.

java.lang.NegativeArraySizeException
Negative array size exception. This exception is thrown when an array is created with a negative size value.

java.lang.NoSuchFieldException
Property has no exception. This exception is thrown when accessing a nonexistent property of a class.

java.lang.NoSuchMethodException
Method has no exception. This exception is thrown when a nonexistent method of a class is accessed.

java.lang.NullPointerException
Null pointer exception. This exception is thrown when the application attempts to use null where the object is required. For example: call instance method of null object, access property of null object, calculate length of null object, throw null with throw statement, etc.

java.lang.NumberFormatException
The number format is abnormal. This exception is thrown when an attempt is made to convert a string to a specified numeric type and the string does not meet the format required by the numeric type.

java.lang.RuntimeException
Runtime exception. Is the parent of all exceptions that can be thrown during normal operation of Java virtual machine.

java.lang.SecurityException
Security exception. An exception thrown by the security manager to indicate a security violation.

java.lang.StringIndexOutOfBoundsException
String index out of bounds exception. When the index value is used to access characters in a string and the index value is less than 0 or greater than or equal to the sequence size, the exception is thrown.

java.lang.TypeNotPresentException
There is no exception for the type. This exception is thrown when an application attempts to access a type in a string representation of the type name, but cannot find the type according to the given name. The difference between this exception and classnotfoundexception is that it is an unchecked exception, while classnotfoundexception is a checked exception.

java.lang.UnsupportedOperationException
Unsupported method exception. Exception indicating that the requested method is not supported.

java.lang.IllegalStateException Exception: cause analysis and solution

Today, I write a java file download program. After it’s finished, everything is normal, but it always throws out java.lang.IllegalStateException Abnormal, although it does not affect the normal use, but it always makes people feel very uncomfortable. There is nothing wrong with checking the code. Finally, I checked a lot of information on the Internet and finally found out the reason.

When we upload or download files, or filter files, we may need to use the output stream of the page.
for example, when we use it in action:
for example, when we use it in action response.reset ();
     response.setContentType (”application/ vnd.ms -excel”);
    OutputStream os = response.getOutputStream ();
throw an exception: java.lang.IllegalStateException

Cause analysis:
this is a problem in the servlet code generated by the web container out.write (), which is invoked in JSP. response.getOutputStream () conflicts.
that is, the servlet specification states that it cannot be called either response.getOutputStream (), and then call response.getWriter (), no matter which one is called first, an IllegalStateException will be thrown when calling the second one,

Because in JSP, the out variable is generated through the response.getWriter It is used in the program response.getOutputStream , and the out variable is used, so the above error occurs.

solve:

Method 1: add the following two sentences to the JSP file

<%
out.clear ();
out = pageContext.pushBody ();
%>

Defects of this method:
many development projects are not caused by JSP front-end, such as freemaker, velocity and so on“ response.getOutputStream () “not in JSP, but in servlet/action

Method 2: in action, do not return to the specific result file, return null
instead

//return SUCCESS;
return null;

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

Some file crashing failed, see logs for details

Reference: Android studio error Error:Some file crunching failed, see logs for details

Project error reporting:

Error:Some file crunching failed, see logs for details


Error:Execution failed for task ':app:mergeDebugResources'.
> Error: Some file crunching failed, see logs for details

reason:

This is a problem with the 9-patch image resource file

resolvent:

1. Modify the 9-patch image:

Click gradle console in the lower right corner to view the detailed log of gradle, such as my project:

Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]

Configuration on demand is an incubating feature.
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to D:\Users\Android\sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

useNewCruncher has been deprecated. It will be removed in a future version of the gradle plugin. New cruncher is now always enabled.
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2531Library
:app:prepareComAndroidSupportAppcompatV72531Library
:app:prepareComAndroidSupportConstraintConstraintLayout102Library
:app:prepareComAndroidSupportSupportCompat2531Library
:app:prepareComAndroidSupportSupportCoreUi2531Library
:app:prepareComAndroidSupportSupportCoreUtils2531Library
:app:prepareComAndroidSupportSupportFragment2531Library
:app:prepareComAndroidSupportSupportMediaCompat2531Library
:app:prepareComAndroidSupportSupportV42531Library
:app:prepareComAndroidSupportSupportVectorDrawable2531Library
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources

AAPT err(Facade for 1520024021): 
ERROR: 9-patch image \\?\D:\Users\Administrator\AndroidStudioProjects\Njb\app\src\main\res\drawable-xhdpi\iv_log_et_bg.9.png malformed.
AAPT err(Facade for 147729603): 
ERROR: 9-patch image \\?\D:\Users\Administrator\AndroidStudioProjects\Njb\app\src\main\res\drawable-xhdpi\commentlist.9.png malformed.
AAPT err(Facade for 1423460849): 
ERROR: 9-patch image \\?\D:\Users\Administrator\AndroidStudioProjects\Njb\app\src\main\res\drawable-mdpi\navbar.9.png malformed.
AAPT err(Facade for 1520024021):        Frame pixels must be either solid or transparent (not intermediate alphas).
AAPT err(Facade for 1423460849):        Must have one-pixel frame that is either transparent or white.
AAPT err(Facade for 147729603):        Frame pixels must be either solid or transparent (not intermediate alphas).
AAPT err(Facade for 1520024021):        Found at pixel #1 along bottom edge.
AAPT err(Facade for 147729603):        Found at pixel #565 along top edge.
AAPT err(Facade for 147729603): 
ERROR: 9-patch image \\?\D:\Users\Administrator\AndroidStudioProjects\Njb\app\src\main\res\drawable-xhdpi\supply_demand_add.9.png malformed.
AAPT err(Facade for 147729603):        Frame pixels must be either solid or transparent (not intermediate alphas).
AAPT err(Facade for 147729603):        Found at pixel #70 along top edge.

Error: Some file crunching failed, see logs for details
:app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Error: Some file crunching failed, see logs for details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 23.603 secs

First look at the English meaning:

Malformed: malformed

Facade: surface

Frame pixels must be either solid or transparent (not intermediate alpha).
frame pixels must be solid or transparent

Must have one pixel frame that is either transparent or white.
must have a transparent or white pixel frame.

In the above error log, we know which 9-patch images are problematic, and then find them one by one. The operation is as follows:

Hold down Ctrl or shift, click the left mouse button, and adjust the black part on the boundary pixel until we need the area and do not report an error.

After the completion of sync, clean it.

2. Add 9-patch ignore:

If there are any problems, please click build.gradle Add Android studio and ignore the check of 9-patch

    aaptOptions {
        cruncherEnabled = false
        useNewCruncher = false
    }

As follows:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.3'

    aaptOptions {
        cruncherEnabled = false
        useNewCruncher = false
    }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/ASL2.0'
    }

    defaultConfig {
        applicationId "com.example.administrator.njb"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
}

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!

[Jackson exception] com.fasterxml.jackson . databind.JsonMappingException Exception handling method

In the project, the parent layer is Car.java [Vehicle Entity] and the child layer is CarCommonParam.java [Vehicle Basic Entity], which is the basic information of a vehicle to multiple vehicles
But at the time of query library collection is a entity error: 【 com. Fasterxml. Jackson. Databind. JsonMappingException 】

com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: cn.skyable.zulin.common.bean.CarCommonParam_$$_jvst95e_39["handler"])
X-Zc-Ack-->null
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:59)
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:26)
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:541)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:644)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:152)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:114)
	at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:1837)
	at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:261)
	at com.ablecloud.cloudservice.ACObjectMarshaller.marshalArray(ACObjectMarshaller.java:53)
	at com.ablecloud.cloudservice.ACObjectMarshaller.marshalObject(ACObjectMarshaller.java:37)
	at com.ablecloud.cloudservice.ACObjectMarshaller.marshal(ACObjectMarshaller.java:22)
	at com.ablecloud.common.ACObject.toString(ACObject.java:415)
	at java.lang.String.valueOf(String.java:2994)
	at java.lang.StringBuilder.append(StringBuilder.java:131)
	at cn.skyable.zulin.BaseTest.dealResp(BaseTest.java:88)
	at cn.skyable.zulin.logistics.TestLogistics.TestlistCarsByLogId(TestLogistics.java:65)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:539)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:761)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:461)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:207)

Error description: A truncation is made in the entity where the child layer can look up information about the parent layer, but the parent layer cannot look up information about the child layer due to circular reference problem.
Solution:
Add to the parent car.java
Instead of

Just !!!!

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