Setting JDK in Linux Environment
After configuring/etc/profile, run Java – version and the following prompt will appear
terms of settlement:
Go to the directory where JDK is located. Implementation:
chmod 777 jdk1.8.0_ 101/bin/java
Hope to help you
div>
Error [err] 1273 – unknown collation: ‘utf8mb4_ 0900_ ai_ ci‘
terms of settlement
The utf8mb4 of SQL file_ 0900_ ai_ All CI are replaced by utf8mb4_ unicode_ ci
How to Solve ES error: “illegal_argument_exception”
The specific errors reported by ES are as follows:
| { “error”: { “root_cause”: [ { “type”: “illegal_argument_exception”, “reason”: “Fielddata is disabled on text fields by default. Set fielddata=true on [createHour] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.” } ], “type”: “search_phase_execution_exception”, “reason”: “all shards failed”, “phase”: “query”, “grouped”: true, “failed_shards”: [ { “shard”: 0, “index”: “gmall1205_order”, “node”: “LCQa858ERH6qw_7asM2R3Q”, “reason”: { “type”: “illegal_argument_exception”, “reason”: “Fielddata is disabled on text fields by default. Set fielddata=true on [createHour] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.” } } ], “caused_by”: { “type”: “illegal_argument_exception”, “reason”: “Fielddata is disabled on text fields by default. Set fielddata=true on [createHour] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.”, “caused_by”: { “type”: “illegal_argument_exception”, “reason”: “Fielddata is disabled on text fields by default. Set fielddata=true on [createHour] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.” } } }, “status”: 400 } |
2: The statement that caused this error query:
| GET gmall1205_order/_search { “query” : { “bool” : { “filter” : { “term” : { “createDate” : “2019-09-17” } } } }, “aggregations” : { “groupby_createHour” : { “terms” : { “field” : “createHour”, “size” : 24 }, “aggregations” : { “sum_totalamount” : { “sum” : { “field” : “totalAmount” } } } } } } |
3: java code:
@Override
public Map getOrderAmontHourMap(String date) {
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder();
boolQueryBuilder.filter(new TermQueryBuilder("createDate",date));
searchSourceBuilder.query(boolQueryBuilder);
TermsBuilder termsBuilder = AggregationBuilders.terms("groupby_createHour")
.field("createHour.keyword").size(24);
SumBuilder sumBuilder = AggregationBuilders.sum("sum_totalamount").field("totalAmount");
termsBuilder.subAggregation(sumBuilder);
searchSourceBuilder.aggregation(termsBuilder);
Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(GmallConstant.ES_INDEX_ORDER).addType("_doc").build();
System.out.println(searchSourceBuilder.toString());
Map<String,Double> hourMap=new HashMap<>();
try {
SearchResult searchResult = jestClient.execute(search);
System.out.println("====>"+searchResult.toString() + searchResult.getTotal());
List<TermsAggregation.Entry> buckets = searchResult.getAggregations().getTermsAggregation("groupby_createHour").getBuckets();
for (TermsAggregation.Entry bucket : buckets) {
Double hourAmount = bucket.getSumAggregation("sum_totalamount").getSum();
String hourkey = bucket.getKey();
hourMap.put(hourkey,hourAmount);
}
} catch (IOException e) {
e.printStackTrace();
}
return hourMap;
}
|
Error analysis:
“Fielddata is disabled on text fields by default. Set fielddata=true on [createHour] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead
The Fielddata text field is disabled by default. Set fielddata = true (createHour) in order to load fielddata uninverting inverting index in memory. Note that this can use a lot of memory. Or use a keyword field
4: Solution
The first:
| GET gmall1205_order/_search { “query” : { “bool” : { “filter” : { “term” : { “createDate” : “2019-09-17” } } } }, “aggregations” : { “groupby_createHour” : { “terms” : { “field” : “createHou.keyword”, “size” : 24 }, “aggregations” : { “sum_totalamount” : { “sum” : { “field” : “totalAmount” } } } } } } |
The second: the solution, custom indexing rules, do not use the default value to create the index
| PUT gmall1205_order { “mappings” : { “_doc” : { “properties” : { “provinceId” : { “type” : “keyword” }, “consignee” : { “type” : “keyword”, “index”:false }, “consigneeTel” : { “type” : “keyword”, “index”:false }, “createDate” : { “type” : “keyword” }, “createHour” : { “type” : “keyword” }, “createHourMinute” : { “type” : “keyword” }, “createTime” : { “type” : “keyword” }, “deliveryAddress” : { “type” : “keyword” }, “expireTime” : { “type” : “keyword” }, “id” : { “type” : “keyword” }, “imgUrl” : { “type” : “keyword”, “index”:false }, “operateTime” : { “type” : “keyword” }, “orderComment” : { “type” : “keyword”, “index”:false }, “orderStatus” : { “type” : “keyword” }, “outTradeNo” : { “type” : “keyword”, “index”:false }, “parentOrderId” : { “type” : “keyword” }, “paymentWay” : { “type” : “keyword” }, “totalAmount” : { “type” : “double” }, “trackingNo” : { “type” : “keyword” }, “tradeBody” : { “type” : “keyword”, “index”:false }, “userId” : { “type” : “keyword” } } } } } |
The reason and solution for the error ECONNRESET of the httpClieint request of Node.js
Background note
Recently, there is the following scene in a work project:
Use Node.js express framework to implement a file system server side, which has an API for uploading files on the client side. The client uses Node.js HttpClient to call the server-side API to upload files.
The client has no problems when uploading small files. When uploading large files, the httpClient request reports the following error.
{ [Error: socket hang up] code: 'ECONNRESET' }
I googled a lot of information, and finally looked at the relevant source code of Node.js and finally learned the cause and solution of the problem.
problem causes
The reason for this problem is: The HttpServer provided by Node.js has a default timeout of 2 minutes. When the processing time of a request exceeds 2 minutes, HttpServer will automatically close the socket of the request, so the client receives ECONNRESET Error message again . Node.js can refer to the source code .
Below we use an example to verify.
Service-Terminal:
The server side uses the express framework to register a GET method routing processing function with a path of “”. In the route processing function, the timeout processing is set through the setTimeout method, and the request will be responded to after the timeout is 3 minutes.
const express = require('express' ); const util = require('util' ); const app = express(); app.get( "/", function (req, res, next) { util.log( "Received a request." ); setTimeout( function () { res.setHeader( 'transfer-encoding','chunked' ); res.status( 200 ); util.log( "timeout" ) res.write( "hello world" ); res.end(); }, 3 * 60 * 1000 ) }); var server = app.listen(3001, function () { sutil.log( "server listening at port 3001......" ); });
Client:
The client requests the server-side interface by calling the http.request method, and prints the returned information.
const http = require('http' ); const util = require('util' ) var opt = { host: 'localhost' , port: 3001 , method: 'GET' , }; var req = http.request(opt, function (res) { util.log( 'STATUS:' , res.statusCode); res.setEncoding( 'utf8' ); var resultText ='' ; res.on( 'data', (chunk) => { resultText += chunk; }); res.on( 'end', () => { util.log(resultText); }); }); req.on( 'error', (e) => { util.log(e); }); util.log( "start request..." ) req.end();
Start the server first, then start the client. The result of the request is as follows:
Service-Terminal:
bbash- 3.2 $ node app.js 12 Nov 21 : 02 : 16 -server listening at port 3001 ...... 12 Nov 21 : 02 : 22 - Received a request. 12 Nov21 : 05 : 22 -timeout
Client:
bash- 3.2 $ node app.js 12 Nov 21 : 02 : 22 - start request... 12 Nov 21 : 04 : 22 -{[Error: socket hang up] code: ' ECONNRESET ' }
From the above running results, it can be seen that the client reported an error ECONNRESET after waiting for 2 minutes for the request.
solution
Solution: Call the server.setTimeout() method on the server side to set the server-side timeout to a larger value or directly turn off the timeout mechanism (set the timeout time to 0 to turn it off) .
Just use the above code, the client remains unchanged, and the server calls the server.setTimeout() method at the end of the file, as shown below,
var server = app.listen(3001, function () { sutil.log( "server listening at port 3001......" ); }); server.setTimeout( 0)
Start the server first, and then start the client, the results are as follows:
Service-Terminal:
bash- 3.2 $ node app.js 12 Nov 21 : 37 : 22 -server listening at port 3001 ...... 12 Nov 21 : 37 : 29 - Received a request. 12 Nov 21 : 40 : 29 -timeout
Client:
bash- 3.2 $ node app.js 12 Nov 21 : 37 : 29 - start request... 12 Nov 21 : 40 : 29 -STATUS: 200 12 Nov 21 : 40 : 29 -hello world
It can be seen from the above running results that the client can normally receive the return result from the server.
(done)
Elasticsearch 6.2.3 version executes aggregation error Fielddata is disabled on text fields by default
Background note
Execute the example of “Elasticsearch Authoritative Guide”, when executing aggregate query, error Fielddata is disabled on text fields by default.
1) The aggregation statement is as follows:
GET _search { "aggs": { "all_interests": { "terms": { "field": "interests"} } } }
2) The error message is as follows:
{ "error": { "root_cause": [ { "type": "illegal_argument_exception", "reason": "
Fielddata is disabled on text fields by default.
Set fielddata=true on [interests] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead." } ], "type": "search_phase_execution_exception", "reason": "all shards failed", "phase": "query", "grouped": true, "failed_shards": [ { "shard": 0, "index": "megacorp", "node": "jbFtoSVqQAqfYhE5uTBFvw", "reason": { "type": "illegal_argument_exception", "reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [interests] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead." } } ] }, "status": 400 }
3) The screenshot of Kibana’s Dev Tools execution is as follows:

Cause Analysis
After Elasticsearch 5.x version, operations such as sorting and aggregation are cached in memory with a separate data structure (fielddata), which is not enabled by default and needs to be enabled separately .
For details, please refer to: fielddata

solution
1) Execute the following statement to enable the mapping of the interests field:
PUT megacorp/_mapping/employee/ { "properties":{ "interests":{ "type":"text", "fielddata":true } } }
2) Execute the opening mapping statement in Dev Tools of Kibana, the screenshot is as follows:

3) Implement the aggregation statement again, and the results are as follows:
{
"took": 455,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 1,
"hits": [
{
"_index": "megacorp",
"_type": "employee",
"_id": "2",
"_score": 1,
"_source": {
"first_name": "Jane",
"last_name": "Smith",
"age": 32,
"about": "I like to collect rock albums",
"interests": [
"music"
]
}
},
{
"_index": "megacorp",
"_type": "employee",
"_id": "1",
"_score": 1,
"_source": {
"first_name": "John",
"last_name": "Smith",
"age": 25,
"about": "I love to go rock climbing",
"interests": [
"sports"
]
}
},
{
"_index": "megacorp",
"_type": "employee",
"_id": "3",
"_score": 1,
"_source": {
"first_name": "Douglas",
"last_name": "Fir",
"age": 35,
"about": "I like to build cabinets",
"interests": [
"forestry"
]
}
}
]
},
"aggregations": {
"all_interests": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "forestry",
"doc_count": 1
},
{
"key": "music",
"doc_count": 1
},
{
"key": "sports",
"doc_count": 1
}
]
}
}
}
4) In Kibana’s Dev Tools, the execution effect screenshot is as follows:

PHP encryption 3DES error Call to undefined function: mcrypt_module_open() solution
$td = mcrypt_module_open( MCRYPT_3DES,”, MCRYPT_MODE_CBC,”); It is him who reported the error.
I searched a lot of solutions, the correct method should be (only for windows system):
This error occurs when the function mcrypt_module_open is used for decryption when the server running php lacks libmcrypt.dll.
Do the following settings on the server to solve the problem.
Download a php mcrypt module installation package from the Internet, you only need the libmcrypt.dll file (generally downloaded from the official website, there is already in the php directory)
1. Copy libmcrypt.dll to the system32 directory or the extensions directory under the php installation directory
2. Copy libmcrypt.dll to the bin directory of the apache installation directory
3. Find the php.ini file in the windows directory and open it
4. Find; Directory in which the loadable extensions (modules) reside.
extension_dir = “./” such as: extension_dir = “D:\php5\ext”
these two lines, make sure that libmcrypt.dll can be found in the directory pointed to by extension_dir, or the system There is libmcrypt.dll under path
5. Find; under the Windows Extensions item; extension=php_mcrypt.dll this line and ;extension=php_iconv.dll (mine is not, omitted) these two lines, remove the front semicolon
FreeSWITCH installation error “You must install libyuv-dev to build mod_fsv” solution
When I encountered this problem when installing FreeSWITCH yesterday afternoon, I didn’t solve it all afternoon, and I took many detours. If you install libyuv-devel directly through yum, you will get an error saying that the installation package cannot be found. Later, through the online chat on the FreeSWITCH official website, I asked FreeSWITCH staff to find out how to install libyuv-devel (please refer to: http://pkgs.org/centos-6/epel-x86_64/libyuv-devel-0-0.12. 20120727svn312.el6.x86_64.rpm.html ). However, the same error is reported after installation, and it feels that it is useless to install libyuv-devel through this method. Later, the problem was solved perfectly by the following methods.
Personal installation environment:
OS: CentOS6.5 64-bit
FreeSWITCH Ver: 1.6.0
The official manual installed by FreeSWITCH (for CentOS6.*):
https://freeswitch.org/confluence/display/FREESWITCH/CentOS+6
Problems encountered during installation and solutions
1. When executing “./configure -C”, if there is an error, it means that the development package file (library file) is missing. This error is easier to solve. If any library file is missing, install the corresponding library file.
2. During the execution of “make && make install”, I encountered a troublesome error, which was not resolved for an entire afternoon yesterday afternoon, so this article was mainly written to share this error.
Error content: Makefile:797: *** You must install libyuv-dev to build mod_fsv. Stop.
solution:
(1) Download the libyuv source code and compile it
cd freeswitch/libs
git clone https://freeswitch.org/stash/scm/sd/libyuv.git
cd libyuv
make -f linux.mk CXXFLAGS=”-fPIC -O2 -fomit-frame-pointer -Iinclude/”
make install
cp /usr/lib/pkgconfig/libyuv.pc /usr/lib64/pkgconfig/
(If you just install libyuv, there will be errors next. I will list the files that I need to install after reporting the error as follows)
(2) Download the libvpx source code and compile it
cd ..
git clone https://freeswitch.org/stash/scm/sd/libvpx.git
cd libvpx
./configure –enable-pic –disable-static –enable-shared
(If Configuration failed appears. Cause of error It is: Neither yasm nor nasm have been found, please refer to the following “※” to solve the error.)
make
make install
cp /usr/local/lib/pkgconfig/vpx.pc /usr/lib64/pkgconfig/
(※) Download and compile yasm
yasm is an assembler compiler, which is an upgraded version of nasm.
Download address of yasm: http://www.tortall.net/projects/yasm/releases/
yasm decompression command: tar -zxvf ****.tar.gz (I download
Yasm-1.3.0.tar.gz ) yasm compile and install: ① ./configure, ② make, ③make install After
yasm is installed, go back to the second step and reinstall libvpx
(3) Download and compile opus
cd ..
git clone https://freeswitch.org/stash/scm/sd/opus.git
cd opus
./autogen.sh
./configure
make
make install
cp /usr/local/lib/pkgconfig/opus.pc /usr /lib64/pkgconfig
(4) Download libpng and compile
cd ..
git clone https://freeswitch.org/stash/scm/sd/libpng.git
cd libpng
./configure
make
make install
cp /usr/local/lib/pkgconfig/libpng* /usr/lib64/pkgconfig/
After downloading and installing the above four dependent files, after re-executing FreeSWITCH’s “./configure”, “make && make install” can install FreeSWITCH normally. At least the installation was successful on my side.
If there are other errors after the above four dependent files are installed, re-execute “./configure” and “make” if the following errors are reported, please refer to the following solutions:
(1) The system does not install lua error
CXX mod_lua_la-mod_lua.lo
mod_lua.cpp:37:17: error: lua.h: No such file or directory
mod_lua.cpp:38:21: error: lauxlib.h: No such file or directory
mod_lua.cpp:39: 20: error: lualib.h: No such file or directory
Solution: yum install lua lua-devel
(2) The system lacks sndfile library files
make[4]: Entering directory `/usr/local/src/freeswitch-1.6.0/src/mod/formats/mod_sndfile’
Makefile:796: *** You must install libsndfile-dev to build mod_sndfile. Stop
solution:
Download the package libsndfile-1.0.26.tar.gz and upload it to the server
Download address http://www.mega-nerd.com/libsndfile/#Download
tar zxvf libsndfile-1.0.26.tar.gz
./configure
make
make install
cp
Re-execute /usr/local/lib/pkgconfig/sndfile.pc /usr/lib64/pkgconfig Re-execute FreeSWITCH’s “./configure”, then make and make install.
How to Solve Expdp Error ORA-39126
11.2.0.2, expdp reports an error:
ORA-39126: Worker unexpected fatal error in KUPW$WORKER.GET_TABLE_DATA_OBJECTS []
ORA-31642: the following SQL statement fails:
BEGIN “SYS”.”DBMS_CUBE_EXP”.SCHEMA_CALLOUT(:1,0,1,’11.02.00.00.00′); END;
ORA-06512: at “SYS.DBMS_SYS_ERROR”, line 86
ORA-06512: at “SYS.DBMS_METADATA”, line 1245
ORA-04063: package body “SYS.DBMS_CUBE_EXP” has errors
ORA-06508: PL/SQL: could not find program unit being called: “SYS.DBMS_CUBE_EXP”
ORA-06512: at “SYS.DBMS_SYS_ERROR”, line 86
ORA-06512: at “SYS.KUPW$WORKER”, line 8353
Query the oracle document ID 1328829.1, the reason is
OLAP objects remain existing in data dictionary while OLAP is not installed or was de-installed. Verify with:
SELECT * FROM SYS.EXPPKGACT$ WHERE PACKAGE = ‘DBMS_CUBE_EXP’;
-- backup the table SYS.EXPPKGACT$ before deleting the row SQL> CREATE TABLE SYS.EXPPKGACT$_BACKUP AS SELECT * FROM SYS.EXPPKGACT$; -- delete the DBMS_CUBE_EXP from the SYS.EXPPKGACT$ SQL> DELETE FROM SYS.EXPPKGACT$ WHERE PACKAGE = 'DBMS_CUBE_EXP' AND SCHEMA= 'SYS'; SQL> COMMIT;
AN ERROR MESSAGE APPEARS WHEN TOMCAT DEPLOYS A NEW PROJECT: INVALID BYTE TAG IN CONSTANT POOL: 15
The above pile of tomcat startup prompt information is omitted, the following is the specific information of the error:
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 15
at org.apache.tomcat.util.bcel .classfile.Constant.readConstant(Constant.java:131)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:60)
at org.apache.tomcat.util.bcel.classfile .ClassParser.readConstantPool(ClassParser.java:209)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:119)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java :1911)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1800)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1759)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1745)
at org.apache.catalina.startup.ContextConfig.webConfig (ContextConfig.java:1249)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)
at org.apache. catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java: 5061)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
at org.apache.catalina.core.ContainerBase.addChild (ContainerBase.java:787)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1044)
at org.apache. catalina.startup.HostConfig.deployDirectories(HostConfig.java:967)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java: 1346)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:294)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.ContainerBase.backgroundProcess (ContainerBase.java:1233)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1391)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1401)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1380)
at java.lang.Thread.run(Thread.java:745)
First paste the error message in the control column, the following is the solution:
First of all, I deleted all the deployed projects, and then restarted tomcat, it can start successfully, and can see the welcome page, and then deploy a few small servlet test pages written by myself in turn, it is fine, and it runs normally.
However, this error was reported when some projects were deployed. The error message on the Internet seems to be very small. After all the hardships, I finally found a usable solution. The specifics are posted as follows to warn myself and benefit future generations:
{tomcat path}/conf/web.xml modification method:
<web-app version=”3.0″ xmlns=”http://java.sun.com/xml/ns/javaee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi :schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd” metadata-complete=”true”>
Solve the error of jupyter labextension install
Jupyter Lab plug-in installation
Plug-in recommendation
Error message during installation
Solution
Find the lib\site-packages\jupyterlab\commands.py file in
the python installation directory, line 83:
change into:
[Solved] dhl: Error: LINQ to Entities does not support the specified type member “Date”
Linq such as:
var v = from l in _dal.Share where l.PingcoId == pingcoId && (l.CreateTime.Date == DateTime.Now.Date) select l;
return v.ToList();
An error will be reported: LINQ to Entities does not support the specified type member “Date”.
Change to this OK:
DateTime sdt = DateTime.Now.Date;
DateTime dt = DateTime.Now.Date.AddDays(1);
var v = from l in _dal.Share where l.PingcoId == pingcoId && (l.CreateTime >= sdt && l. CreateTime <= dt) select l;
return v.ToList();
Mybatis Error: Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.
Error reporting in mybatis learning: cause: org.apache.ibatis.builder.builderexception: error creating document instance. Cause: com.sun.org.apache.xerces.internal.impl.io.malformedbytesequenceexception: byte 1 of 1-byte UTF-8 sequence is invalid.)
Error details solution
Error details
java.lang.ExceptionInInitializerError
at com.yy.dao.UserDaoTest.test(UserDaoTest.java:16)
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:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 1 字节的 UTF-8 序列的字节 1 无效。
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:80)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64)
at com.yy.utils.MybatisUtils.<clinit>(MybatisUtils.java:20)
... 23 more
Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 1 字节的 UTF-8 序列的字节 1 无效。
at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:260)
at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:126)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:81)
at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:77)
... 25 more
Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 1 字节的 UTF-8 序列的字节 1 无效。
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:701)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:567)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1895)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanData(XMLEntityScanner.java:1375)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:801)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:1034)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2982)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:258)
... 28 more
Process finished with exit code -1
When I taught mybatis by myself, I always reported this error because I wrote comments in two. XML files for easy learning
resolvent
Just delete all the Chinese comments in. XML
Just use this to record the error report, so as to avoid wasting time to find solutions when reporting errors again in the future.