Tag Archives: back-end

Error creating bean with name ‘captchaController‘: Unsatisfied dependency expressed through field ‘c

Error creating bean with name 'captchaController': Unsatisfied dependency expressed through field 'configService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysConfigServiceImpl': Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379
Check start Redis or not

ERROR: While executing gem … (Gem::FilePermissionError)

Environment: MAC.

When learning rails, follow the official documents. Errors may be reported at this step

 gem install rails

ERROR: While executing gem … (Gem::FilePermissionError)

Even if sudo is used to force the installation, an error will be reported in the next step.  

rails new blog

`auth_ data=’: couldn’t set additional authenticated data

resolvent:

Installing Ruby under MacOS – 🎄 Adomikao Yu Yongjian

The reason for the error is that the MAC installs ruby in the/usr/bin directory by default. This directory has strict permissions, resulting in code execution failure. The solution is to use RVM to install ruby in the user directory without affecting the system environment.

[Solved] Openfegn Remote Call Error: java.lang.NullPointerException: null

Problem Description:

tip: version dependency is the worst problem


Solution:

Introduce spring cloud loadbalancer dependency

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-loadbalancer</artifactId>
    <version>3.0.3</version>
</dependency>

Due to the version problem, some must exclude ribbon dependencies from Nacos, otherwise the loadbalancer is invalid

<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
    <!--Client-side load balancing without Ribbon-->
    <exclusions>
        <exclusion>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
        </exclusion>
    </exclusions>
</dependency>

How to Solve shiro Set sessionIdUrlRewritingEnabled Error (jessionid Removed)

Project scenario:

When using Shiro for authority authentication, the login address always carries the jeonid automatically for the first access. Now it needs to be removed and cannot be displayed.

Problem Description:

First, I searched Baidu and found that most solutions are to set SessionManager when defaultwebsecuritymanager is injected. This method also needs Shiro 1.3.2 or above. Coincidentally, my 1.3.0 is definitely not good. Go to POM directly to change the version number
annotation method:

    @Bean
    public DefaultWebSessionManager sessionManager(){
        DefaultWebSessionManager sessionManager = new DefaultWebSessionManager();
        sessionManager.setSessionIdUrlRewritingEnabled(false);
        return sessionManager;
    }

    @Bean
    public DefaultWebSecurityManager securityManager(){
        DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
        securityManager.setSessionManager(sessionManager());
        return securityManager;
    }

XML mode:

		<bean id="sessionManager" class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
		<property name="sessionIdUrlRewritingEnabled" value="false"/>
	</bean>

	<!-- Shiro Security Manager -->
	<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
		<property name="sessionManager" ref="sessionManager"/>
	</bean>

Remember to add package scanning in XML mode.My:

<context:component-scan base-package="config" />

Then run the project and report the same error as before. Anyway, there is no getter method.

Cause analysis:

During debugging, it is found that there are three versions of Shiro in the project, and two are from other modules, so it doesn’t matter. However, during debugging, it is found that the number of lines is not matched. After downloading the source code, it is found that this.sessionidurlrewritingenabled = true; There are no breakpoints in this line, and then the rebuild project, MVN clean install, repackaging and restarting idea are all used, and then the breakpoints can be interrupted. However, after debugging starts, the breakpoint icon turns into a circle slash, which is not the Shiro version of my current project at all
finally, you can only guess whether there are problems with multiple versions at the same time.

Solution:

It is found that one of the three versions is very old 1.2.4, but there is no place to import the whole project. Then, according to the warehouse, it is still imported in the way of Shiro all, so the name is temporarily modified. After running the project, it can run as expected

Tinyint error: java.lang.NullPointerException… [How to Solve]

Tinyint error reporting record
I wrote the wrong set before, which is easy to use when it is written as setid, and then I changed it to setType to report an error, and then I transformed it down to byte. After the change, it will be null pointer. Below are the error reporting information and error reporting line position




Finally, change the position as follows. Change the type from integer to string to solve the problem
the specific principle is not clear. For the time being, record it first. A great God who knows the principle can leave a message. Thank you

Node.js Error: “Error: EBUSY: resource busy or locked, stat“

abnormal

Error: EBUSY: resource busy or locked, stat 'C:\swapfile.sys'
    at Object.statSync (node:fs:1536:3)
    at D:\NodeJs\node-demo\demo\world.js:7:24
    at FSReqCallback.oncomplete (node:fs:188:23) {
  errno: -4082,
  syscall: 'stat',
  code: 'EBUSY',
  path: 'C:\\swapfile.sys'
}

Node.js v17.1.0

error code

var fs = require('fs');

var rootPath = 'C:\\';
fs.readdir(rootPath, function (err, files) {
    for (var i = 0; i < files.length; i++) {
        var p = rootPath + files[i];
        var stats = fs.statSync(p);
        console.log(rootPath + 'Is it a directory:' + stats.isDirectory())
    }
});

Reason

Prompt error: EBUSY: resource busy or locked, stat indicates that the resource file is busy or locked, that is, the C:\swapfile.Sys file. But there is no such file in the C disk directory, even in the hidden file. But it can be found by opening everything software
is a system file.

Solution:

I don’t know how to solve it. The online solution seems to be invalid, so I can only block the file.

Correct code

var fs = require('fs');

var rootPath = 'C:\\';
fs.readdir(rootPath, function (err, files) {
    for (var i = 0; i < files.length; i++) {
        var p = rootPath + files[i];
        // Skip when encountering swapfile.sys file or System Volume Information directory
        if (p.endsWith('swapfile.sys') || p.endsWith('System Volume Information')) {
            continue;
        }
        var stats = fs.statSync(p);
        console.log(rootPath + 'Is it a directory:' + stats.isDirectory())
    }
});

ERROR c.z.hikari.pool.HikariPool:594 restartedMain HikariPool-1 -Exception

  [problem description]: when starting the springboot project, the following stack error is reported

32.014 ERROR c.z.hikari.pool.HikariPool    :594  restartedMain                    HikariPool-1 - Exception during pool initialization.
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
        at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:833)
        at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:453)
        at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
        at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198)
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476)
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
        at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
        at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:158)
        at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:116)
        at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:330)
        at org.springframework.boot.jdbc.EmbeddedDatabaseConnection.isEmbedded(EmbeddedDatabaseConnection.java:184)
        at org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer.isEmbeddedDatabase(DataSourceScriptDatabaseInitializer.java:64)
        at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.isEnabled(AbstractScriptDatabaseInitializer.java:87)
        at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.initializeDatabase(AbstractScriptDatabaseInitializer.java:74)
        at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.afterPropertiesSet(AbstractScriptDatabaseInitializer.java:65)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1845)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
        at com.abc.wiki.WikiApplication.main(WikiApplication.java:19)
        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.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
        at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
        at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
        at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)
        at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89)
        at com.mysql.cj.NativeSession.connect(NativeSession.java:144)
        at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:953)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:823)
        ... 42 common frames omitted
Caused by: java.net.ConnectException: Connection timed out: connect
        at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155)
        at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63)
        ... 45 common frames omitted

[cause of problem]: when debugging the project locally today, the WiFi connected to the computer changed, resulting in the change of IP, which finally led to this problem.

[solution]: modify the configuration of the project connection database to a new IP address.

[Solved] iperf Analyze Error: unable to create a new stream: Invalid argument

The root cause of the error reported in the title is that the iperf command code customized by the company is relatively old, so the open source code still needs to be updated in time!

Device: Android p

Problem: when the iperf server is opened on the PC and the iperf client is opened on the Android device, the throughput cannot be tested normally, as shown in the following figure:

The Android device reports an error “unable to create a new stream: invalid argument”. The PC can see that there is a connection at the beginning, and then the connection is closed due to the client.

Solution:

First look at the error report, “Unable to create a new stream” corresponds to “case IECREATESTREAM”. It can be determined that this error occurs in a function of iperf_api, and it is found in the iperf_new_stream() function. It is simple here. Exclude the first few A malloc, the first function mkstemp(), this function is interesting, the actual problem is also here, first introduce this function.

The mkstep function creates a file with a unique file name in the system and opens it. Only the current user can access the temporary file and perform read and write operations. The mkstamp function has only one parameter template, which is a non empty string ending in “XXXXXX”. The mkstemp function will replace “XXXXXX” with a randomly generated string to ensure the uniqueness of the file name.

You can see the common error codes eexist and einval through the man Manual:

1>   EEXIST:   Unable to create a unique temporary file, the content of parameter template is undefined;

2>   Einval: for mkstamp(), the last six characters of template are not XXXXXX;

It is worth mentioning that in glibc 2.0.6 and earlier glibc libraries, the access permission of this file is 0666, that is, all users in UNIX system can access it, which will have a big problem. Therefore, the access permission of this file in glibc libraries after glibc 2.0.7 is adjusted to 0600.

The temporary file created by the mkstemp function cannot be deleted automatically, so after executing the mkstemp function, you need to call the unlink function. The unlink function deletes the directory entry of the file, but the temporary file can also be accessed through the file descriptor until the last open process closes the file, or the temporary file is automatically and completely deleted after the program exits.

The original code snippet of the error is as follows

struct iperf_stream *iperf_new_stream(struct iperf_test *test, int s)
{
    int i;
    struct iperf_stream *sp;
    //The problem is here, the template parameter format is incorrect
    char template[] = "/data/data/iperf3.0.11";
    ......
    /* Create and randomize the buffer */
    sp->buffer_fd = mkstemp(template);
    if (sp->buffer_fd == -1) {
        i_errno = IECREATESTREAM;
        free(sp->result);
        free(sp);
        return NULL;
    }
    if (unlink(template) < 0) {
        i_errno = IECREATESTREAM;
        free(sp->result);
        free(sp);
        return NULL;
    }
    if (ftruncate(sp->buffer_fd, test->settings->blksize) < 0) {
        i_errno = IECREATESTREAM;
        free(sp->result);
        free(sp);
        return NULL;
    }
    ......

It’s clear from here that the problem with the template parameter causes an error in mkstamp() and returns einval. The corresponding Android device executes the iperf command and reports an error of ‘invalid argument’. I was going to make a simple change. After thinking about iperf, everyone is using it. There should be no big problem. I went to GitHub community and found that predecessors have paved the way. I changed it with reference to the submission in the community.

diff --git a/system/core/swiperf/iperf.h b/system/core/swiperf/iperf.h
index f4d394b..2bc0b73 100644
--- a/system/core/swiperf/iperf.h
+++ b/system/core/swiperf/iperf.h
@@ -178,6 +178,7 @@ struct iperf_test
     struct protocol *protocol;
     signed char state;
     char     *server_hostname;                  /* -c option */
     //The latest open source code iperf_test structure itself has tmp_template
+    char     *tmp_template;
     char     *bind_address;                     /* -B option */
     int       server_port;
     int       omit;                             /* duration of omit period (-O flag) */
@@ -252,6 +253,9 @@ struct iperf_test
     char *server_output_text;
     cJSON *json_server_output;

+    /* Store User Defined Path and use it for creating temporary streams */
+    char *user_stream_path;
+
     /* Server output (use on server side only) */
     TAILQ_HEAD(iperf_textlisthead, iperf_textline) server_output_list;

diff --git a/system/core/swiperf/iperf_api.c b/system/core/swiperf/iperf_api.c
index 13269d5..27a92ac 100644
--- a/system/core/swiperf/iperf_api.c
+++ b/system/core/swiperf/iperf_api.c
@@ -27,6 +27,9 @@
 #define _GNU_SOURCE
 #define __USE_GNU

+/* Suppress Warning generated by GCC __attribute__ for write */
+#pragma GCC diagnostic ignored "-Wunused-result"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -235,8 +238,21 @@ iperf_get_test_one_off(struct iperf_test *ipt)
     return ipt->one_off;
 }

-/************** Setter routines for some fields inside iperf_test *************/
+/* Getter routine for user-defined stream-path */
+char *
+iperf_get_stream_path(struct iperf_test *ipt)
+{
+    return ipt->user_stream_path;
+}

+/* Setter routine for user-defined stream-path */
+void
+iperf_set_stream_path(struct iperf_test *ipt, char *_stram_path)
+{
+    ipt->user_stream_path = strdup(_stram_path);
+}
+
+/************** Setter routines for some fields inside iperf_test *************/
 void
 iperf_set_verbose(struct iperf_test *ipt, int verbose)
 {
@@ -596,6 +612,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
        {"get-server-output", no_argument, NULL, OPT_GET_SERVER_OUTPUT},
         {"debug", no_argument, NULL, 'd'},
         {"help", no_argument, NULL, 'h'},
         //Add the analysis of the corresponding parameters
+        {"stream-path", required_argument, NULL, OPT_STREAM_PATH},
         {NULL, 0, NULL, 0}
     };
     int flag;
@@ -608,6 +625,15 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
     server_flag = client_flag = rate_flag = duration_flag = 0;
     while ((flag = getopt_long(argc, argv, "p:f:i:D1VJvsc:ub:t:n:k:l:P:Rw:B:M:N46S:L:ZO:F:A:T:C:dh", longopts, NULL)) != -1) {
         switch (flag) {
+            /*
+             * Set Stream Path to user-defined path
+             * Reason: To work on Android as /tmp is not available on Android
+             * also access to a static /data/local/tmp/ is also restricted for Applications
+             * Only native application path is accessable with complete permissions
+             */
+            case OPT_STREAM_PATH:
+                iperf_set_stream_path(test, optarg);
+                break;
             case 'p':
                 test->server_port = atoi(optarg);
                 break;
@@ -2367,7 +2393,27 @@ iperf_new_stream(struct iperf_test *test, int s)
 {
     int i;
     struct iperf_stream *sp;
-    char template[] = "/data/data/iperf3.0.11";
+    char template[1024];
+    if (test->tmp_template) {
+        snprintf(template, sizeof(template)/sizeof(char), "%s", test->tmp_template);
+    } else {
+        //find the system temporary dir *unix, windows, cygwin support
+        char* tempdir = getenv("TMPDIR");
+        if (tempdir == 0) {
+            tempdir = getenv("TEMP");
+        }
+        if (tempdir == 0) {
+            tempdir = getenv("TMP");
+        }
+        /* Use User Specific Path if available */
+        if (test->user_stream_path != NULL) { //There is a pass to go here
+            tempdir = iperf_get_stream_path(test);
+        }
+        if (tempdir == 0) { // Android devices without parameters, create temporary files under /tmp by default
+            tempdir = "/tmp";
+        }
+        snprintf(template, sizeof(template)/sizeof(char), "%s/iperf3.XXXXXX", tempdir);
+    }

     h_errno = 0;

diff --git a/system/core/swiperf/iperf_api.h b/system/core/swiperf/iperf_api.h
index c019a31..e19492b 100644
--- a/system/core/swiperf/iperf_api.h
+++ b/system/core/swiperf/iperf_api.h
@@ -44,6 +44,8 @@ struct iperf_stream;
 #define OPT_SCTP 1
 #define OPT_LOGFILE 2
 #define OPT_GET_SERVER_OUTPUT 3
+/* Stream Path Edit for Android Compatibility */
+#define OPT_STREAM_PATH 4

 /* states */
 #define TEST_START 1
@@ -87,6 +89,10 @@ int  iperf_get_test_zerocopy( struct iperf_test* ipt );
 int    iperf_get_test_get_server_output( struct iperf_test* ipt );
 char*  iperf_get_test_bind_address ( struct iperf_test* ipt );
 int    iperf_get_test_one_off( struct iperf_test* ipt );
+/* Getter routine for user-defined stream-path */
+char* iperf_get_stream_path( struct iperf_test *ipt );
+/* Setter routine for user-defined stream-path */
+void iperf_set_stream_path( struct iperf_test *ipt, char *_stram_path );

 /* Setter routines for some fields inside iperf_test. */
 void   iperf_set_verbose( struct iperf_test* ipt, int verbose );
diff --git a/system/core/swiperf/iperf_locale.c b/system/core/swiperf/iperf_locale.c
index 30e6290..9fe7ba6 100644
--- a/system/core/swiperf/iperf_locale.c
+++ b/system/core/swiperf/iperf_locale.c
@@ -141,6 +141,7 @@ const char usage_longstr[] = "Usage: iperf [-s|-c host] [options]\n"
                            "  -O, --omit N              omit the first n seconds\n"
                            "  -T, --title str           prefix every output line with this string\n"
                            "  --get-server-output       get results from server\n"
                            //New --stream-path passing parameter, support custom write path
+                           "  --stream-path             use user-defied path to create temporary stream\n"

 #ifdef NOT_YET_SUPPORTED /* still working on these */
 #endif

[Solved] Mybatis Error: Establishing SSL connection without server‘s identity verification is not recommended.

Mybatis Error: Establishing SSL connection without server‘s identity verification is not recommended.

 

Solution:

(1) You need to explicitly disable SSL by setting usessl = false, or set usessl = true and provide a truststore for server certificate validation
(2) at this time, we only need to set usessl = false on the URL connecting to the database.

[Solved] Mybatis Error: Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.


Complete error reporting:

org.apache.ibatis.exceptions.PersistenceException: 
Error building SqlSession.
Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 58; columnNumber: 17; 元素类型为 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,reflectorFactory?,plugins?,environments?,databaseIdProvider?,mappers?)"。

Solution:

When the above error occurs, it is obvious that the exception occurs when parsing the XML configuration file,
from org.xml.sax.saxparseexception; lineNumber: 30; columnNumber: 17; Content with element type “configuration” must match: (properties?, settings?, typealiases?, typehandlers?, objectfactory?, objectwrapperfactory?, plugins?, environments?, databaseidprovider?, mappers?) “。 It is obvious that the configuration files of mybatis are in order and the number is limited Indicates that there can be no but at most one, but in your own configuration:

Incrrect order:

Correct order: