[Four Methods] memcached unzip error: gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now

 Recently in the deployment environment, when decompressing during the installation of memcached,

 Unzip command: tar -zvxf memcached-1.4.34.tar.gz

Encountered a problem,

  gzip: stdin: not in gzip format

  tar: Child returned status 1

  tar: Error is not recoverable: exiting now

 Now I provide the solution I summarized:

method one:

#tar -vxf memcached-1.4.34.tar.gz

 Use the cvf parameter when compressing the tar package, the xvf parameter when decompressing it,
or the czvf parameter when compressing it, and the xzvf parameter when decompressing it.

If the bz package is encountered, replace the z parameter with the corresponding j parameter

Of course, if you do not solve your problem with method one like me, then look at method two. Look at the picture below, this baby is so bad that has not been resolved.

 

Method Two:

I found a way on the Internet at this time. It is to rename the memcached compressed package and decompress it.

Command: mv memcached-1.4.34.tar.gz  memcached-1.4.34.tar

Unzip again: tar -zvxf memcached-1.4.34.tar

However, it didn’t work, and my file still reported an error. This method did not solve my problem. And I feel that this method is actually similar to one.

Of course, some people can use this method. The reason for this problem may be that the installation package was originally memcached-1.4.34.tar, but the suffix was changed later.

Method three:

I accidentally saw an article saying that it might be because the installation package I downloaded online was damaged.

How to determine whether it is damaged?

Command: ls -lht view file size

And compared with the size of the installation package stored on Windows .

Sure enough, there is a problem with the installation package itself.

Well, my problem is solved here. Of course, if you have a small partner that solves your problem and a new problem arises, then you can look at method four.

Method four:

 gzip: stdin: not in gzip format
  tar: Child returned status 1
  tar: Error exit delayed from previous errors 

It is said that this is a problem of FTP transmission, and ascii transmission may be used during transmission. In this case, change to binary transmission.

Kafka error: ERROR There was an error in one of the threads during logs loading: java.lang.NumberFormatException: For input string: “derby” (kafka.log.LogManager)

1. Make a   note of Kafka error handling

 

After Kafka was stopped, an error occurred when restarting :

[2017-10-27 09:43:18,313] INFO Recovering unflushed segment 15000679 in log mytest-0. (kafka.log.Log)

[2017-10-27 09:43:18,972] ERROR There was an error in one of the threads during logs loading: java.lang.NumberFormatException: For input string: “derby” (kafka.log.LogManager)

[2017-10-27 09:43:18,975] FATAL [Kafka Server 0], Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)

java.lang.NumberFormatException: For input string: “derby”

        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)

        at java.lang.Long.parseLong (Long.java:589)

        at java.lang.Long.parseLong (Long.java:631)

        at scala.collection.immutable.StringLike$class.toLong(StringLike.scala:277)

        at scala.collection.immutable.StringOps.toLong(StringOps.scala:29)

        at kafka.log.Log$.offsetFromFilename(Log.scala:1648)

        at kafka.log.Log $$ anonfun $ loadSegmentFiles $ 3.apply (Log.scala: 284)

        at kafka.log.Log $$ anonfun $ loadSegmentFiles $ 3.apply (Log.scala: 272)

        at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:733)

 

Looking directly at the error log, you can see from the log that there is an obvious error:

ERROR There was an error in one of the threads during logs loading: java.lang.NumberFormatException: For input string: “derby” (kafka.log.LogManager) 

From the original meaning, it can be seen that there is a thread that made an error while loading the log, java.lang.NumberFormatException throws an exception, and the input string derby has a problem.

What the hell? ?

First, let’s analyze what to do when kafka restarts: When the
kafka broker is started, the data of each topic before it will be reloaded, and under normal circumstances, it will prompt that each topic is restored.

INFO Recovering unflushed segment 8790240 in log userlog-2. (kafka.log.Log)

INFO Loading producer state from snapshot file 00000000000008790240.snapshot for partition userlog-2 (kafka.log.ProducerStateManager)

INFO Loading producer state from offset 10464422 for partition userlog-2 with message format version 2 (kafka.log.Log)

INFO Loading producer state from snapshot file 00000000000010464422.snapshot for partition userlog-2 (kafka.log.ProducerStateManager)

INFO Completed load of log userlog-2 with 2 log segments, log start offset 6223445 and log end offset 10464422 in 4460 ms (kafka.log.Log)

 

But when the data recovery under some topics fails, it will cause the broker to shut down, and an error will be reported:
ERROR There was an error in one of the threads during logs loading: java.lang.NumberFormatException: For input string: “derby” (kafka .log.LogManager)

Now it is clear that the problem lies in the topic data. What is the problem? ?

Quickly go to the place where kafka stores the topic, this path is set in server.properties:

log.dirs=/data/kafka/kafka-logs

) From the previous line of the error log:

 It can be seen that the problem occurred when loading the topic mytest-0. Go directly to the directory where this topic is located, and find that there is an illegal file called derby.log. Delete it directly and restart the service.

) Check it completely and make sure that there is no similar document

#cd /data/kafka/kafka-logs

#find /data/kafka/kafka-logs/ -name “derby*”

You can see that there is a derby.log file under topic, mytest-0, which is illegal. Because kafka broker requires all data file names to be of type Long Just delete this file and restart kafka.

 

2.    Remember a kafka, zookeeper error report

Both    Kafka and zookeeper started normally, but from the log, it was disconnected soon after being connected. The error message is as follows:

[2017-10-27 15:06:08,981] INFO Established session 0x15f5c88c014000a with negotiated timeout 240000 for client /127.0.0.1:33494 (org.apache.zookeeper.server.ZooKeeperServer)

[2017-10-27 15:06:08,982] INFO Processed session termination for sessionid: 0x15f5c88c014000a (org.apache.zookeeper.server.PrepRequestProcessor)

[2017-10-27 15:06:08,984] WARN caught end of stream exception (org.apache.zookeeper.server.NIOServerCnxn)

EndOfStreamException: Unable to read additional data from client sessionid 0x15f5c88c014000a, likely client has closed socket

        at org.apache.zookeeper.server.NIOServerCnxn.doIO (NIOServerCnxn.java:239)

at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203)

at java.lang.Thread.run(Thread.java:745)

 

From the literal meaning of the log, the first log: said that session 0x15f5c88c014000a timed out after 240 seconds (what the hell?); continue to the second log and said 0x15f5c88c014000a This session ended, and the timeout caused the session to be disconnected. This is Understand; Ok, let’s look at the third item: You can’t read additional data from the 0x15f5c88c014000a session. (All disconnected, how to read). So far log analysis is complete, it seems that the session timeout disconnection. Just increase the connection time of the session.

The configured timeout is too short, Zookeeper has not finished reading the data of Consumer , and the connection is disconnected by Consumer !

 

Solution:

Modify kafka’s server.properties file:

# Timeout in ms for connecting to zookeeper

zookeeper.connection.timeout.ms=600000

zookeeper.session.timeout.ms=400000

 

Generally it is fine. If you are not at ease, change the zookeeper configuration file:

# disable the per-ip limit on the number of connections since this is a non-production config

maxClientCnxns=1000

tickTime = 120000

 

Mydumper Install Error: None of the required ‘glib-2.0’/’gthread-2.0’ found

mydumper official website: https://launchpad.net/mydumper

After downloading, installation error:

[root@localhost local]# cd mydumper-0.6.2
[root@localhost mydumper-0.6.2]#
[root@localhost mydumper-0.6.2]# ls
binlog.c  CMakeCache.txt  common.h     docs             g_unix_signal.h  myloader.c  Processing  server_detect.c
binlog.h  CMakeFiles      config.h     Finished         mydumper.c       myloader.h  README      server_detect.h
cmake     CMakeLists.txt  config.h.in  g_unix_signal.c  mydumper.h       Package     Running
[root@localhost mydumper-0.6.2]# cmake .
-- The CXX compiler identification is GNU 4.4.7
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using mysql-config: /usr/local/mysql/bin/mysql_config
-- Found MySQL: /usr/local/mysql/include, /usr/local/mysql/lib/libmysqlclient.so;/usr/lib/libpthread.so;/usr/lib/libm.so;/usr/lib/librt.so;/usr/lib/libdl.so
-- checking for one of the modules 'glib-2.0'
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:363 (message):
  None of the required 'glib-2.0' found
Call Stack (most recent call first):
  cmake/modules/FindGLIB2.cmake:10 (pkg_search_module)
  CMakeLists.txt:10 (find_package)


-- checking for one of the modules 'gthread-2.0'
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:363 (message):
  None of the required 'gthread-2.0' found
Call Stack (most recent call first):
  cmake/modules/FindGLIB2.cmake:11 (pkg_search_module)
  CMakeLists.txt:10 (find_package)



CMake Warning at docs/CMakeLists.txt:9 (message):
  Unable to find Sphinx documentation generator


- ------------------------------------------------
-- MYSQL_CONFIG = /usr/local/mysql/bin/mysql_config
-- CMAKE_INSTALL_PREFIX = /usr/local
-- BUILD_DOCS = ON
-- WITH_BINLOG = OFF
-- RUN_CPPCHECK = OFF
-- Change a values with: cmake -D<Variable>=<Value>
- ------------------------------------------------
--
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
GLIB2_LIBRARIES (ADVANCED)
    linked by target "mydumper" in directory /usr/local/mydumper-0.6.2
    linked by target "myloader" in directory /usr/local/mydumper-0.6.2
GTHREAD2_LIBRARIES (ADVANCED)
    linked by target "mydumper" in directory /usr/local/mydumper-0.6.2
    linked by target "myloader" in directory /usr/local/mydumper-0.6.2

-- Configuring incomplete, errors occurred!
See also "/usr/local/mydumper-0.6.2/CMakeFiles/CMakeOutput.log".
See also "/usr/local/mydumper-0.6.2/CMakeFiles/CMakeError.log".

cmake. Error:

None of the required 'glib-2.0' found
None of the required 'gthread-2.0' found

I searched the Internet but didn’t find a solution, so I had to go to the official website to find a solution:

https://answers.launchpad.net/mydumper/+faq/349

Run:
 cmake .
 make

One needs to install development versions of required libaries (MySQL, GLib, ZLib, PCRE):
NOTE: you must use the correspondent mysql devel package.

* Ubuntu or Debian: apt-get install libglib2.0-dev libmysqlclient15-dev zlib1g-dev libpcre3-dev libssl-dev
* Fedora, RedHat and CentOS: yum install glib2-devel mysql-devel zlib-devel pcre-devel openssl-devel
* openSUSE: zypper install glib2-devel libmysqlclient-devel pcre-devel zlib-devel
* MacOSX: port install glib2 mysql5 pcre pkgconfig cmake
 (You may want to run 'port select mysql mysql5' afterwards)

One has to make sure, that pkg-config, mysql_config, pcre-config are all in $PATH

Binlog dump is disabled by default to compile with it you need to add -DWITH_BINLOG=ON to cmake options

Obviously you need compiler and make packages too :)

You can see that you need to install dependencies:

Fedora, RedHat and CentOS: yum install glib2-devel mysql-devel zlib-devel pcre-devel openssl-devel

So follow the instructions to install:

[root@localhost mydumper-0.6.2]# yum install glib2-devel mysql-devel zlib-devel pcre-devel openssl-devel
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * c6-media:
Package mysql-devel-5.1.73-3.el6_5.i686 already installed and latest version
Package zlib-devel-1.2.3-29.el6.i686 already installed and latest version
Package pcre-devel-7.8-6.el6.i686 already installed and latest version
Package openssl-devel-1.0.1e-30.el6.i686 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package glib2-devel.i686 0:2.28.8-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================================================
 Package                            Arch                        Version                             Repository                       Size
==========================================================================================================================================
Installing:
 glib2-devel                        i686                        2.28.8-4.el6                        c6-media                        298 k

Transaction Summary
==========================================================================================================================================
Install       1 Package(s)

Total download size: 298 k
Installed size: 1.5 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : glib2-devel-2.28.8-4.el6.i686                                                                                          1/1
Unable to connect to dbus
  Verifying  : glib2-devel-2.28.8-4.el6.i686                                                                                          1/1

Installed:
  glib2-devel.i686 0:2.28.8-4.el6

Complete!

Then compile and install mydumper:

[root@localhost mydumper-0.6.2]# cmake .
-- Using mysql-config: /usr/local/mysql/bin/mysql_config
-- Found MySQL: /usr/local/mysql/include, /usr/local/mysql/lib/libmysqlclient.so;/usr/lib/libpthread.so;/usr/lib/libm.so;/usr/lib/librt.so;/usr/lib/libdl.so
-- checking for one of the modules 'glib-2.0'
-- checking for one of the modules 'gthread-2.0'

CMake Warning at docs/CMakeLists.txt:9 (message):
  Unable to find Sphinx documentation generator


- ------------------------------------------------
-- MYSQL_CONFIG = /usr/local/mysql/bin/mysql_config
-- CMAKE_INSTALL_PREFIX = /usr/local
-- BUILD_DOCS = ON
-- WITH_BINLOG = OFF
-- RUN_CPPCHECK = OFF
-- Change a values with: cmake -D<Variable>=<Value>
- ------------------------------------------------
-
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/mydumper-0.6.2
[root@localhost mydumper-0.6.2]# echo $?
0
[root@localhost mydumper-0.6.2]# make
Scanning dependencies of target mydumper
[ 25%] Building C object CMakeFiles/mydumper.dir/mydumper.c.o
[ 50%] Building C object CMakeFiles/mydumper.dir/server_detect.c.o
[ 75%] Building C object CMakeFiles/mydumper.dir/g_unix_signal.c.o
Linking C executable mydumper
[ 75%] Built target mydumper
Scanning dependencies of target myloader
[100%] Building C object CMakeFiles/myloader.dir/myloader.c.o
Linking C executable myloader
[100%] Built target myloader
[root@localhost mydumper-0.6.2]# make install
[ 75%] Built target mydumper
[100%] Built target myloader
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/mydumper
-- Removed runtime path from "/usr/local/bin/mydumper"
-- Installing: /usr/local/bin/myloader
-- Removed runtime path from "/usr/local/bin/myloader"

Successful installation. But an error was reported during execution:

[root@localhost mydumper-0.6.2]# mydumper --help
mydumper: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

Solution:

[root@localhost mydumper-0.6.2]# ldd /usr/local/bin/mydumper
        linux-gate.so.1 =>  (0x00f91000)
        libmysqlclient.so.18 => not found
        libpthread.so.0 => /lib/libpthread.so.0 (0x006fc000)
        libm.so.6 => /lib/libm.so.6 (0x0072b000)
        librt.so.1 => /lib/librt.so.1 (0x00720000)
        libdl.so.2 => /lib/libdl.so.2 (0x00719000)
        libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x00757000)
        libgthread-2.0.so.0 => /lib/libgthread-2.0.so.0 (0x00918000)
        libpcre.so.0 => /lib/libpcre.so.0 (0x021a8000)
        libz.so.1 => /lib/libz.so.1 (0x002ea000)
        libc.so.6 => /lib/libc.so.6 (0x00564000)
        /lib/ld-linux.so.2 (0x0053e000)
[root@localhost mydumper-0.6.2]#  LD_DEBUG=libs /usr/local/bin/mydumper -v
      2707:     find library=libmysqlclient.so.18 [0]; searching
      2707:      search cache=/etc/ld.so.cache
      2707:      search path=/lib/tls/i686/sse2:/lib/tls/i686:/lib/tls/sse2:/lib/tls:/lib/i686/sse2:/lib/i686:/lib/sse2:/lib:/usr/lib/tls /i686/sse2:/usr/lib/tls/i686:/usr/lib/tls/sse2:/usr/lib/tls:/usr/lib/i686/sse2:/usr/lib/i686:/usr/lib/sse2:/usr/lib             (system s earch path)
      2707:       trying file=/lib/tls/i686/sse2/libmysqlclient.so.18
      2707:       trying file=/lib/tls/i686/libmysqlclient.so.18
      2707:       trying file=/lib/tls/sse2/libmysqlclient.so.18
      2707:       trying file=/lib/tls/libmysqlclient.so.18
      2707:       trying file=/lib/i686/sse2/libmysqlclient.so.18
      2707:       trying file=/lib/i686/libmysqlclient.so.18
      2707:       trying file=/lib/sse2/libmysqlclient.so.18
      2707:       trying file=/lib/libmysqlclient.so.18
      2707:       trying file=/usr/lib/tls/i686/sse2/libmysqlclient.so.18
      2707:       trying file=/usr/lib/tls/i686/libmysqlclient.so.18
      2707:       trying file=/usr/lib/tls/sse2/libmysqlclient.so.18
      2707:       trying file=/usr/lib/tls/libmysqlclient.so.18
      2707:       trying file=/usr/lib/i686/sse2/libmysqlclient.so.18
      2707:       trying file=/usr/lib/i686/libmysqlclient.so.18
      2707:       trying file=/usr/lib/sse2/libmysqlclient.so.18
      2707:       trying file=/usr/lib/libmysqlclient.so.18

Libmysqlclient.so. 18 not found

[root@localhost mydumper-0.6.2]# locate libmysqlclient.so.18
/usr/local/mysql-5.6.26-linux-glibc2.5-i686/lib/libmysqlclient.so.18
/usr/local/mysql-5.6.26-linux-glibc2.5-i686/lib/libmysqlclient.so.18.1.0
[root@localhost mydumper-0.6.2]# ll /usr/local/mysql-5.6.26-linux-glibc2.5-i686/lib/libmysqlclient.so.18
lrwxrwxrwx. 1 root mysql 24 Aug 13 14:18 /usr/local/mysql-5.6.26-linux-glibc2.5-i686/lib/libmysqlclient.so.18 -> libmysqlclient.so.18.1.0

Then copy /usr/ local/mysql- 5.6. 26-linux-glibc2. 5-i686/lib/libmysqlclient.so. 18.1. 0 to /usr/lib/ Kinoshita:

[root@localhost mydumper-0.6.2]# cp /usr/local/mysql-5.6.26-linux-glibc2.5-i686/lib/libmysqlclient.so.18.1.0 /usr/lib/libmysqlclient.so.18
[root@localhost mydumper-0.6.2]# ldd /usr/local/bin/mydumper                                                                                      linux-gate.so.1 =>  (0x00805000)
        libmysqlclient.so.18 => /usr/lib/libmysqlclient.so.18 (0x0019f000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x006fc000)
        libm.so.6 => /lib/libm.so.6 (0x0072b000)
        librt.so.1 => /lib/librt.so.1 (0x00720000)
        libdl.so.2 => /lib/libdl.so.2 (0x00719000)
        libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x0055e000)
        libgthread-2.0.so.0 => /lib/libgthread-2.0.so.0 (0x00918000)
        libpcre.so.0 => /lib/libpcre.so.0 (0x021a8000)
        libz.so.1 => /lib/libz.so.1 (0x0067b000)
        libc.so.6 => /lib/libc.so.6 (0x0091d000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x07b14000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0068f000)
        /lib/ld-linux.so.2 (0x0053e000)

test:

[root@localhost mydumper-0.6.2]# mydumper --help
Usage:
  mydumper [OPTION...] multi-threaded MySQL dumping

Help Options:
  -?, --help                  Show help options

Application Options:
  -B, --database              Database to dump
  -T, --tables-list           Comma delimited table list to dump (does not exclude regex option)
  -o, --outputdir             Directory to output files to
  -s, --statement-size        Attempted size of INSERT statement in bytes, default 1000000
  -r, --rows                  Try to split tables into chunks of this many rows. This option turns off --chunk-filesize
  -F, --chunk-filesize        Split tables into chunks of this output file size. This value is in MB
  -c, --compress              Compress output files
  -e, --build-empty-files     Build dump files even if no data available from table
  -x, --regex                 Regular expression for 'db.table' matching
  -i, --ignore-engines        Comma delimited list of storage engines to ignore
  -m, --no-schemas            Do not dump table schemas with the data
  -k, --no-locks              Do not execute the temporary shared read lock.  WARNING: This will cause inconsistent backups
  --less-locking              Minimize locking time on InnoDB tables.
  -l, --long-query-guard      Set long query timer in seconds, default 60
  -K, --kill-long-queries     Kill long running queries (instead of aborting)
  -D, --daemon                Enable daemon mode
  -I, --snapshot-interval     Interval between each dump snapshot (in minutes), requires --daemon, default 60
  -L, --logfile               Log file name to use, by default stdout is used
  --tz-utc                    SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones, defaults to on use --skip-tz-utc to disable.
  --skip-tz-utc
  --use-savepoints            Use savepoints to reduce metadata locking issues, needs SUPER privilege
  --success-on-1146           Not increment error count and Warning instead of Critical in case of table doesn't exist
  --lock-all-tables           Use LOCK TABLE for all, instead of FTWRL
  -h, --host                  The host to connect to
  -u, --user                  Username with privileges to run the dump
  -p, --password              User password
  -P, --port                  TCP/IP port to connect to
  -S, --socket                UNIX domain socket file to use for connection
  -t, --threads               Number of threads to use, default 4
  -C, --compress-protocol     Use compression on the MySQL connection
  -V, --version               Show the program version and exit
  -v, --verbose               Verbosity of output, 0 = silent, 1 = errors, 2 = warnings, 3 = info, default 2

Get it done.

Enlightenment: The best way to solve the problem is to check the documentation and instructions on the official website.

How to Solve Maven Error: Return code is: 501 , ReasonPhrase:HTTPS Required.

When using jenkins to build today, the following error was reported

  [ERROR] Failed to execute goal on project saas20: Could not resolve dependencies for project com.ipower365.saas:saas20:war:0.0.1-SNAPSHOT: Failed to collect dependencies at com.ipower365.saas:messageserviceimpl:jar:0.0.1-SNAPSHOT -> com.ipower365.boss:nacha:jar:1.0.1: Failed to read artifact descriptor for com.ipower365.boss:nacha:jar:1.0.1: Could not transfer artifact com.ipower365.boss:nacha:pom:1.0.1 from/to central (http://repo1.maven.org/maven2/):Failed to transfer file:http://repo1.maven.org/maven2/com/ipower365/boss/nacha/1.0.1/nacha-1.0.1.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1]

We found that this dependent file is available in the local warehouse, but during the build process, after downloading the file in the local nexus, it will still request the file download like the central warehouse.

    [echoing saas20] Downloading from central: http://repo1.maven.org/maven2/com/ipower365/boss/nacha/1.0.1/nacha-1.0.1.pom

After that, we searched for the problem based on the returned 501 error. The reference link is as follows:

https://stackoverflow.com/questions/59763531/maven-dependencies-are-failing-with-501-error

 

 

As mentioned above, since January 15, 2020, the central repository no longer supports insecure communication via pure HTTP, and requires all requests to the repository to be encrypted via HTTPS.

So we added the following configuration to the settings file that we relied on during the build process:

1
2
3
4
5
6
<mirror>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>https://repo1.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>

But the problem is still not resolved, and then an error is reported, the error is as follows:

    Could not transfer artifact com.ipower365.boss:nacha:pom:1.0.1 from/to central (https://repo1.maven.org/maven2/):Received fatal alert: protocol_version -> [Help 1]

This is when using the https protocol to request the central warehouse, the protocol version needs to be specified, and then the following parameters are added when building, the reference link is as follows: 

https://stackoverflow.com/questions/50824789/why-am-i-getting-received-fatal-alert-protocol-version-or-peer-not-authentic

1
-Dhttps.protocols=TLSv1.2

Then when you build again, the request is passed!

Reason: Our Java environment uses 7 and 8, while our mvn version uses 3.5.x.

Therefore, when using mvn packaging in the JAVA8 environment, the above parameters do not need to be specified, but when using the JAVA7 environment, the above error will occur. Later, we will consider updating the version of mvn and unified JAVA environment

[Solved] Virtualenvwrapper.sh error: There was a problem running the initialization hooks.

In the ubuntu environment, I made a soft link between python and python3.6 (ln -s python python3.6), and I made a soft link with pip, so after installing virtualenvwrapper with pip, start virtualenvwrapper at source. When sh and workon virtual environment always report an error:

1 ./virtualenvwrapper.sh: line 230: : command not found
2 virtualenvwrapper.sh: There was a problem running the initialization hooks.
3 
4 If Python could not import the module virtualenvwrapper.hook_loader,
5 check that virtualenvwrapper has been installed for
6 VIRTUALENVWRAPPER_PYTHON= and that PATH is
7 set properly.

This is the statement on line 230 according to the hint:

1 "$VIRTUALENVWRAPPER_PYTHON" -m 'virtualenvwrapper.hook_loader' \

Combined with the error message and the sentence found in the prompt, it is guessed that there should be a problem with VIRTUALENVWRAPPER_PYTHON, and then look for VIRTUALENVWRAPPER_PYTHON in the virtualenvwrapper.sh file, and find the key points:

1 # Locate the global Python where virtualenvwrapper is installed.
 2  if [ " ${VIRTUALENVWRAPPER_PYTHON:-} " = "" ]
 3  then
 4      VIRTUALENVWRAPPER_PYTHON = " $(command \which python3) " # It was originally written \which python, here The one posted is after I modified it to python3. 
5 fi

VIRTUALENVWRAPPER_PYTHON is used (Locate the global Python where virtualenvwrapper is installed.) to locate which python has virtualenvwrapper installed. The location originally specified is python, which is version 2.7. Since I installed it using python3.6 before, I need to change it to python3 here. Then the error disappeared.


The advantage of using virtualenvwrapper is that you don’t need to use source /xxx/virtual environment/bin/activate every time to start the virtual environment. Configure it in ~/.bashrc. You can directly use the workon command to open the virtual environment in the future. The specific steps and premise You have installed python-virtualenv:

# Setup:
#  1. Create a directory to hold the virtual environments.
#     (mkdir $HOME/.virtualenvs).
#  2. Add a line like "export WORKON_HOME=$HOME/.virtualenvs"
#     to your .bashrc.
#  3. Add a line like "source /path/to/this/file/virtualenvwrapper.sh"
#     to your .bashrc.
#  4. Run: source ~/.bashrc
#  5. Run: workon
#  6. A list of environments, empty, is printed.
#  7. Run: mkvirtualenv temp
#  8. Run: workon
#  9. This time, the "temp" environment is included.
# 10. Run: workon temp
# 11. The virtual environment is activated.

Ionic3 update open apk android 8.0 error FileUriExposedException

Android compulsory update in the project, when the file is downloaded. The apk package cannot be opened in android 8.0.

Introduce the plug-in to report the error

import { FileOpener } from '@ionic-native/file-opener';

constructor(private fileOpener: FileOpener) { }

...

this.fileOpener.open('path/to/file.pdf', 'application/pdf')
  .then(() => console.log('File is opened'))
  . catch (e => console.log('Error opening file', e));

 

FileUriExposedException: file:///storage/emulated/0/test.txt exposed beyond app through Intent.getData()

========================================

According to cordova’s official website, android 8.0 needs to add a configuration file.

Android APK installation restrictions
When opening the APK file for installation, the following restrictions apply:

In Android 8 + on, your application must have ACTION_INSTALL_PACKAGE permission. You can add it by adding it to your application config.xml file:
     <platform name= " android " >
        <config-file parent="/manifest" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">
            <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
        </config-file>
    </platform> 
Before Android 7, you could only install APKs from the "external" partition. For example, you can install cordova.file.externalDataDirectory from it, but not cordova.file.dataDirectory from it. Android 7 + does not have this limitation.

After adding the above content, it still reports an error.

 

Solution:

The above is the answer of the great god. Finally modify in AndroidManifest.xml

1
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />

 The default configuration of ionic3 is 16-26. After many trials, only the direct sdk version of 16-23 is supported. The higher the version, the above error will be reported.

Solve the problem of packaging again! ! !

How to Solve JS error: Unexpected end of JSON input,Unexpected token u in JSON at position 0

js error Unexpected end of JSON input, Unexpected token u in JSON at position 0

JSON is usually used to exchange data with the server.

When receiving server data, it is generally a character string.

We can use the JSON.parse() method to convert the data into JavaScript objects.

Try the returned results of these kinds of parameters in the Console debugging platform of Google Chrome:

JSON.parse( null );
 // null 

JSON.parse( "" );
 // VM6600:1 Uncaught SyntaxError: Unexpected end of JSON input

JSON.parse(undefined);
// VM6635:1 Uncaught SyntaxError: Unexpected token u in JSON at position 0

It can be found that the parameters of JSON.parse() must conform to the format of the JSON string to be correctly converted into objects, otherwise it may cause errors and affect other codes.

When we are not sure about the type of data returned by the server, these few examples can be used:

// Judging whether the data exists 
var str = str && JSON.parse(str) || {};

// Judging the data type 
var str = typeof str == "string"? JSON.parse(str): {};

// Catch exceptions by try catch to prevent the code from reporting errors 
var c = null ;
 try {
    c = JSON.parse(str)
} catch (d) {}

The same is true for JSON.stringify

var g = "" ;
 try {
    g = JSON.stringify(a)
} catch (u) {}

"object" == typeof a? JSON.stringify(a): a

How to Solve Python AttributeError: ‘dict’ object has no attribute ‘item’

AttributeError: ' dict ' object has no attribute ' item '

This error means that python cannot find the attributes of the corresponding object, and the beginners don’t know enough about the function object, which leads to errors

Original code:

favorite_languages ​​= {
     ' jen ' : ' python ' ,
     ' sarah ' : ' c ' ,
     ' edward ' : ' ruby ' ,
     ' phil ' : ' python ' ,
    }
for name,language in favorite_languages.item():
     print (name.title()+ " 's favorite language is " +language.title()+ " . " )

The text editors we use generally use obvious colors as hints:

 

 Modified code:

favorite_languages ​​= {
     ' jen ' : ' python ' ,
     ' sarah ' : ' c ' ,
     ' edward ' : ' ruby ' ,
     ' phil ' : ' python ' ,
    }
for name,language in favorite_languages.items():
     print (name.title()+ " 's favorite language is " +language.title()+ " . " )

operation result:

1 Jen ' s favorite language is Python. 
2 Sarah ' s favorite language is C. 
3 Edward ' s favorite language is Ruby. 
4 Phil ' s favorite language is Python. 
5 Sarah ' s favorite language is C.

 Summarize the commonly used Python error types as follows:

  • ZeroDivisionError-divide (or modulo) zero (all data types) 
  • ValueError-Invalid parameter passed in 
  • AssertionError-assertion statement failed 
  • StopIteration-the iterator has no more values 
  • IndexError-there is no such index in the sequence (index) 
  • IndentationError-indentation error 
  • OSError-input/output operation failed 
  • ImportError——Failed to import module/object 
  • NameError-Object not declared/initialized (no attributes) 
  • AttributeError- indicating that the object does not have this attribute
  • GeneratorExit-an exception occurs in the generator to notify the exit 
  • TypeError-invalid operation on the type 
  • KeyboardInterrupt-user interrupt execution (usually input ^C) 
  • OverflowError-Numerical operation exceeds the maximum limit 
  • FloatingPointError-floating point calculation error 
  • BaseException-the base class of all exceptions 
  • SystemExit-interpreter requests to exit 
  • Exception-the base class for general errors 
  • StandardError-the base class for all built-in standard exceptions 
  • ArithmeticError-the base class for all numerical calculation errors 
  • EOFError-there is no built-in input, reaching the EOF mark 
  • EnvironmentError-the base class for operating system errors 
  • WindowsError-system call failed 
  • LookupError-the base class for invalid data query 
  • KeyError-there is no such key in the map 
  • MemoryError-memory overflow error (not fatal to the Python interpreter) 
  • UnboundLocalError-access to uninitialized local variables 
  • ReferenceError-Weak reference attempts to access objects that have been garbage collected 
  • RuntimeError-general runtime error 
  • NotImplementedError-method not yet implemented 
  • SyntaxError Python-syntax error 
  • TabError-Tab and space are mixed 
  • SystemError-general interpreter system error 
  • UnicodeError-Unicode related errors 
  • UnicodeDecodeError-Unicode decoding error 
  • UnicodeEncodeError-Unicode encoding error 
  • UnicodeTranslateError-Unicode conversion error

The following are warning types 

  • Warning-the base class of warnings 
  • DeprecationWarning-warning about deprecated features 
  • FutureWarning-a warning that the semantics of the structure will change in the future 
  • OverflowWarning-old warning about automatic promotion to long integer (long) 
  • PendingDeprecationWarning-warning about the feature will be deprecated 
  • RuntimeWarning-warning of suspicious runtime behavior 
  • SyntaxWarning-warning of suspicious syntax 
  • UserWarning-warning generated by user code

Log jar package conflict error: Class path contains multiple SLF4J bindings

Description of the problem: Tomcat is stuck at startup, and the error log is as follows: 

November 07, 2017 8:35:45 PM org.apache.catalina.core.ApplicationContext log
Information: Initializing Spring root WebApplicationContext
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file: /E:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/wlf-notify/WEB-INF/lib/log4j-slf4j- impl-2.9.1.jar!/org/slf4j/impl/StaticLoggerBinder. class ]
SLF4J: Found binding in [jar:file: /E:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/wlf-notify/WEB-INF/lib/slf4j-log4j12- 1.7.2.jar!/org/slf4j/impl/StaticLoggerBinder. class ]
SLF4J: See http: // www.slf4j.org/codes.html#multiple_bindings for an explanation. 
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]

  Problem location: From the log, I see that the two log jar packages conflict: log4j-slf4j-impl-2.9.1.jar and slf4j-log4j12-1.7.2.jar   

  Solve the problem:

  1. Simple solution: According to the local tomcat path given in the log, enter the lib, delete one of them, and enter E:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/ wlf-notify/WEB-INF/lib, delete log4j-slf4j-impl-2.9.1.jar, and restart.

  2. The fundamental solution: through maven’s dependency tree analysis, and then through execluse to eliminate conflicting dependencies in pom.xml.

How to Solve Import antd Error: Module build failed

1. Create a project using the create-react-app tool

1
create-react-app antd-demo

2. Install babel-plugin-import

1
npm install babel-plugin-import --dev

3. Quote antd on demand

Introduced in App.js,

1
import { Button } from 'antd';

Configure babel in package.json

1
2
3
4
5
6
7
8
9
10
11
"babel": {
   "plugins": [
     [
       "import",
       {
         "libraryName""antd",
         "style"true
       }
     ]
   ]
 },

Finally, an error was reported when the project started, and the error message is as follows

1
2
3
4
5
6
7
8
./node_modules/antd/lib/button/style/index.less
Module build failed:
// https://github.com/ant-design/ant-motion/issues/44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
      in E:\webstrom\migu\ngoc\web\react-interface\react-interface-cli\node_modules\antd\lib\style\color\bezierEasing.less (line 110, column 0)

Finally put “style”: “css” on it

The style here can be true or’css’, but I don’t know why I use true and I get an error.

babel-plugin-import configuration, options can be an array

1
2
3
  "plugins":[["import",options]] 
}

Import the js module:

1
["import", { "libraryName""antd" }]

Import js and css modules (LESS/Sass source files):

1
["import", { "libraryName""antd""style"true }]

Import js and css modules (css built-in files):

1
["import", { "libraryName""antd""style""css" }] 

[Solved] Springboot Startup Error: Consider defining a bean of type ‘XXX’ in your configuration.

I. Introduction:

The project was built using springboot automatic injection, but an error was reported when it started! ! ! , The error is as shown below:

Description: Field userEntityMapper in com.xxx.xxx.service.UserService required a bean of

 type'com.xxx.xxx.dao.UserEntityMapper' that could not be found.
 
Action: Consider defining a bean of

 type'com.xxx.xxx .dao.UserEntityMapper' in your configuration.

2. Solution:

1. Check whether the annotations you wrote are wrong, and not.

2. Find solutions on the Internet: as follows:

step one:

  Add in the configuration file of springboot, the configuration of mybatis is as follows:

mybatis: 
  typeAliasesPackage: com.xxx.xxx.dao.entity 
  mapperLocations: classpath:mapper/*.xml

 Step two:

  ① Put the interface and the corresponding implementation class in the same directory or its subdirectory as the application startup class , so that the annotations can be scanned, which is the most trouble-free way. (Not tested)
  ② Or add @MapperScan or @ComponentScan annotations to the startup class , and manually specify the annotations under which packages the application class should scan, as shown below: 

@SpringBootApplication
 @ComponentScan(basePackages = {"com.xxx.xxx.dao"})

③Or add @Mapper annotation   on the interface .

@Mapper
 public  interface UserMapper { 
}

ps: The reason why the corresponding Bean was not found is because @SpringBootApplication did not scan it.

SpringBoot uses MyBatis error: Error invoking SqlProvider method (tk.mybatis.mapper.provider.base.BaseInsertProvider.dynamicSQL)

1. Error description

  Use SpringBoot to integrate the MyBatis framework, and use mapper-spring-boot-starter to automatically generate MyBatis mapper files, and use mybatis-generator-core to generate MyBatis mapping files.

  SpringBoot version: 2.0.0.RELEASE

  mybatis-spring-boot-starter version: 1.3.2

  mapper-spring-boot-starter version: 1.2.4

  mybatis-generator-core version: 1.3.6

2. Error message

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method (tk.mybatis.mapper.provider.base.BaseInsertProvider.dynamicSQL). Cause: java.lang.InstantiationException: tk .mybatis.mapper.provider.base.BaseInsertProvider
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java: 77 )
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java: 446 )
    at com.sun.proxy.$Proxy79.insert(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java: 278 )
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java: 58 )
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java: 59 )
    at com.sun.proxy.$Proxy80.insert(Unknown Source)
    at com.imooc.sevice.impl.SysUserServiceImpl.saveUser(SysUserServiceImpl.java: 19 )
    at com.imooc.controller.SysUserController.saveUser(SysUserController.java: 35 )
    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.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java: 209 )
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java: 136 )
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java: 102 )
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java: 870 )
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java: 776 )
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java: 87 )
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java: 991 )
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java: 925 )
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java: 978 )
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java: 881 )
    at javax.servlet.http.HttpServlet.service(HttpServlet.java: 661 )
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java: 855 )
    at javax.servlet.http.HttpServlet.service(HttpServlet.java: 742 )
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 231 )
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 166 )
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java: 52 )
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 193 )
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 166 )
    at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java: 123 )
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 193 )
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 166 )
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java: 99 )
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java: 107 )
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 193 )
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 166 )
    at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java: 109 )
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java: 107 )
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 193 )
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 166 )
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java: 81 )
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java: 107 )
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 193 )
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 166 )
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java: 200 )
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java: 107 )
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 193 )
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 166 )
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 199 )
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 96 )
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java: 496 )
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java: 140 )
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: 81 )
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java: 87 )
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 342 )
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java: 803 )
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java: 66 )
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java: 790 )
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java: 1459 )
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java: 49 )
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java: 1149 )
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java: 624 )
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java: 61 )
    at java.lang.Thread.run(Thread.java: 748 )
Caused by: org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method (tk.mybatis.mapper.provider.base.BaseInsertProvider.dynamicSQL). Cause: java.lang.InstantiationException: tk.mybatis.mapper.provider.base .BaseInsertProvider
    at org.apache.ibatis.builder.annotation.ProviderSqlSource.createSqlSource(ProviderSqlSource.java: 134 )
    at org.apache.ibatis.builder.annotation.ProviderSqlSource.getBoundSql(ProviderSqlSource.java: 102 )
    at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java: 292 )
    at org.apache.ibatis.executor.statement.BaseStatementHandler. <init>(BaseStatementHandler.java:64 )
    at org.apache.ibatis.executor.statement.PreparedStatementHandler. <init>(PreparedStatementHandler.java:40 )
    at org.apache.ibatis.executor.statement.RoutingStatementHandler. <init>(RoutingStatementHandler.java:46 )
    at org.apache.ibatis.session.Configuration.newStatementHandler(Configuration.java: 558 )
    at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java: 48 )
    at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java: 117 )
    at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java: 76 )
    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.apache.ibatis.plugin.Plugin.invoke(Plugin.java: 63 )
    at com.sun.proxy.$Proxy95.update(Unknown Source)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java: 198 )
    at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java: 185 )
    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.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java: 433 )
    ... 64 more
Caused by: java.lang.InstantiationException: tk.mybatis.mapper.provider.base.BaseInsertProvider
    at java.lang.Class.newInstance(Class.java: 427 )
    at org.apache.ibatis.builder.annotation.ProviderSqlSource.invokeProviderMethod(ProviderSqlSource.java: 165 )
    at org.apache.ibatis.builder.annotation.ProviderSqlSource.createSqlSource(ProviderSqlSource.java: 116 )
    ... 86 more
Caused by: java.lang.NoSuchMethodException: tk.mybatis.mapper.provider.base.BaseInsertProvider. <init> ()
    at java.lang.Class.getConstructor0(Class.java: 3082 )
    at java.lang.Class.newInstance(Class.java: 412 )
    ... 88 more

3. Problem

  On the startup class of SpringBoot, the wrong package was introduced when using @MapperScan annotation.

  The correct one should be: import tk.mybatis.spring.annotation.MapperScan;

  Wrongly introduced: import org.mybatis.spring.annotation.MapperScan;