Author Archives: Robins

[Solved] Error: ENOSPC: System limit for number of file watchers rea

describe:

Apache Superset is an open source data visualization platform.

To reproduce:

kali@kali:~/Desktop/superset$ sudo docker-compose up

The error is reported during the startup process of superset with docker as follows

Error from chokidar (/app/superset-frontend/images/viz_thumbnails): Error: ENOSPC: System limit for number of file watchers reached, watch

** **

Solution:

kali@kali:~/Desktop/superset$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p 
​[
 sudo] password for kali: 
​fs.inotify.max_user_watches
 =524288 
​fs.inotify.max_user_watches
 = 524288 
​kali
 @kali:~/Desktop/superset$

Re-docker run superset, green shows no errors

Problem reference:

https://github.com/gatsbyjs/gatsby/issues/11406

[Solved] Swagger Startup Error: java.lang.NumberFormatException: For input string: ““

1. Problem Description:

When the project is started and the browser opens the swagger document, the following error is always reported, but the document and the program are normal.

java.lang.NumberFormatException: For input string: ""
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_25]
	at java.lang.Long.parseLong(Long.java:601) ~[na:1.8.0_25]
	at java.lang.Long.valueOf(Long.java:803) ~[na:1.8.0_25]
	at io.swagger.models.parameters.AbstractSerializableParameter.getExample(AbstractSerializableParameter.java:412) ~[swagger-models-1.5.20.jar:1.5.20]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_25]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_25]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_25]
	at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_25]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:689) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:723) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:166) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:723) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:166) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:723) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:166) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeOptionalFields(MapSerializer.java:786) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo(MapSerializer.java:677) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:637) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:33) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:723) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:166) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:4374) [jackson-databind-2.11.0.jar:2.11.0]
	at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3629) [jackson-databind-2.11.0.jar:2.11.0]
	at springfox.documentation.spring.web.json.JsonSerializer.toJson(JsonSerializer.java:38) [springfox-spring-web-3.0.0.jar:3.0.0]
	at springfox.documentation.swagger2.web.Swagger2ControllerWebMvc.getDocumentation(Swagger2ControllerWebMvc.java:106) [springfox-swagger2-3.0.0.jar:3.0.0]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_25]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_25]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_25]
	at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_25]
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) [spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) [spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) [spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879) [spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) [spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) [spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) [spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) [spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) [spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) [spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) [servlet-api.jar:na]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) [spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [servlet-api.jar:na]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) [spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) [spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_25]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_25]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_25]

2. Cause of the problem:

1. View error log

2. Tracking problems

3. Breakpoint restore judgment

4. Error code found

5. The core of the problem

There is a problem with the annotation information of the property. The empty string ” cannot be converted to Number.

    /**
     * Message
     */
    @ResponseBody
    @ApiOperation(value = "Get order configuration table information based on ID")
    @ApiImplicitParams(@ApiImplicitParam(name = "id",value = "int type",dataType = "int",required = true))
    @RequestMapping(value = "/info/{id}",method = RequestMethod.GET)
    public R info(@PathVariable("id") Integer id){
		ApsOrderConfigEntity apsOrderConfig = apsOrderConfigService.getById(id);

        return R.ok().put("apsOrderConfig", apsOrderConfig);
    }

3. Problem solving

1. Remove the annotation directly

    /**
     * Message
     */
    @ResponseBody
    @ApiOperation(value = "Get order configuration table information based on ID")
//    @ApiImplicitParams(@ApiImplicitParam(name = "id",value = "int type",dataType = "int",required = true))
    @RequestMapping(value = "/info/{id}",method = RequestMethod.GET)
    public R info(@PathVariable("id") Integer id){
		ApsOrderConfigEntity apsOrderConfig = apsOrderConfigService.getById(id);

        return R.ok().put("apsOrderConfig", apsOrderConfig);
    }

2. Add example = "1"

    /**
     * Message
     */
    @ResponseBody
    @ApiOperation(value = "Get order configuration table information based on ID")
    @ApiImplicitParams(@ApiImplicitParam(name = "id",value = "int type",dataType = "int",required = true,example = "1"))
    @RequestMapping(value = "/info/{id}",method = RequestMethod.GET)
    public R info(@PathVariable("id") Integer id){
		ApsOrderConfigEntity apsOrderConfig = apsOrderConfigService.getById(id);

        return R.ok().put("apsOrderConfig", apsOrderConfig);
    }

[Solved] Springboot Reflection calls ServiceImpl Error: java.lang.NullPointerException, mapper is null

Springboot uses reflection to call serviceimpl and reports an error: java.lang.nullpointerexception

Because the mapper of ServiceImpl is null, the following is the original implementation code:

           // package name and class name
           Class classzz = Class.forName("com.XXX.XXX.service.impl.SenDataServiceImpl");

           // Get the constructor object
           Constructor constructor = null;
           try {
               constructor = classzz.getConstructor();
           } catch (NoSuchMethodException e) {
               e.printStackTrace();
           }
           // Create an object using the constructor object
           Object o = constructor.newInstance();
           // Pass the method to be executed Pass the parameter type, if not, you can leave it out
           Method method = classzz.getMethod("method name", long.class,String.class,String.class );
// invoke method, and pass parameters, if there are no parameters, you can leave them out
           Object obj =method.invoke(o,  5,
                  "param1",
                   "param2");

In the post query mode, you need to ContextLoader.getCurrentWebApplicationContext() firstly, but you haven’t gone to invoke, so the ContextLoader.getCurrentWebApplicationContext() is null.

The final solution is as follows:

1. Create a new class SpringBootBeanUtil

package com.smart.hyd.common.utils.reflect;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * SpringBoot Common class to get the bean tool class in the Spring container
 */
@Component
public class SpringBootBeanUtil implements ApplicationContextAware {

    private static ApplicationContext applicationContext;

    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        if (SpringBootBeanUtil.applicationContext == null) {
            SpringBootBeanUtil.applicationContext = applicationContext;
        }
        System.out.println("========ApplicationContext========");
//        System.out.println("========In the general class you can get the applicationContext object by calling SpringBootBeanUtil.getApplicationContext()========");
        System.out.println("========applicationContext="+ SpringBootBeanUtil.applicationContext +"========");
    }

    /**
     * get applicationContext
     * @return
     */
    public static ApplicationContext getApplicationContext() {
        return applicationContext;
    }

    /**
     * Get Bean by name.
     * @param name
     * @return
     */
    public static Object getBean(String name) {
        return getApplicationContext().getBean(name);
    }

    /**
     * Get Bean by class.
     * @param clazz
     * @return
     */
    public static <T> T getBean(Class<T> clazz) {
        return getApplicationContext().getBean(clazz);
    }

    /**
     * Return the specified bean by name, and Clazz
     * @param name
     * @param clazz
     * @return
     */
    public static <T> T getBean(String name, Class<T> clazz) {
        return getApplicationContext().getBean(name, clazz);
    }

}

2. Call SpringBootBeanUtil.getApplicationContext(). When invoking, the first parameter is applicationContext.getBean(ServiceImplType). Refer to the following code for specific implementation.

try {
               //Retrieve the created object from the ApplicationContext
               // Do not create the serviceimpi object directly by reflection, because the object created by reflection cannot instantiate the dao interface
               ApplicationContext applicationContext = SpringBootBeanUtil.getApplicationContext();
               //reflection creates the serviceimpi entity object, and the entity class
               Class<? > ServiceImplType = Class.forName("com.XXX.XXX.service.impl.SenDataServiceImpl");
              // Class<? > entityType = Class.forName("com.XXX.XXX.service.impl.SenDataServiceImpl");
               //reflection set method parameters.
               Method method = ServiceImplType.getDeclaredMethod("methodName",long.class,String.class,String.class );
               // get the instantiated bean in the ApplicationContext according to class
               method.invoke(applicationContext.getBean(ServiceImplType), 5,
                           "param1",
                           "param2");

           } catch (ClassNotFoundException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
               e.printStackTrace();
               LOGGER.error("\n onMessage Receive Processing Message Failed - {}", "methodName");
           }

This solves the problem that the reflection calls ServiceImpland the mapper reports an error when it is null.

[Solved] Virtual Machine Boot-up Error: failed to recover intents

The system boots up and enters rescue mode, reporting the following error.

Generating "/run/initramfs/rdsosreport.txt"
Entering emergency mode. Exit the shell to continue.
Tupe "journalctl" to view sustem logs.
You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot after mounting them and attach it to a bug report.

 

View the system log via journalctl -n 30 as follows.

Solution:
umount /dev/sda3 //If you do not enter rescue mode, you need to first umount, then repair
xfs_repair -v -L /dev/sda3
reboot

 

[Solved] SyntaxError: Unexpected end of JSON input

Note: When doing a project, I encountered the need to transfer a line of data objects to another page, using JSON.stringify => JSON.parse and then transferring it by url:

Then the error is reported as follows:

Later, after reviewing the relevant information, we found that we need to add a coding and decoding process, as follows:

After printing, the object appears:

Cause analysis:

Reason: If an address is encountered in the parameters of the object or the elements of the array, and the address includes ? and & these special symbols, the object/array must first be converted to a string by JSON.stringify and then encoded by encodeURIComponent, when received, first decoded by decodeURIComponent and then converted to JSON format object/array by JSON.parse

[Solved] Springboot Package jar and Startup Error: It was loaded from the following location

Previously, when using springboot to develop the system, the @Resouse annotation was used. There was no exception during the idea runtime, but the jar package conflict was reported when the deployment was packaged.

09:07:51.234 [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter - [report,40] - 

***************************
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.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.<init>(CommonAnnotationBeanPostProcessor.java:664)

The following method did not exist:

    'java.lang.String javax.annotation.Resource.lookup()'

The method's class, javax.annotation.Resource, is available from the following locations:

    jar:file:/C:/vic/vic-admin.jar!/BOOT-INF/lib/jsr250-api-1.0.jar!/javax/annotation/Resource.class
    jar:file:/C:/vic/vic-admin.jar!/BOOT-INF/lib/jakarta.annotation-api-1.3.5.jar!/javax/annotation/Resource.class

The class hierarchy was loaded from the following locations:

    javax.annotation.Resource: jar:file:/C:/vic/vic-admin.jar!/BOOT-INF/lib/jsr250-api-1.0.jar!/


Action:

Correct the classpath of your application so that it contains a single, compatible version of javax.annotation.Resource

Reason:

jsr250-api-1.0.jar and jakarta.annotation-api-1.3.5.jar are duplicated

Solution:

Import the following dependency in the pom of Maven. the codes is as below:

<dependency>
    <groupId>javax.annotation</groupId>
    <artifactId>javax.annotation-api</artifactId>
    <version>1.3.2</version>
</dependency>

The purpose of this is to make the system automatically import the latest jar package

[Solved] uview u-sticky Error: Cannot read property ‘bottom‘ of null

The causes are:

The component u-sticky and the bottom navigation bar tabbar conflict when switching pages, the sticky component creates an Observer listener, and when the page is switched and not destroyed, it causes the component to remain listening, so the error Cannot read property ‘bottom’ of null appears. So we need to disconnect the Observer listener manually to solve this error problem

Source code:

<u-sticky offset-top="200" >

</u-sticky>

 

Modified:

<template>
	
		<u-sticky offset-top="200" :enable="enable">
				
		</u-sticky>
</template>

<script>
	export default {
		data() {
			return {
				// @property {Boolean} enable Whether to open the ceiling function(default is true)
				enable:true
			}
		},
		// Turn on or off listeners in the corresponding show and hide page lifecycle
		onShow() {
			this.enable= true
		},
		onHide() {
			this.enable= false
		}

	}
</script>

[Solved] DatePicker Error: Prop being mutated: “placement“

1. Reason for error reporting

element-ui version: 2.15.9

Screenshot is as follows:

2. Cause analysis

After element-ui was upgraded to version 2.15.6 or higher, a line of code was added inside the date-picker component to directly modify the placement (you can check it out)
A screenshot of the viewing address is as follows.

3. Solution

  1. Go to the project package.json file to check the element-ui version, if it is higher than 2.15.6, uninstall the current version directly
  2. Type npm install [email protected] -S to install version 2.15.6, and then remove the ^ sign in front of the version (if you don’t know the version symbol in front of it, you can look at it on Google)
  3. Remove the node_modules package
  4. Type npm install to install the dependencies

 

4. Screenshot of element-ui version

[Solved] Neo4j error: Cannot merge the following node because of null property value for ‘casualty’

Execute the following command in neo4j:

LOAD CSV WITH HEADERS  FROM "file:///accident.csv" AS line
MERGE (p:accident{id:line.id,name:line.code,casualty:line.casualty})

 

Report an error:

Cannot merge the following node because of null property value for 'casualty': (:accident {casualty: null}) (Failure when processing file '/E:/Program/...../neo4j-community-4.4.8/import/accident.csv' on line 2.)

Cause: In the first time the entity is created and the casualty value in the file is empty.
Solution: Change merge to create

Source: Explanation of error “Cannot merge node using null property value for” – Knowledge Base

[Solved] Vue Project Error: “TypeError: Cannot read properties of undefined (reading ‘init‘)“

 

Background

After introducing the ecarts plug-in into the Vue project, the following errors are found:

[Vue warn]: Error in mounted hook: “TypeError: Cannot read properties of undefined (reading ‘init’)”

The way to import components is: Import on demand

// import echarts
import echarts from 'echarts';
export default {
    name:"",
    mounted() {
        // Initialize echarts instance
        let lineCharts = echarts.init(this.$refs.charts);//On-demand introduction
}

Solution:

Change the introduction method

import * as echarts from 'echarts';

How to Solve appium Startup Error (Various Error Messages)

The appium startup keeps reporting errors.
Various errors, such as.

[debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","192.168.0.4:5555","shell","am","instrument","-w","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"]
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[WD Proxy] Got an unexpected response: {"errno":-4077,"code":"ECONNRESET","syscall":"read"}

or:

[debug] [ADB] Running 'D:\003-soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 192.168.0.4\:5555 forward --remove tcp\:8200'
[UiAutomator2] Unable to remove port forward 'Error executing adbExec. Original error: 'Command 'D\:\\003-soft\\android-sdk-windows\\platform-tools\\adb.exe -P 5037 -s 192.168.0.4\:5555 forward --remove tcp\:8200' exited with code 1'; Stderr: 'error: listener 'tcp:8200' not found'; Code: '1''
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1659668519002 (11:01:59 GMT+0800 (China Standard Time))

 

The appium.setting installed on the device doesn’t open manually either, and I always thought that was the reason.
Tried to re-install appium and node version, still not working. Finally, here is the solution below:

if automation_name =='UiAutomator2':
    desired_cap['uiautomator2ServerInstallTimeout'] = 20000 This time is changed from 9000 to 20000 and it's fine. It started successfully. After a week of problems, finally good.