Tag Archives: spring

[Solved] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test

There is a mave aggregation project. The following error is reported when packaging through the maven command:

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test

The packaging command is as follows: clean package

Solution 1:
Click Toggle ‘Skip Tests’ mode in the maven panel in idea tools, and package it again and it works fine.
Solution 2:
Specify skipTests as true in the pom file to skip unit tests

	<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
        </plugins>
    </build>

Solution 3:
Execute the command at the Terminal

mvn install -DskipTests

Solution 4:
Execute the command at the Terminal

mvn install -Dmaven.test.skip=true

Solution 5:
In the springboot project, spring-boot-maven-plugin plugin has been integrated with the maven-surefire-plugin plugin, will automatically run junit test, you need to add the following configuration in the pom

<properties>
 	<!-- skip the test -->
    <skipTests>true</skipTests>
</properties>

Among them, -Dmaven.test.skip=true and -DskipTests have the following roles

  • -DskipTests: does not execute the test cases, but compiles the test case classes to generate the corresponding class files under target/test-classes.
  • -Dmaven.test.skip=true: does not execute the test cases and does not compile the test case classes.

Zuul Gateway Failed to Import Dependency [How to Solve]

Zuul gateway import dependency error

Error message: Error is reported in the startup dependency annotation and the dependency cannot be found

Analyze the reason: check whether pom dependency is introduced

Reason for error reporting: No dependency is introduced. Let’s try to introduce dependency (the code is as follows)

<dependency>
	<groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency>

The problem is solved after the dependency is introduced.

Spring Security Upgrade to Version 5.5.7, 5.6.4 or Above to Startup Error (Version incompatibility)

1. Background

Version comparison detection principle: check whether the current system version of spring-security-web is within the scope of the vulnerability version|version comparison detection results: – spring-security-web
Current installed version: 5.2.1.RELEASE
Need to upgrade to 5.5.7, 5.6.4 and above, because the pom can not find a direct reference to the location, so add the following dependencies to spring-security-web version forced to upgrade to 5.5.7

    <!-- Fix spring-security-web version vulnerability -->
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>5.5.7</version>
    </dependency>

An error is reported during startup. The error contents are as follows:

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.security.web.util.matcher.OrRequestMatcher.<init>(OrRequestMatcher.java:43)

The following method did not exist:

    org.springframework.util.Assert.noNullElements(Ljava/util/Collection;Ljava/lang/String;)V

The method's class, org.springframework.util.Assert, is available from the following locations:

    jar:file:/C:/Users/sutpc/.m2/repository/org/springframework/spring-core/5.1.18.RELEASE/spring-core-5.1.18.RELEASE.jar!/org/springframework/util/Assert.class

It was loaded from the following location:

    file:/C:/Users/sutpc/.m2/repository/org/springframework/spring-core/5.1.18.RELEASE/spring-core-5.1.18.RELEASE.jar

2. Analysis of the cause

Theoretically, spring-security-web is introduced in a jar, and the version of spring-security-web is changed separately, resulting in the incompatibility of the supporting code in this jar.

3. Solutions

Upgrade spring-boot-dependencies from 2.1.17.RELEASE to 2.2.2.RELEASE
            <! -- SpringBoot dependency configuration-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
<!--                <version>2.1.17.RELEASE</version>-->
                <version>2.2.2.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
Just use the 5.5.7 mandatory override of spring-security-web at the end of the pom
        <! -- Fix spring-security-web version vulnerability -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>5.5.7</version>
        </dependency>

4. solution ideas:
Because a separate change in the version of spring-security-web, resulting in this jar incompatible with the code caused by the problem, so the primary problem need to find spring-security-web by which jar introduced

4.1 Query the Maven project to find out which dependency the jar package is introduced by
Use mvn dependency:tree directly to see the complete dependency tree of the project.

    Command format
mvn dependency:tree -Dverbose -Dincludes=Content to be queried(groupId:artifactId)

-dependency:tree:Indicates a tree-like display.
-Dverbose:Indicates that all references can be displayed, including those that are ignored because of multiple reference duplicates.
-Dincludes: you can formulate query conditions

The groupId and artifactId of spring-security-web are:

groupId: org.springframework.security
artifactId: spring-security-web
so the command is as below:
mvn dependency:tree -Dverbose -Dincludes=org.springframework.security:spring-security-web

4.2 The dependency hierarchy after execution in the idea’s Teminal is shown in the figure below

4.3spring-security-web is introduced by spring-boot-starter-security
spring-security-web is introduced by spring-boot-starter-security, version 2.1.17.RELEASE, search spring-boot-starter-security and find that it uses spring-boot- RELEASE.pom version

4.3spring-boot-starter-security version is the version that inherits spring-boot-dependencies
In the global search spring-boot-dependencies version, found really is 2.1.17.RELEASE, so far, all the dependency levels are found, that began to guess, is not spring-boot-dependencies version is too low, spring-security-web version is too high incompatible, spring-security-web version can not be adjusted down, can only upgrade the version of spring-boot-dependencies, in the maven repository to find the version of spring-boot-dependencies, level by level test, found 2.2.2. The problem is solved.

[Solved] mybatis plus Error: Invalid bound statement (not found)

Some students encountered the problem of “Invalid bound statement (not found)” when building the mybatis plus project, it is essentially that the mapper interface and the mapper.xml is not mapped.

In this case, the common problems are as follows:

1, mapper.xml inside the namespace and the actual mapper class path is not consistent.
There is a quick way to detect this is to hold down the ctrl key, and then click the package name inside the namespace, if you can jump to the corresponding class, it means there is no problem, if you use the IDEA is the same way, IDEA package name can be segmented, as long as you can point in are no problem.

2, mapper interface function name and mapper.xml inside the label id is not consistent.
This problem is also very common, the best way is to paste and copy it, so as to ensure that there is no problem.

The first point and 2 points are about spelling errors.

3, the build did not go in, please see if these exist below the target folder, no please rebuild

4. Check whether package scanning is added. I added it to the spring boot startup class.

5. Check whether the configuration file is written incorrectly or not

#Is this place wrongly written?

mapper-locations: classpath:mybatis/mapper/**/*.xml

Mybatis-plus can be configured as an array:

mybatis-plus:
  mapper-locations:
    - classpath:mybatis/mapper/**/*.xml

Or

mybatis-plus:
  mapper-locations: classpath:mybatis/**/*Mapper.xml

Note that the key is mapper-locations and not mapper-locations:

Other configurations:


mybatis-plus:
  global-config:
    #primary-key-type 0: "Database ID self-incrementing", 1: "User input ID", 2: "Global unique ID (numeric unique ID)", 3: "Global unique ID UUID";
    id-type: 0
    #field-strategy 0: "Ignore judgment",1: "Non-NULL judgment"),2: "Non-Null judgment"
    field-strategy: 0
    #hump-underline conversion
    db-column-underline: true
    #refresh-mapper debugging artifact
    refresh-mapper: true
    #database capital-underline conversion
    #capital-mode: true 
    #sequence interface implementation class configuration    
	#key-generator: com.baomidou.springboot.xxx 
    #logic-delete-configuration (the following 3 configurations)
    #logic-delete-value: 0 # logical-delete value (default is 1)    
	#logic-not-delete-value: 1 # logical-not-delete value (default is 0)    
	# Custom fill policy interface implementation    
	#meta-object-handler: com.zhengqing.config.   
	#custom SQL injector   
	#sql-injector: com.baomidou.springboot.xxx configuration:      
    #SQL parsing cache, multi-tenant @SqlParser annotation takes effect when enabled
    #sql-parser-cache: true
  configuration:
    # hump conversion Similar mapping from database column names to Java property hump naming  
    map-underscore-to-camel-case: true
    # Whether to enable caching
    cache-enable: false
    # If the query contains a column with a null value, MyBatis will not map this field when mapping        
	#call-setters-on-nulls: true  
    # 打印sql
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

[Solved] EurekaServerApplication: Failed to retrieve application JMX service URL

EurekaServerApplication: Failed to retrieve application JMX service URL

Import a spring cloud project, and report the following error at startup:

EurekaServerApplication: Failed to retrieve application JMX service URL

insert picture description here

Error message

EureKaServerApplication:Failed to retrieve application JMX service URL

Solution:

Select the project ——>Then select the spring boot plugin, Find to the startup project, There is a spring boot option,
Cancel the Enable JMX agent option

insert picture description here

Click on Edit configuration templates >>spring boot >>modify options

insert picture description here

Click Disable JMX agent

insert picture description here

Click Apply >> OK
agent
insert here Image description

Click Apply >> OK
to rerun main entry

[Solved] ERROR o.s.s.s.TaskUtils$LoggingErrorHandler – Unexpected error occurred in scheduled task.

When this error occurs, we should look at the following error message. Only this error is meaningless. What I see here is a java.lang.NoSuchMethodError. This error tells us that the method does not exist. The reason for this error may be that the package has not been introduced, or it may be a version conflict, resulting in the method not being found.

But the errors you may make are not like this, so you can search like this:

java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;I)

Today, adding Swagger2 to the project resulted in an error during project operation:

2019-05-06 15:05:02.348 [pool-2-thread-1] ERROR o.s.s.s.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task.
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;I)V
	at org.openqa.selenium.remote.service.DriverService$Builder.usingPort(DriverService.java:278)
	at org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:212)
	at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:172)
	at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:146)
	at com.unionpay.aiexamine.services.AutoLoginService.getCookie(AutoLoginService.java:23)
	at com.unionpay.aiexamine.config.SaticScheduleTask.getCookie(SaticScheduleTask.java:27)
	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.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
	at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
	at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Solution: add the following codes in the project maven

<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
    <version>2.2.2</version>
    <exclusions>
        <exclusion>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </exclusion>
    </exclusions>
</dependency>

[Solved] qrcode-error: Exception in thread “main” java.lang.NoClassDefFoundError…

qrcode-error

Project scenario:

QR code generation

Problem description

Hint: Here we describe the problems encountered in the project:

For example, in the process of data transmission, data is lost from time to time, and some data is occasionally lost
The code of data received in the APP:

QrConfig qrConfig = QrConfig.create(); 
qrConfig.setWidth(500);
qrConfig.setHeight(500); 
String encode = Base64.encode(QrCodeUtil.generatePng("loginQRVerify:",qrConfig));


Cause analysis:

Prompt: jar package is missing


Solution:

<!-- https://mvnrepository.com/artifact/com.google.zxing/core -->
<dependency>
    <groupId>com.google.zxing</groupId>
    <artifactId>core</artifactId>
    <version>3.3.0</version>
</dependency>

[Solved] Arthas failed to bind telnet or http port! Telnet port: 3658, http port: 8563;Error creating bean

[Arthas failed to bind telnet or http port! Telnet port: 3658, http port: 8563; Error creating bean with name ‘documentationPluginsBootstrapper’ defined in URL; Error creating bean with name ‘webMvcRequestHandlerProvider’ defined in URL]

Cause analysis:

Error will be reported when two identical items are started: port conflict!!! (Even if the ports of the two projects are different in the yml file, an error will be reported.)
Arthas failed to bind telnet or http port! Telnet port: 3658, http port: 8563


Solution:

Comment out the arthas in two projects.

<!--        Monitor system performance: do not allow two identical projects to run; comment to enable two  -->
<!--        <dependency>-->
<!--            <groupId>com.taobao.arthas</groupId>-->
<!--            <artifactId>arthas-spring-boot-starter</artifactId>-->
<!--            <version>3.6.0</version>-->
<!--        </dependency>-->

Arthas is an online monitoring and diagnosis product. It can view the status information of application load, memory, gc, and threads in real time from a global perspective, and diagnose business problems without modifying the application code, including checking the access parameters and exceptions of method calls, time-consuming monitoring method execution, class loading information, etc., greatly improving the efficiency of online problem troubleshooting.

Error 1

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined in URL 
[jar:file:/D:/JAVA1/scm-repository/io/springfox/springfox-spring-web/3.0.0/springfox-spring-web-3.0.0.jar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]: 
Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
 Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL 
 [jar:file:/D:/JAVA1/scm-repository/io/springfox/springfox-spring-webmvc/3.0.0/springfox-spring-webmvc-3.0.0.jar!/
 springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException:
  Error creating bean with name 'webEndpointServletHandlerMapping' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/servlet/WebMvcEndpointManagementContextConfiguration.class]: 
  Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate 
  [org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping]: Factory method 'webEndpointServletHandlerMapping' threw exception;
   nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'arthasEndPoint': Unsatisfied dependency expressed through field 'arthasAgent'; nested exception is 
   org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'arthasAgent' defined in class path resource 
   [com/alibaba/arthas/spring/ArthasConfiguration.class]: Bean instantiation via factory method failed; nested exception is 
   org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.taobao.arthas.agent.attach.ArthasAgent]: Factory method 'arthasAgent' threw exception; nested exception is java.lang.IllegalStateException: 
   java.lang.reflect.InvocationTargetException


Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL 
[jar:file:/D:/JAVA1/scm-repository/io/springfox/springfox-spring-webmvc/3.0.0/springfox-spring-webmvc-
3.0.0.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'webEndpointServletHandlerMapping' defined in class path resource 
[org/springframework/boot/actuate/autoconfigure/endpoint/web/servlet/WebMvcEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping]: Factory method 'webEndpointServletHandlerMapping' threw exception;
 nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'arthasEndPoint': Unsatisfied dependency expressed through field 'arthasAgent'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'arthasAgent' defined in class path resource 
[com/alibaba/arthas/spring/ArthasConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: 
Failed to instantiate [com.taobao.arthas.agent.attach.ArthasAgent]: Factory method 'arthasAgent' threw exception; nested exception is java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping]: Factory method 'webEndpointServletHandlerMapping' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'arthasEndPoint': Unsatisfied dependency expressed through field 'arthasAgent'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'arthasAgent' defined in class path resource [com/alibaba/arthas/spring/ArthasConfiguration.class]: Bean instantiation via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[com.taobao.arthas.agent.attach.ArthasAgent]: Factory method 'arthasAgent' threw exception; nested exception is java.lang.IllegalStateException: 
java.lang.reflect.InvocationTargetException

	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
	
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
	... 57 common frames omitted
	
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'arthasEndPoint': Unsatisfied dependency expressed through field 'arthasAgent'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'arthasAgent' defined in class path resource 
[com/alibaba/arthas/spring/ArthasConfiguration.class]: Bean instantiation via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.taobao.arthas.agent.attach.ArthasAgent]: 
Factory method 'arthasAgent' threw exception; nested exception is java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'arthasAgent' defined in class path resource 
[com/alibaba/arthas/spring/ArthasConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.taobao.arthas.agent.attach.ArthasAgent]: Factory method 'arthasAgent' threw exception; nested exception is java.lang.IllegalStateException: 
java.lang.reflect.InvocationTargetException

Caused by: java.lang.IllegalStateException: Arthas failed to bind telnet or http port! Telnet port: 3658, http port: 8563

	at com.taobao.arthas.core.server.ArthasBootstrap.bind(ArthasBootstrap.java:448)
	at com.taobao.arthas.core.server.ArthasBootstrap.<init>
	(ArthasBootstrap.java:156)
	at com.taobao.arthas.core.server.ArthasBootstrap.getInstance(ArthasBootstrap.java:581)
	... 112 common frames omitted
Disconnected from the target VM, address: '127.0.0.1:58928', transport: 'socket'


Error creating bean with name 'arthasEndPoint': Unsatisfied dependency expressed through field 'arthasAgent'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'arthasAgent' defined in class path resource 
[com/alibaba/arthas/spring/ArthasConfiguration.class]: Bean instantiation via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.taobao.arthas.agent.attach.ArthasAgent]: 
Factory method 'arthasAgent' threw exception; nested exception is java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException

Error 2

2022-09-08 13:33:15 [main] INFO  c.b.d.d.DynamicRoutingDataSource
 - dynamic-datasource - add a datasource named [master] success
2022-09-08 13:33:15 [main] INFO  c.b.d.d.DynamicRoutingDataSource
 - dynamic-datasource initial loaded [2] datasource,primary datasource named [master]
Registered plugin: 'com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor@136cad3e'
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/PrCompanyMapper.xml]'
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysConfigMapper.xml]'
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysDeptMapper.xml]'
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysDeptRankMapper.xml]'
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysDictDataMapper.xml]'
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysDictTypeMapper.xml]'
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysLogininforMapper.xml]'
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysMenuMapper.xml]'
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysNoticeMapper.xml]'
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysOperLogMapper.xml]'
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysPostMapper.xml]'
Can not find table primary key in Class: "com.skeqi.manage.domain.SysRoleDept".
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysRoleDeptMapper.xml]'
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysRoleMapper.xml]'
Can not find table primary key in Class: "com.skeqi.manage.domain.SysRoleMenu".
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysRoleMenuMapper.xml]'
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysUserMapper.xml]'
Can not find table primary key in Class: "com.skeqi.manage.domain.SysUserPost".
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysUserPostMapper.xml]'
Can not find table primary key in Class: "com.skeqi.manage.domain.SysUserRole".
Parsed mapper file: 'URL [jar:file:/D:/JAVA1/scm-repository/com/skeqi/manage-service/1.0.1/manage-service-1.0.1.jar!/mybatisplus/system/SysUserRoleMapper.xml]'
 _ _   |_  _ _|_. ___ _ |    _ 
| | |\/|_)(_| | |_\  |_)||_|_\ 
    /              |         
                        3.4.3 
Disconnected from the target VM, address: '127.0.0.1:50626', transport: 'socket'

Process finished with exit code -1073740940 (0xC0000374)

[Solved] error running ‘xx‘ Command line is too long shorten command line for xx or also for Spring Boot defa

Problem description:

This problem occurred when the idea started the microservice project, causing the project to fail to start

error running ‘xx’ Command line is too long shorten command line for xx or also for Spring Boot default configuration.

Solution:

My idea uses the 2019 version.

Step 1: Open edit Configurations

Step 2:

Modify shorten command line to JAR manifest.

Restart, complete.

How to Solve Mockito mockedStatic NotAMockException Error

Error Message:

org.mockito.exceptions.misusing.NotAMockException: Argument passed to Mockito.mockingDetails() should be a mock, but is an instance of class java.lang.Class!
    at org.mockito.internal.runners.StrictRunner.run(StrictRunner.java:52)
    at org.mockito.junit.MockitoJUnitRunner.run(MockitoJUnitRunner.java:163)
    at org.mockito.runners.MockitoJUnitRunner.run(MockitoJUnitRunner.java:53)

 

Solution:
Delete @RunWith(MockitoJUnitRunner.class)
and add

    @Before
    public void before(){
        log.info("start--------{}",this.getClass().getName());
         MockitoAnnotations.openMocks(this);
    }

How to Solve EasyExcel3.0.5 Version Error

Because the SpringBoot version is incompatible with the cglib version of EasyExcel;

Phenomenon:

# error 1
Caused by: java.lang.IllegalArgumentException
 at org.objectweb.asm.ClassVisitor.<init>(Unknown Source)
 # Error 2
com.alibaba.excel.exception.ExcelAnalysisException: java.lang.ExceptionInInitializerError
 at com.alibaba.excel.analysis.ExcelAnalyserImpl.analysis(ExcelAnalyserImpl.java:134)

Because the cglib package on which asm depends is inconsistent with the springboot version, an error is reported

Solution:

For example, easyexcel version is 3.0.5, and cglib needs to be configured to 3.3.0

<dependency>
	<groupId>cglib</groupId>
	<artifactId>cglib</artifactId>
	<version>3.3.0</version>
</dependency>

How to Solve zipkin Install Error in Windows

Error:

org.springframework.beans.factory.BeanCreationException: Error creating com.linecorp.armeria.spring.ArmeriaAutoConfiguration via factory method: Bean named ' armeriaServer ' defined in bean instantiation failed; nested exception is org.springframework.beans. BeanInstantiationException: Unable to instantiate com.linecorp.armeria.server.Server: Factory method 'armeriaServer' threw exception; nested exception is java.util.concurrent.CompletionException: java.lang.IllegalStateException: Armeria server failed to start

java.lang.IllegalStateException: Armeria server failed to start

 

Solution:

Close CMD window first

Open Task Manager

Find the detail-information and kill all java.exe. then restart cmd to upzip to install.

Problem-solving