Category Archives: Error

How to Solve Pandas Error: nested renamer is not supported python

Problem Description
After running df.groupby([‘id’])[‘click’].agg({‘click_std’: ‘std’}).reset_index(), I get nested renamer is not supported python error

Solution
In the new Pandas version, the dictionary approach of {‘click_std’:’std’} has been abandoned in favor of df.groupby([‘id ‘])[‘click’].agg(click_std=’std’).reset_index() and then run successfully.

Reference:

    https://stackoverflow.com/questions/60229375/solution-for-specificationerror-nested-renamer-is-not-supported-while-agg-alo
    https://pandas.pydata.org/pandas-docs/stable/whatsnew/v0.20.0.html#whatsnew-0200-api-breaking-deprecate-group-agg-dict
    https://pandas.pydata.org/pandas-docs/stable/whatsnew/v0.25.0.html

[Solved] Access to XMLHttpRequest at ‘http://127.0.0.1:5000/markdownlang/‘ from origin ‘null‘ has been bl

When AJAX is used, the above cross domain request error is reported (using Python flash to build the background)

Error code:

from flask import Flask,render_template
@app.route("/markdownlang/",methods=["post"])
def getMarkdownLang():
    return render_template('result.html')

Solution: add a response header on the server side to simply allow cross source.

from flask import Flask,render_template,make_response
@app.route("/markdownlang/",methods=["post"])
def getMarkdownLang():
    resp = make_response(render_template('result.html'))
    resp.headers['Access-Control-Allow-Origin'] = '*'   
    return resp

There are two other things that can go wrong:

    1. the requested path is not complete. Full path http://127.0.0.1:port number/file path. Cross source must have full path. The request mode has no corresponding response code on the server side. For example, the server should have a post response for a post request

How to Solve Error: Type mismatch: cannot convert from Object to Car

Problem Description:

A very simple spring project that uses static factory methods to configure bean instances. The directory structure of the project is as follows:

code show as below:

Car.java

 1 package com.tt.spring.beans.factory;
 2 
 3 public class Car {
 4 
 5     private String brand;
 6     private double price;
 7     
 8     public String getBrand() {
 9         return brand;
10     }
11     public void setBrand(String brand) {
12         this.brand = brand;
13     }
14     public double getPrice() {
15         return price;
16     }
17     public void setPrice(double price) {
18         this.price = price;
19     }
20     
21     public Car(){
22         System.out.println("Car's Constructor...");
23     }
24     
25     
26     
27     public Car(String brand, double price) {
28         super();
29         this.brand = brand;
30         this.price = price;
31     }
32     
33     @Override
34     public String toString() {
35         return "Car [brand=" + brand + ", price=" + price + "]";
36     }
37     
38     
39 }

StaticCarFactory.java

1  package com.tt.spring.beans.factory;
 2  
3  import java.util.HashMap;
 4  import java.util.Map;
 5  
6  /** 
7  * Static factory method: you can directly call a static method of a certain class Return Bean instance
 8   */ 
9  public  class StaticCarFactory {
 10  
11      
12      private  static Map<String,Car> cars = new HashMap<String, Car> ();
 13      
14      static {
 15          cars.put("Audi", new Car ("Audi",300000 ));
 16         cars.put("Ford", new Car("Ford",40000 ));
 17      }
 18      
19      // Static factory method 
20      public  static Car getCar(String name){
 21          return cars.get(name);
 22          
23      }
 24      
25 }

beans-factory.xml

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <beans xmlns="http://www.springframework.org/schema/beans"
 3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 4     xmlns:context="http://www.springframework.org/schema/context"
 5     xmlns:p="http://www.springframework.org/schema/p"
 6     xmlns:util="http://www.springframework.org/schema/util"
 7     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
 8         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
 9          http://www.springframework.org/schema/util http: //www.springframework.org/schema/util/spring-util-4.0.xsd" > 
10  
11      <!-- Configure beans through static methods. Note that instead of configuring static factory method instances, but configuring bean instances --> 
12      < bean id ="car1"  
13            class ="com.tt.spring.beans.factory.StaticCarFactory" 
14            factory-method ="getCar" > 
15            < constructor-arg value ="Audi" ></constructor-arg>
16     </bean>
17     
18     
19 </beans>

Main.java:

 1 package com.tt.spring.beans.factory;
 2 
 3 import org.springframework.context.ApplicationContext;
 4 import org.springframework.context.support.ClassPathXmlApplicationContext;
 5 
 6 public class Main {
 7 
 8     public static void main(String[] args){
 9         
10         ApplicationContext ctx = new ClassPathXmlApplicationContext("beans-factory.xml");
11         
12         Car car1 = (Car) ctx.getBean("car1");
13         System.out.println(car1);
14      }
 15 }

Run the Main.java program, the console error is as follows:

Exception in thread “main” java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from Object to Car

at com.tt.spring.beans.factory.Main.main(Main.java:12)

 

Cause Analysis:

First, you need to install jre 1.5.0 and above.

Second,
set your installed jre in eclipse’s’Window”Preference”Java’ and’Install JREs’.

Third, in eclipse’s’Window”Preference ” Java ‘in,
‘ Compiler ‘was set up’ Compiler compliance level ‘of 5.0 or more
(the key is the third step, the compatibility level)

 

problem solved:

Since the jdk version I installed is 1.8.0, the problem should be the Compiler compliance level.

Go to Window->Preference->Java->Compiler and find Compiler compliance level=1.5

 

Change the Compiler compliance level to 1.8:

 

Run the Main.java code again, it runs normally, and the console displays the following information:

ApplicationContext.xml file header error Referenced file contains errors

The problem is as follows: The project that was running normally before suddenly reported an error in the applicationContext.xml file header

Referenced file contains errors (http://www.springframework.org/schema/tx/spring-tx.xsd). For more   information, right click on the message in the Problems View and select “Show Details…”

Reason analysis: If you use Maven to build the project, spring always tries to find the xsd file locally when loading the xsd file (the spring jar package already contains all versions of the xsd file), if it is not found, it will go to the URL to specify The path to download. Therefore, this situation is generally caused by a disconnection or the temporary inability of spring’s official website to connect. You can enter the URL of the xsd file in the browser, for example, in the case of spring-beans, enter http://www.springframework.org/schema/beans/spring-beans-2.0.xsd to confirm.

But this time I didn’t use Maven, the jar packages were all released locally, so the above reasons were ruled out.

Another way of thinking:

1. To make sure that Eclipse can get the xsd file remotely, go to Window -> Preferences ->  General -> Network Connections -> Cache and check whether the required file is correct in the Cache entries box under Cache. If you are not sure, click ” Remove All”, then right-click the current Project and select  Validator, Eclipse will reload the xsd file;

2. The easiest way is to delete the version number of the xsd file (it has been deleted here, but an error is still reported, so method 1 is adopted).

[Solved] Hystrix error: java.util.concurrent.TimeoutException: null

The complete error is as follows:

java.util.concurrent.TimeoutException: null
    at com.netflix.hystrix.AbstractCommand.handleTimeoutViaFallback(AbstractCommand.java:997) ~[hystrix-core-1.5.18.jar:1.5.18]
    at com.netflix.hystrix.AbstractCommand.access$500(AbstractCommand.java:60) ~[hystrix-core-1.5.18.jar:1.5.18]
    at com.netflix.hystrix.AbstractCommand$12.call(AbstractCommand.java:609) ~[hystrix-core-1.5.18.jar:1.5.18]
    at com.netflix.hystrix.AbstractCommand$12.call(AbstractCommand.java:601) ~[hystrix-core-1.5.18.jar:1.5.18]
    at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$4.onError(OperatorOnErrorResumeNextViaFunction.java:140) ~[rxjava-1.3.8.jar:1.3.8]
    at rx.internal.operators.OnSubscribeDoOnEach$DoOnEachSubscriber.onError(OnSubscribeDoOnEach.java:87) ~[rxjava-1.3.8.jar:1.3.8]
    at rx.internal.operators.OnSubscribeDoOnEach$DoOnEachSubscriber.onError(OnSubscribeDoOnEach.java:87) ~[rxjava-1.3.8.jar:1.3.8]
    at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$1.run(AbstractCommand.java:1142) ~[hystrix-core-1.5.18.jar:1.5.18]
    at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable$1.call(HystrixContextRunnable.java:41) ~[hystrix-core-1.5.18.jar:1.5.18]
    at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable$1.call(HystrixContextRunnable.java:37) ~[hystrix-core-1.5.18.jar:1.5.18]
    at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable.run(HystrixContextRunnable.java:57) ~[hystrix-core-1.5.18.jar:1.5.18]
    at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$2.tick(AbstractCommand.java:1159) ~[hystrix-core-1.5.18.jar:1.5.18]
    at com.netflix.hystrix.util.HystrixTimer$1.run(HystrixTimer.java:99) ~[hystrix-core-1.5.18.jar:1.5.18]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_221]
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:1.8.0_221]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_221]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:1.8.0_221]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_221]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_221]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_221]

I asked Du Niang, there are those with the function of closing the circuit breaker, and those with a longer circuit breaker time, which are not on the point at all. My purpose is to test the function of the Hystrix circuit breaker, and they are all closed. How can I verify it? Later, I found that there was a line of error on top of this error:

com.netflix.hystrix.contrib.javanica.command.GenericCommand.getFallback 80 - failed to processed fallback is the method: 'failHi'.

Debugging the com.netflix.hystrix.contrib.javanica.command.GenericCommand.getFallback method, it is found that the @HystrixCommand annotation defines the fallbackMethod method to reflect the failure to call failHi, and the failHi method that reported the error is debugged again. Finally, it is found that a RuntimeException exception occurred in the failHi method. The wrong example code is as follows:

@HystrixCommand(fallbackMethod = "failHi")
@ResponseBody
@GetMapping("/hi3")
public String hi3() {
    return restTemplate.getForObject("http://127.0.0.1:" + port + "/res", String.class);
}

public String failHi() {
    try {
        return doThings();
    } catch (Exception e) {
        throw new RuntimeException("error," + e.getMessage());
    }
}

Log4j2 reports ERROR StatusLogger Unrecognized format specifier

problem

When using maven-shade-plugin or maven-assembly-plugin to mark the project into an executable JAR package, if you import log4j2, the following problems will occur:

ERROR StatusLogger Unrecognized format specifier [d]
ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [thread]
ERROR StatusLogger Unrecognized conversion specifier [thread] starting at position 25 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [level]
ERROR StatusLogger Unrecognized conversion specifier [level] starting at position 35 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [logger]
ERROR StatusLogger Unrecognized conversion specifier [logger] starting at position 47 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [msg]
ERROR StatusLogger Unrecognized conversion specifier [msg] starting at position 54 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [n]
ERROR StatusLogger Unrecognized conversion specifier [n] starting at position 56 in conversion pattern.

 

Solution

Add the following configuration to pom.

< plugin > 
   < groupId > org.apache.maven.plugins </ groupId > 
   < artifactId > maven-shade-plugin </ artifactId > 
   < version > 2.4.3 </ version > 
   < executions > 
       < execution > 
           < phase > package < / phase > 
           < goals > 
               < goal > shade </ goal > 
           </ goals > 
           <configuration > 
               < filters > 
                   < filter > 
                       < artifact > *:* </ artifact > 
                       < excludes > 
                           < exclude > META-INF/*.SF </ exclude > 
                           < exclude > META-INF/*.DSA </ exclude > 
                           < exclude > META-INF/*.RSA </ exclude > 
                       </ excludes > 
                   </ filter > 
               </ filters > 
               <finalName> ${artifactId}-${env}-${version} </ finalName > 
               < transformers > 
                   < transformer
                            implementation ="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer" > 
                       < mainClass > xxx.yyyy.zzz .Main </ mainClass > 
                   </ transformer > 
                   < transformer implementation ="org.apache.maven.plugins.shade.resource.AppendingTransformer" > 
                       < resource > META-INF/spring.handlers </ resource >
                   </transformer > 
                   < transformer implementation ="org.apache.maven.plugins.shade.resource.AppendingTransformer" > 
                       < resource > META-INF/spring.schemas </ resource > 
                   </ transformer > 
                   < transformer implementation ="org.apache.maven .plugins.shade.resource.AppendingTransformer" > 
                       < resource > META-INF/spring.tooling </ resource > 
                   </ transformer > 
                   < transformer
                            implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer" /> 
                   < transformer
                            implementation ="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> 
                   < transformer implementation ="com.github.edwgiz. mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer"  /> 
               </ transformers > 
           </ configuration > 
       </ execution > 
   </ executions > 
   < dependencies > 
       < dependency > 
           <groupId >com.github.edwgiz </ groupId > 
           < artifactId > maven-shade-plugin.log4j2-cachefile-transformer </ artifactId > 
           < version > 2.6.1 </ version > 
       </ dependency > 
   </ dependencies > 
</ plugin >

 

Cause Analysis

log4j2 is plug-in programming. When the log4j2 package is compiled, or the package containing the log4j2 plug-in is compiled, the plug-in information that needs to be loaded will be placed in META-INF/org/apache/logging/log4j/core/config/plugins/ Log4j2Plugins.dat (including the official logj42 native plug-in), and then when the project starts, log4j2 will scan the plug-in information file in the META-INF directory of each jar package, and then load the plug-in.

But when the project is marked as a jar package, if there are Log4j2Plugins.dat files in two different jar packages, there will be a problem, one of the files will be overwritten by the other, resulting in a file when the project starts The plug-in cannot be loaded normally, resulting in an error.

To solve this problem, when all jar packages are labeled as one jar package, the Log4j2Plugins.dat in each jar package needs to be merged. This is what the maven-shade-plugin.log4j2-cachefile-transformer package does.

How to Solve Error: Heartbeating to master:7182 failed.

Error background:

 cloudera-scm-agent can start and survive, but jps has no process.

Error report phenomenon:

View the error log: /opt/cm-5.15.1/log/cloudera-scm-agent/cloudera-scm-agent.log

[ 29 /Apr/ 2019  14 : 27 : 52 + 0000 ] 10528 MainThread throttling_logger INFO ( 14 skipped) Identified java component java8 with full version java version " 1.8.0_191 " Java(TM) SE Runtime Environment (build 1.8 .0_191-b12 ) Java HotSpot(TM) 64 -Bit Server VM (build 25.191 -b12, mixed mode)   for requested version.
[ 29 /Apr/ 2019  14 : 33 : 53 + 0000 ] 10528 MainThread agent ERROR Heartbeating to master: 7182 failed.
Traceback (most recent call last ):
  File " /opt/cm-5.15.1/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.15.1-py2.7.egg/cmf/agent.py " , line 1441 , in _send_heartbeat
    response = self.requestor.request( ' heartbeat ' , heartbeat_data)
  File " /opt/cm-5.15.1/lib64/cmf/agent/build/env/lib/python2.7/site-packages/avro-1.6.3-py2.7.egg/avro/ipc.py " , line 141 , in request
    return self.issue_request(call_request, message_name, request_datum)
  File " /opt/cm-5.15.1/lib64/cmf/agent/build/env/lib/python2.7/site-packages/avro-1.6.3-py2.7.egg/avro/ipc.py " , line 254 , in issue_request
    call_response = self.transceiver.transceive ( call_request )
  File " /opt/cm-5.15.1/lib64/cmf/agent/build/env/lib/python2.7/site-packages/avro-1.6.3-py2.7.egg/avro/ipc.py " , line 483 , in transceive
    result = self.read_framed_message()
  File " /opt/cm-5.15.1/lib64/cmf/agent/build/env/lib/python2.7/site-packages/avro-1.6.3-py2.7.egg/avro/ipc.py " , line 487 , in read_framed_message
    response = self.conn.getresponse()
  File " /usr/lib64/python2.7/httplib.py " , line 1113 , in getresponse
    response.begin()
  File " /usr/lib64/python2.7/httplib.py " , line 444 , in begin
    version, status, reason = self._read_status()
  File " /usr/lib64/python2.7/httplib.py " , line 408 , in _read_status
    raise BadStatusLine(line)
BadStatusLine: '' 
[ 29 /Apr/ 2019  14 : 34 : 08 + 0000 ] 10528 MainThread agent ERROR Heartbeating to master: 7182 failed.
Traceback (most recent call last ):
  File " /opt/cm-5.15.1/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.15.1-py2.7.egg/cmf/agent.py " , line 1435 , in _send_heartbeat
    self.master_port)
  File " /opt/cm-5.15.1/lib64/cmf/agent/build/env/lib/python2.7/site-packages/avro-1.6.3-py2.7.egg/avro/ipc.py " , line 469 , in __init__
    self.conn.connect()
  File " /usr/lib64/python2.7/httplib.py " , line 824 , in connect
    self.timeout, self.source_address)
  File " /usr/lib64/python2.7/socket.py " , line 571 , in create_connection
    raise err
error: [Errno 111 ] Connection refused
[ 29 /Apr/ 2019  14 : 34 : 08 + 0000 ] 10528 MainThread agent INFO Stopping agent...

Reason for error:

Error message: ERROR Heartbeating to master: 7182 failed.

Error explanation: failed to send heartbeat detection to the designated port 7180 of the master node.

When the Agent is started for the first time, it will generate a uuid with the path:, /opt/cm-5.1.3/lib/cloudera-scm-agent/uuidif the uuid of the Agent on each machine is the same, an error will be reported.

Error resolution:

Enter the directory: cd /opt/cm-5.15.1/lib/cloudera-scm-agent/

Delete uuid: rm -rf uuid

Restart the agent: /opt/cm-5.15.1/etc/init.d/cloudera-scm-agent restart

[Solved] Chrome submission error: Form submission canceled because the form is not connected

The code that ran normally in Chrome before, and the report submission error after Chrome was upgraded to 56:

Form submission canceled because the form is not connected

code show as below:

function submitData(name) {
  var form = $('<form method="post" action="updateName">'
                +'<input type="submit"/>'
                +'<input type="hidden" name="name" value="'+ name +'" /></form>');
 
  $('input[type="submit"]', form).click();
}
problem solved

the reason

The HTML standard stipulates that if the form is not added to the document, the form submission will be terminated.

Reference: Form submission algorithm

The version before Chrome56 is not compliant with the standard. Chrome56 fixes this problem and makes the form submission meet the standard requirements:

Reference: Chrome issue 2416033002

 

Solution

The solution is to add the form to the document before submitting:

jQuery

$(document).append(form);

or

document.body.appendChild(form);

[Solved] Notwritablepropertyexception: invalid property ‘mapperhelper’ of bean class

Problem:
The project integration of generic mapper when starting an error, first look at the error message, the project starts with the following error.
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property ‘mapperHelper’ of bean class [org.mybatis.spring.mapper.MapperFactoryBean]: Bean property ‘mapperHelper’ is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

Error Log:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'testAuthorController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [D:\workspace\core-cloud\core-cloud-author-core\target\classes\com\luntek\author\core\mapper\UserMapper.class]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'mapperHelper' of bean class [org.mybatis.spring.mapper.MapperFactoryBean]: Bean property 'mapperHelper' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1413) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.7.jar:5.3.7]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.7.jar:5.3.7]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.0.jar:2.5.0]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.5.0.jar:2.5.0]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:438) [spring-boot-2.5.0.jar:2.5.0]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:337) [spring-boot-2.5.0.jar:2.5.0]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1336) [spring-boot-2.5.0.jar:2.5.0]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1325) [spring-boot-2.5.0.jar:2.5.0]
	at com.luntek.server.CoreCloudServerApplication.main(CoreCloudServerApplication.java:13) [classes/:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [D:\workspace\core-cloud\core-cloud-author-core\target\classes\com\luntek\author\core\mapper\UserMapper.class]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'mapperHelper' of bean class [org.mybatis.spring.mapper.MapperFactoryBean]: Bean property 'mapperHelper' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1413) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-5.3.7.jar:5.3.7]
	... 20 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [D:\workspace\core-cloud\core-cloud-author-core\target\classes\com\luntek\author\core\mapper\UserMapper.class]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'mapperHelper' of bean class [org.mybatis.spring.mapper.MapperFactoryBean]: Bean property 'mapperHelper' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1726) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1434) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-5.3.7.jar:5.3.7]
	... 34 common frames omitted
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'mapperHelper' of bean class [org.mybatis.spring.mapper.MapperFactoryBean]: Bean property 'mapperHelper' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
	at org.springframework.beans.BeanWrapperImpl.createNotWritablePropertyException(BeanWrapperImpl.java:243) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.AbstractNestablePropertyAccessor.processLocalProperty(AbstractNestablePropertyAccessor.java:432) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:278) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:266) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:104) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:79) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1722) ~[spring-beans-5.3.7.jar:5.3.7]
	... 45 common frames omitted

There are too many error messages. Take a look at the main error messages


Error analysis

It can be seen from the error message that a parameter name called mapperhelper needs to be configured when integrating the general mapper. Before LZ, the project integration method is the same, but this one can’t be used. So I thought about whether the compatibility between springboot and mapper is a problem, so I changed the 3.4.0 version of general mapper to 4.1.5 version. After downloading the dependency again, the project started successfully. So I suggest you change the version of general mapper. In addition, netizens on the Internet said that it was caused by hot deployment. You can turn it off in the POM file, but the pro test is invalid. If you want to know how to configure it, you can check this post: springboot integrates general mapper and mybatis (sub module project)

[Solved] Mybatis Error: Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration.

Testing Mybatis, querying data, reporting errors.
### Error building SqlSession
### The error may exist in com/lxc/dao/UserMapper.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is ‘com/lxc/dao/UserMapper.xml’. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ‘User’.  Cause: java.lang.ClassNotFoundException: Cannot find class: User
The green circle in the screenshot below is the error file, look further back Cannot find class: User , indicating that the class was not found

In looking at the error file configuration.
Locate the error place, should write the full path

Solution: