Author Archives: Robins

[Solved] Java.lang.ClassCastException: [Ljava.lang.Long; cannot be cast to java.util.List

preface

Recently, I used the Renren fast framework to transform a crawler 3.0 project, and found an official bug java. Lang. ClassCastException: [ljava. Lang. long; Can't be cast to Java. Util. List , because long [] can't be converted to List & lt; Object caused.
Detailed error report

2021-06-20 22:14:48.436 ERROR 15920 --- [io-8080-exec-18] i.r.common.exception.RRExceptionHandler  : nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: java.lang.ClassCastException: class [Ljava.lang.Long; cannot be cast to class java.util.List ([Ljava.lang.Long; and java.util.List are in module java.base of loader 'bootstrap')
### The error may exist in file [D:\workspace\spring\TenderFetchSystem\tfs-admin\target\classes\mapper\job\ScheduleJobDao.xml]
### The error may involve io.renren.modules.job.dao.ScheduleJobDao.updateBatch
### The error occurred while executing an update
### Cause: java.lang.ClassCastException: class [Ljava.lang.Long; cannot be cast to class java.util.List ([Ljava.lang.Long; and java.util.List are in module java.base of loader 'bootstrap')

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: java.lang.ClassCastException: class [Ljava.lang.Long; cannot be cast to class java.util.List ([Ljava.lang.Long; and java.util.List are in module java.base of loader 'bootstrap')
### The error may exist in file [D:\workspace\spring\TenderFetchSystem\tfs-admin\target\classes\mapper\job\ScheduleJobDao.xml]
### The error may involve io.renren.modules.job.dao.ScheduleJobDao.updateBatch
### The error occurred while executing an update
### Cause: java.lang.ClassCastException: class [Ljava.lang.Long; cannot be cast to class java.util.List ([Ljava.lang.Long; and java.util.List are in module java.base of loader 'bootstrap')
	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)
	at com.sun.proxy.$Proxy90.update(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:287)
	at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:65)
	at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:96)
	at com.sun.proxy.$Proxy152.updateBatch(Unknown Source)
	at io.renren.modules.job.service.impl.ScheduleJobServiceImpl.updateBatch(ScheduleJobServiceImpl.java:100)
	at io.renren.modules.job.service.impl.ScheduleJobServiceImpl.pause(ScheduleJobServiceImpl.java:118)
	at io.renren.modules.job.service.impl.ScheduleJobServiceImpl$$FastClassBySpringCGLIB$$1.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:769)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
	at io.renren.modules.job.service.impl.ScheduleJobServiceImpl$$EnhancerBySpringCGLIB$$1.pause(<generated>)
	at io.renren.modules.job.controller.ScheduleJobController.pause(ScheduleJobController.java:115)
	at io.renren.modules.job.controller.ScheduleJobController$$FastClassBySpringCGLIB$$1.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:769)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
	at io.renren.common.aspect.SysLogAspect.around(SysLogAspect.java:52)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
	at org.apache.shiro.spring.security.interceptor.AopAllianceAnnotationsAuthorizingMethodInterceptor$1.proceed(AopAllianceAnnotationsAuthorizingMethodInterceptor.java:82)
	at org.apache.shiro.authz.aop.AuthorizingMethodInterceptor.invoke(AuthorizingMethodInterceptor.java:39)
	at org.apache.shiro.spring.security.interceptor.AopAllianceAnnotationsAuthorizingMethodInterceptor.invoke(AopAllianceAnnotationsAuthorizingMethodInterceptor.java:115)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
	at io.renren.modules.job.controller.ScheduleJobController$$EnhancerBySpringCGLIB$$1.pause(<generated>)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:888)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:112)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at io.renren.common.xss.XssFilter.doFilter(XssFilter.java:30)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
	at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:96)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:41002)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1598)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:834)

Solutions

1. First of all, of course, it starts with interface call

through debugging, it is found that Vue calls the back-end “/ pause” interface

2. Do it by yourself. Through a simple analysis of the code, to locate the problem
originally, it was map.put ("list", jobids) but jobids is not List , the problem is ~
by using arrays.aslist (jobids) to directly convert the object to List type, the problem is solved!

@Service("scheduleJobService")
public class ScheduleJobServiceImpl extends ServiceImpl<ScheduleJobDao, ScheduleJobEntity> implements ScheduleJobService {
//Selected from ScheduleJobServiceImpl This class, omitting other irrelevant content.

	@Override
	@Transactional(rollbackFor = Exception.class)
    public void pause(Long[] jobIds) {
        // Iterate and stop the job
		for(Long jobId : jobIds){
    		ScheduleUtils.pauseJob(scheduler, jobId);
    	}
        //Update the status after stopping the job
    	updateBatch(jobIds, Constant.ScheduleStatus.PAUSE.getValue());
    }
	@Override
    public int updateBatch(Long[] jobIds, int status){
    	Map<String, Object> map = new HashMap<>(2);
    	//fix official bug,by zhengkai.blog.csdn.net
    	map.put("list", Arrays.asList(jobIds));
    	map.put("status", status);
    	return baseMapper.updateBatch(map);
    }

}
    

3. Verification

[Solved] Runtimeerror: CUDA error: device side assert triggered

The questions are as follows:

1. The problems are as follows:

RuntimeError: CUDA error: device-side assert triggered
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_ LAUNCH_ BLOCKING=1.

2. Solution:

(1) At the beginning, I searched for solutions on the Internet. As a result, most netizens’ solutions are similar to this:

Some people say that the reason for this problem is that there are tags exceeding the number of categories in the training data when doing the classification task. For example: if you set up a total of 8 classes, but there is 9 in the tag in the training data, this error will be reported. So here’s the problem. There’s a trap. If the tag in the training data contains 0, the above error will also be reported. This is very weird. Generally, we start counting from 0, but in Python, the category labels below 0 have to report an error. So if the category label starts from 0, add 1 to all category labels.

Python scans the train itself_ Each folder under path (each type of picture is under its category folder), and map each class to a numerical value. For example, there are four categories, and the category label is [0,1,2,3]. In the second classification, the label is mapped to [0,1], but in the fourth classification, the label is mapped to [1,2,3,4], so an error will be reported.

(2) In fact, it’s useless for me to solve the same problem that I still report an error. Later, I looked up the code carefully and found that it was not the label that didn’t match the category of the classification, but there was a problem with the code of the last layer of the network. If you want to output the categories, you should fill in the categories.

 self.outlayer = nn.Linear(256 * 1 * 1, 3)  # The final fully connected layer

# Others are 3 categories, while mine is 5 categories, corrected here to solve

 self.outlayer = nn.Linear(256 * 1 * 1, 5) # The last fully connected layer

(3) It’s actually a small problem, but it’s been working for a long time. Let’s make a record here. The actual situation after the solution:

[Solved] Using GCP copy to report errors in Linux: DBUS. Exceptions. Dbusexception: org. Freedesktop. DBUS. Error. Notsupported:

1 Error when using gcp copy in linux
Error reported when using gcp copy in Linux.dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

zhihui@zhihui-MS-7B46:~/shl_proj/1_project$ cp -r /media/zhihui/sd/shl_dataset/ ./
Traceback (most recent call last):
  File "/usr/bin/gcp", line 678, in <module>
    gcp = GCP()
  File "/usr/bin/gcp", line 190, in __init__
    sessions_bus = dbus.SessionBus()
  File "/usr/lib/python2.7/dist-packages/dbus/_dbus.py", line 211, in __new__
    mainloop=mainloop)
  File "/usr/lib/python2.7/dist-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
zhihui@zhihui-MS-7B46:~/shl_proj/1_project$ vim ~/.bashrc 

2 solutions

1. Modify the ~ /. Bashrc file and add the following

alias cp='dbus-launch gcp'

2. Let the changes take effect

source ~/.bashrc

Then try copying it again!

Error starting peacock in manjaro [How to Solve]

Peacock is a GUI interface in moose, which can help judge the input of model. One day, when I opened the software and found peacock, an error occurred and the error content was reported

libGL error: MESA-LOADER: failed to open r600: /home/zhaohaowang/miniconda3/envs/moose/lib/python3.7/site-packages/PyQt5/../../../libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/dri/r600_dri.so) (search paths /usr/lib/dri)
libGL error: failed to load driver: r600
libGL error: MESA-LOADER: failed to open r600: /home/zhaohaowang/miniconda3/envs/moose/lib/python3.7/site-packages/PyQt5/../../../libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/dri/r600_dri.so) (search paths /usr/lib/dri)
libGL error: failed to load driver: r600
libGL error: MESA-LOADER: failed to open swrast: /home/zhaohaowang/miniconda3/envs/moose/lib/python3.7/site-packages/PyQt5/../../../libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/dri/swrast_dri.so) (search paths /usr/lib/dri)

According to the statement on the Internet:

Similar problems

And

Matlab encountered this problem
found that the libstdc + + library of peacock did not match the system library

solve the problem

First, find the location of libstdc +

sudo find/-name "libstdc++.so.6*"

obtain

find: ‘/proc/83730/task/83730/net’: Invalid arguments
find: '/proc/83730/net': invalid parameter
find: '/run/user/1000/gvfs': insufficient permissions
/home/zhaohaowang/miniconda3/pkgs/libstdcxx-ng-9.3.0-h6de172a_19/lib/libstdc++.so.6.0.28
/home/zhaohaowang/miniconda3/pkgs/libstdcxx-ng-9.3.0-h6de172a_19/lib/libstdc++.so.6
/home/zhaohaowang/miniconda3/pkgs/gcc_impl_linux-64-9.3.0-h28f5a38_17/x86_64-conda-linux-gnu/sysroot/lib64/libstdc++.so.6.0.28
/home/zhaohaowang/miniconda3/pkgs/gcc_impl_linux-64-9.3.0-h28f5a38_17/x86_64-conda-linux-gnu/sysroot/lib64/libstdc++.so.6
/home/zhaohaowang/miniconda3/pkgs/libstdcxx-ng-9.1.0-hdf63c60_0/lib/libstdc++.so.6.0.26
/home/zhaohaowang/miniconda3/pkgs/libstdcxx-ng-9.1.0-hdf63c60_0/lib/libstdc++.so.6
/home/zhaohaowang/miniconda3/pkgs/libstdcxx-ng-9.1.0-hdf63c60_0/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6.0.26
/home/zhaohaowang/miniconda3/pkgs/libstdcxx-ng-9.1.0-hdf63c60_0/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6
/home/zhaohaowang/miniconda3/pkgs/libstdcxx-devel_linux-64-9.3.0-h4084dd6_17/x86_64-conda-linux-gnu/lib/libstdc++.so.6.0.28
/home/zhaohaowang/miniconda3/pkgs/libstdcxx-devel_linux-64-9.3.0-h4084dd6_17/x86_64-conda-linux-gnu/lib/libstdc++.so.6
/home/zhaohaowang/miniconda3/lib/libstdc++.so.6.0.26
/home/zhaohaowang/miniconda3/lib/libstdc++.so.6.0.29
/home/zhaohaowang/miniconda3/lib/libstdc++.so.6.0.2
/home/zhaohaowang/miniconda3/envs/moose/x86_64-conda-linux-gnu/sysroot/lib64/libstdc++.so.6.0.28
/home/zhaohaowang/miniconda3/envs/moose/x86_64-conda-linux-gnu/sysroot/lib64/libstdc++.so.6
/home/zhaohaowang/miniconda3/envs/moose/x86_64-conda-linux-gnu/lib/libstdc++.so.6.0.28
/home/zhaohaowang/miniconda3/envs/moose/x86_64-conda-linux-gnu/lib/libstdc++.so.6
/home/zhaohaowang/miniconda3/envs/moose/lib/libstdc++.so.6.0.28
/home/zhaohaowang/miniconda3/envs/moose/lib/libstdc++.so.6
/home/zhaohaowang/miniconda3/envs/moose/lib/libstdc++.so.6.0.29
/home/zhaohaowang/miniconda3/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6.0.26
/home/zhaohaowang/miniconda3/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6
/home/zhaohaowang/.local/share/RecentDocuments/libstdc++.so.6.0.26.desktop
/usr/lib/dri/libstdc++.so.6
/usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6.0.29
/usr/lib32/libstdc++.so.6
/usr/lib32/libstdc++.so.6.0.29
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.29-gdb.py

Link lib/libstdc + +. So. 6 to the libstdc + + of peacock

ln -sf /usr/lib/libstdc++.so.6  /home/zhaohaowang/miniconda3/envs/moose/lib/python3.7/site-packages/PyQt5/../../../libstdc++.so.6

Then it can be spicy!

Vue: initialize failed: invalid DOM [How to Solve]

The problem encountered here is to
introduce ecarts, because before DOM is loaded, option gets the element, and ecarts. Init (document. Queryselect (‘# DOM’)
starts to detect Dom and tries to get it. However, in the case where ecarts is referenced in Vue,
ecarts. Init() has been executed before DOM is loaded, Therefore, an error initialization failed: invalid DOM will be reported

2. Solution:
the root cause is that DOM is not loaded, and ecarts does not detect DOM, so I will let DOM load and then get DOM, here we need to use the
promise in ES6 syntax

//Methods
function initecarts() {
was used     // New promise object
is created      let newPromise = new Promise((resolve) => {
resolve()
})
// Then the initialization function of ecarts is executed asynchronously      newPromise.then(() => {
//     This DOM displays the DOM for ecarts
icon          echarts.init(DOm)
})
}

// method
function initEcharts () {
	// Create a new Promise object
	let newPromise = new Promise((resolve) => {
		resolve()
	})
	// then asynchronously execute the initialization function of echarts
	newPromise.then(() => {
		// This dom is the echarts icon display dom
		echarts.init(DOm)
	})
}

The method is very simple, which is an asynchronous operation
operation

Git Clone RPC failed;curl 18 transfer closed with outstanding read data remaining

Git clone times RPC failed; Curl 18 transfer closed with outstanding read data remaining error

Reason 1: buffer overflow

Solution: command line input

git config http.postBuffer 524288000

If clone still fails to execute the above command, consider possible reason 2: slow network download speed

Solution: command line input

git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999

If clone still fails, shallow clone first, and then update the remote database to the local database

git clone --depth=1 http://gitlab.xxx.cn/yyy/zzz.git
git fetch --unshallow

Kettle Error Caused by: java.lang.ArrayIndexOutOfBoundsException

2021/06/25 13:11:31 – Table Output.0 – Unexpected error inserting row
2021/06/25 13:11:31 – Table Output.0 – -32515
2021/06/25 13:11:31 – Table Output.0 –
2021/06/25 13:11:31 – Table Output.0 –
2021/06/25 13:11:31 – Table Output.0 –     at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:385)
2021/06/25 13:11:31 – Table Output.0 –     at org.pentaho.di.trans.steps.tableoutput.TableOutput.processRow(TableOutput.java:125)
2021/06/25 13:11:31 – Table Output.0 –     at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2021/06/25 13:11:31 – Table Output.0 –     at java.lang.Thread.run(Thread.java:748)
2021/06/25 13:11:31 – Table Output.0 – Caused by: org.pentaho.di.core.exception.KettleDatabaseException:
2021/06/25 13:11:31 – Table Output.0 – Unexpected error inserting row
2021/06/25 13:11:31 – Table Output.0 – -32515
2021/06/25 13:11:31 – Table Output.0 –
2021/06/25 13:11:31 – Table Output.0 –     at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:298)
2021/06/25 13:11:31 – Table Output.0 –     … 3 more
2021/06/25 13:11:31 – Table Output.0 – Caused by: java.lang.ArrayIndexOutOfBoundsException: -32515
2021/06/25 13:11:31 – Table Output.0 –     at oracle.jdbc.driver.OraclePreparedStatement.setupBindBuffers(OraclePreparedStatement.java:2673)
2021/06/25 13:11:31 – Table Output.0 –     at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10689)
2021/06/25 13:11:31 – Table Output.0 –     at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:292)
2021/06/25 13:11:31 – Table Output.0 –     … 3 more

Cause : Caused by too many records submitted in a single session

JAVA: How to Use Multipartfile to upload Files

@PostMapping("upload")
public ResponseVo upload(@RequestParam("files[]") MultipartFile[] files) {
    Map<String, Object> resultMap = new HashMap<>();
    if (ArrayUtils.isEmpty(files)) {
        //resultMap.put("message", MessageUtil.getMessage("upload.error.no_files"));
        return new ResponseVo(ErrorCode.ACTION_ERROR).setMsg("没有上传文件");
    }
    MultipartFile multipartFile = files[0];
    File tmpFile = new File(System.currentTimeMillis() + "_" + multipartFile.getOriginalFilename());
    try (BufferedOutputStream outBuff = new BufferedOutputStream(new FileOutputStream(tmpFile)); BufferedInputStream inBuff = new BufferedInputStream(multipartFile.getInputStream())) {
        // Buffered arrays
        byte[] b = new byte[1024 * 5];
        int len;
        while ((len = inBuff.read(b)) != -1) {
            outBuff.write(b, 0, len);
        }
        // Flush the output stream of this buffer
        outBuff.flush();
        resultMap.put("message", MessageUtil.getMessage("upload.success"));
        resultMap.put("data", tmpFile);
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        return new ResponseVo().setMsg("upload failed");
    } finally {
        FileUtils.deleteQuietly(tmpFile);
    }
    return new ResponseVo().setData(resultMap);
}

Result of postman call:

</ div>

Unable to access javax.servlet.servletexception [How to Solve]

Using idea, a spring boot project based on Maven is created. In the process of deploying the project with war package and Linux (providing JDK environment, Tomcat), when packaging, you will be prompted that javax. Servlet. ServletException
cannot be accessed

You need to remove tomcat from the web dependency
		<dependency>
		  <groupId>org.springframework.boot</groupId>
		  <artifactId>spring-boot-starter-web</artifactId>
		  <exclusions>
		    <exclusion>
		      <groupId>org.springframework.boot</groupId>
		      <artifactId>spring-boot-starter-tomcat</artifactId>
		    </exclusion>
		  </exclusions>
		</dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
 <plugin>		No web required for packaging
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.4</version>
        <configuration>
            <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
    </plugin>

[Solved] You must configure either the server or JDBC driver (via the ‘serverTimezone‘ configuration proper

This error occurs when running the example
2021-06-25 10:14:14.571 ERROR 10096 — [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: The server time zone value ‘�й���׼ʱ��’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the ‘serverTimezone’ configuration property) to use a more specifc time zone value if you want to utilize time zone support.] with root causeSolution:

add the following codes to application.properties

spring.datasource.url=jdbc:mysql://localhost:3306/you_mysql?serverTimezone=UTC

How to Use qdbusinterface to call DBUS interface

        // Create QDBusInterface
        QDBusInterface iface("org.onboard.Onboard",
                             "/org/onboard/Onboard/Keyboard",
                             "org.onboard.Onboard.Keyboard");
        if (!iface.isValid()) {
            qInfo() << qPrintable(QDBusConnection::sessionBus().lastError().message());
        }
        QDBusReply<void> reply = iface.call("Show");
        if (reply.isValid()) {
            qInfo() << "call org.onboard.Onboard.Keyboard success";
            return;
        }
        qInfo() << "call corg.onboard.Onboard.Keyboard failed" << reply.error();
    });