Category Archives: Error

[Solved] java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/util/ByteArrayBuffer

A project that has not been updated for a long time is flashing after updating targetSdkVersion = 30 (below 29 has been mercilessly abandoned…) , this following error is reported:

java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/util/ByteArrayBuffer;
        at com.iflytek.cloud.thirdparty.an.a(SourceFile:178)
        at com.iflytek.cloud.thirdparty.an.b(SourceFile:309)
        at com.iflytek.cloud.thirdparty.an.run(SourceFile:163)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.util.ByteArrayBuffer" on path: DexPathList[[zip file "/data/app/com.qjtc.magicalar-7__z6vqbyO2enmVlUO8V7A==/base.apk"],nativeLibraryDirectories=[/data/app/com.qjtc.magicalar-7__z6vqbyO2enmVlUO8V7A==/lib/arm, /data/app/com.qjtc.magicalar-7__z6vqbyO2enmVlUO8V7A==/base.apk!/lib/armeabi-v7a, /system/lib, /hw_product/lib]]

Can’t find the class ByteArrayBuffer is deprecated, add org.apache.http.legacy to introduce this library.

Solution: Add the following codes in the <application> tag of AndroidManifest.xml:

<uses-library android:name="org.apache.http.legacy" android:required="false"/>

[Solved] AndroidStudio Error: Connect to 127.0.0.1:10887 [/127.0.0.1] failed: Connection refused…

 > Connect to 127.0.0.1:10887 [/127.0.0.1] failed: Connection refused (Connection refused)
      > Failed to list versions for com.tencent.bugly:symtabfileuploader.
         > Unable to load Maven meta-data from https://dl.google.com/dl/android/maven2/com/tencent/bugly/symtabfileuploader/maven-metadata.xml.
            > Could not get resource 'https://dl.google.com/dl/android/maven2/com/tencent/bugly/symtabfileuploader/maven-metadata.xml'.
               > Could not GET 'https://dl.google.com/dl/android/maven2/com/tencent/bugly/symtabfileuploader/maven-metadata.xml'.
                  > Connect to 127.0.0.1:10887 [/127.0.0.1] failed: Connection refused (Connection refused)

When I run the android Studio project on my mac computer, I get a bunch of error messages, which I have never touched. In fact, if I analyze the error message calmly, I can know that the configuration of the proxy is the cause, but I have closed the proxy, how can I still report the error, is it caused by the cache? Or is it that there are still proxies for local files.

The reason is that the proxy is set in the local, local, local gradle.properties

Solution: open ~/.gradle/gradle.properties

Open gradle.properties file, comment out or delete the code below directly, clear the cache again, and run it OK.

 

[Solved] KEIL Error: keil Error: failed to execute ‘C:\Keil\ARM\ARMCC‘

 

Question:

keil Error: failed to execute ‘C:\Keil\ARM\ARMCC’

Cause of problem:

route:

.\MDK_ARM\ARM

Kiel ARM compiler is missing:

Because the latest version of Keil installation directory does not support ARMCC, that is, version 5 cannot be used

Solution:

1. Download the old version of keil

2. Right click to unzip the file, and put the file into the folder where the new version of ARM is installed

3. Add this folder

[Solved] Neo4j Error: Error occurred during initialization of VM Incompatible minimum and maximum heap sizes spec

The run instruction neo4j console displays the following error messages

WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual.
Starting Neo4j Server console-mode...
Using additional JVM arguments:  -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xms512m -Xmx1024 #as large as you canm
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified

I suspected that the problem was the configuration of my Neo4j parameters. so I open the file neo4j-wrapper.conf,(sudo) vim neo4j-wrapper.conf

later, I delete the note “`#as large you kan“  after the wrapper.java.maxmemory=10240 , it can run normally, and the results are as follows:

root@VM-12-7-ubuntu:/home/thicker/GNN/FIRST/neo4j/bin# neo4j console
WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual.
Starting Neo4j Server console-mode...
Using additional JVM arguments:  -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xms512m -Xmx10240m
2022-07-23 08:15:48.452+0000 INFO  [API] Setting startup timeout to: 120000ms based on -1
2022-07-23 08:15:48.508+0000 INFO  [Configuration] WARNING! Physical memory(8003MB) is less than assigned JVM memory(10451MB). Continuing but with available JVM memory set to available physical memory
2022-07-23 08:15:49.724+0000 INFO  [API] Successfully started database
2022-07-23 08:15:49.777+0000 INFO  [API] Starting HTTP on port :7474 with 40 threads available
2022-07-23 08:15:49.904+0000 INFO  [API] Enabling HTTPS on port :7473
2022-07-23 08:15:49.905+0000 INFO  [API] No SSL certificate found, generating a self-signed certificate..
2022-07-23 08:15:50.133+0000 INFO  [API] Mounted discovery module at [/]
2022-07-23 08:15:50.159+0000 INFO  [API] Loaded server plugin "GremlinPlugin"
2022-07-23 08:15:50.160+0000 INFO  [API]   GraphDatabaseService.execute_script: execute a Gremlin script with 'g' set to the Neo4j2Graph and 'results' containing the results. Only results of one object type is supported.
2022-07-23 08:15:50.160+0000 INFO  [API] Mounted REST API at [/db/data/]
2022-07-23 08:15:50.162+0000 INFO  [API] Mounted management API at [/db/manage/]
2022-07-23 08:15:50.162+0000 INFO  [API] Mounted webadmin at [/webadmin]
2022-07-23 08:15:50.162+0000 INFO  [API] Mounted Neo4j Browser at [/browser]
2022-07-23 08:15:50.204+0000 INFO  [API] Mounting static content at [/webadmin] from [webadmin-html]
2022-07-23 08:15:50.243+0000 INFO  [API] Mounting static content at [/browser] from [browser]
16:15:50.245 [main] WARN  o.e.j.server.handler.ContextHandler - o.e.j.s.ServletContextHandler@21da484c{/,null,null} contextPath ends with /
16:15:50.245 [main] WARN  o.e.j.server.handler.ContextHandler - Empty contextPath
16:15:50.247 [main] INFO  org.eclipse.jetty.server.Server - jetty-9.0.5.v20130815
16:15:50.267 [main] INFO  o.e.j.server.handler.ContextHandler - Started o.e.j.s.h.MovedContextHandler@6d97768d{/,null,AVAILABLE}
16:15:50.340 [main] INFO  o.e.j.w.StandardDescriptorProcessor - NO JSP Support for /webadmin, did not find org.apache.jasper.servlet.JspServlet
16:15:50.349 [main] INFO  o.e.j.server.handler.ContextHandler - Started o.e.j.w.WebAppContext@660e8081{/webadmin,jar:file:/home/thicker/GNN/FIRST/neo4j/system/lib/neo4j-server-2.1.5-static-web.jar!/webadmin-html,AVAILABLE}
16:15:50.703 [main] INFO  o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@31621b95{/db/manage,null,AVAILABLE}
16:15:50.903 [main] INFO  o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@12fb3db8{/db/data,null,AVAILABLE}
16:15:50.917 [main] INFO  o.e.j.w.StandardDescriptorProcessor - NO JSP Support for /browser, did not find org.apache.jasper.servlet.JspServlet
16:15:50.918 [main] INFO  o.e.j.server.handler.ContextHandler - Started o.e.j.w.WebAppContext@3fe9713a{/browser,jar:file:/home/thicker/GNN/FIRST/neo4j/system/lib/neo4j-browser-2.1.5.jar!/browser,AVAILABLE}
16:15:51.097 [main] INFO  o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@21da484c{/,null,AVAILABLE}
16:15:51.105 [main] INFO  o.e.jetty.server.ServerConnector - Started ServerConnector@db18be0{HTTP/1.1}{0.0.0.0:7474}
16:15:51.497 [main] INFO  o.e.jetty.server.ServerConnector - Started ServerConnector@56a2b12b{SSL-HTTP/1.1}{0.0.0.0:7473}
2022-07-23 08:15:51.497+0000 INFO  [API] Server started on: http://0.0.0.0:7474/
2022-07-23 08:15:51.498+0000 INFO  [API] Remote interface ready and available at [http://0.0.0.0:7474/]

Then run the instruction “`neo4j start“ to display the following error messages

root@VM-12-7-ubuntu:~# neo4j start
WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual.
Using additional JVM arguments:  -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xms512m -Xmx10240m
Starting Neo4j Server...process [17130]... waiting for server to be ready.... Failed to start within 120 seconds.
Neo4j Server failed to start, please check the logs for details.
If startup is blocked on a long recovery, use '/home/thicker/GNN/FIRST/neo4j/bin/neo4j start-no-wait' to give the startup more time.

Follow the prompt and run the command ` ` ` neo4j start-no-wait “

Mybatis-Plus logical delete mapping error [How to Solve]

The error reports are as follows: has been unable to understand why there is a pile of garbled code in my SQL. It has always been thought that there is an error in my own usage or configuration

But I didn’t find any problems after consulting the MP manual

Until you suddenly wake up, it may be a configuration problem

Because I use application.properties but the manual use yml, there are certain format problems

Official website:

My:

Move the comment to a place other than the statement and start successfully

 

How to Solve args = parser.parse_args() error

args = parser.parse_args() error


Problem description

args = parser.parse_args() reports an error

import argparse

parser = argparse.ArgumentParser(prog='top', description='Show top lines from each file')
parser.add_argument('filenames', nargs='+')
parser.add_argument('-l', '--lines', type=int, default=10)
# args = parser.parse_args()
args, unknown = parser.parse_known_args() # Modified
print(args)

Solution:
Modify to args, unknown = parser.parse_known_args()

[Solved] Compile Error: undefined reference to `google::FlagRegisterer::FlagRegisterer

1. Problem description

Compilation error

CMakeFiles/run_mapping_offline.dir/run_mapping_offline.cc.o: In function `__static_initialization_and_destruction_0':
/home/wong/workspace_demo/packagetest_faster_lio_ws/src/***/***/app/run_mapping_offline.cc:16: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/home/wong/workspace_demo/packagetest_faster_lio_ws/src/***/***/app/run_mapping_offline.cc:17: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/home/wong/workspace_demo/***/src/***/***/app/run_mapping_offline.cc:18: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/home/wong/workspace_demo/***/src/***/***/app/run_mapping_offline.cc:19: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
collect2: error: ld returned 1 exit status
***/***/app/CMakeFiles/run_mapping_offline.dir/build.make:678: recipe for target '/home/wong/workspace_demo/***/devel/lib/faster_lio/run_mapping_offline' failed

2. Solution

Add the following line in CMakeLists.txt:

find_package(gflags REQUIRED)

This is our own solution. If you have any other better solutions, please leave a comment and let me know.

[Solved] Mybatis Error: CannotFindDataSourceException: dynamic-datasource can not find primary datasource

Problem background

When using mybatis, an error is reported that the master data source cannot be found:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: com.baomidou.dynamic.datasource.exception.CannotFindDataSourceException: dynamic-datasource can not find primary datasource
### The error may exist in com/lanran/transactional/dao/PaymentMapper.java (best guess)
### The error may involve com.lanran.transactional.dao.PaymentMapper.insertBatchSomeColumn
### The error occurred while executing an update
### Cause: com.baomidou.dynamic.datasource.exception.CannotFindDataSourceException: dynamic-datasource can not find primary datasource

Solution

1. Because the multi-source configuration dependency of mybatisplus is added, but the configuration file does not write the related configuration of multi-source, an error is reported

        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
            <version>3.5.0</version>
        </dependency>

Method 1: if you don’t use multi-source configuration, remove this dependency
Method 2:  application set multi-source configuration

server:
  port: 40001

spring:
  datasource:
    druid:
      stat-view-servlet:
        enabled: true
    dynamic:
      # Configure the global druid parameter, please configure as needed
      druid:
        initial-size: 5
        max-active: 8
        min-idle: 3
        max-wait: 1000
        validation-query: 'select 1'
      datasource:
        master:
          username: root
          password: 123456
          url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
          driver-class-name: com.mysql.cj.jdbc.Driver
        slave_1:
          username: root
          password: 123456
          url: jdbc:mysql://localhost:3306/test2?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
          driver-class-name: com.mysql.cj.jdbc.Driver

[Solved] Internal error occurred: failed calling webhook “validate.nginx.ingress.kubernetes.io”:

Error Message:

 

 

 

 

Solution:

enter this command as following:

[root@k8s-master01 ingress]# kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission
validatingwebhookconfiguration.admissionregistration.k8s.io “ingress-nginx-admission” deleted
[root@k8s-master01 ingress]# kubectl apply -f ingress1.yaml
ingress.networking.k8s.io/nginx-test created
[root@k8s-master01 ingress]#

[Solved] pytorch Load Error: “RuntimeError: Error(s) in loading state_dict for Sequential:”

RuntimeError: Error(s) in loading state_dict for Sequential:

This error is usually related to the use of nn.DataParallel for training

It means that the string in the model’s parameter key does not match the string in the key fetched by torch.load

Therefore, we just need to modify the dict obtained by torch.load to make it match.

 

Example

When I torch.save, the string in the parameter key is automatically prepended with ‘module.’

Therefore, after torch.load, we need to remove ‘module.

The method is as follows.

model = Model()
model_para_dict_temp = torch.load('xxx.pth')
model_para_dict = {}
for key_i in model_para_dict_temp.keys():
    model_para_dict[key_i[7:]] = model_para_dict_temp[key_i]  # Delete 'module.'
del model_para_dict_temp
model.load_state_dict(model_para_dict)

[Solved] error TS2584: Cannot find name ‘console’. Do you need to change your target library? Try changing the ‘lib’ compiler option to include ‘dom’.

When running a ts file using ts-node in the terminal, I get an error.

bug to reproduce

Solution

// Install the runtime library of the TypeScript helper, including all TypeScript helper functions 
npm install -D tslib @types/node  

reason

console is not part of the EcmaScript standard. The console in the DOM is in the browser environment and belongs to the browser BOM API. The console in Node is an API in Node.js, which is defined by nodejs itself. Although the two have the same function, they are not the same thing.

[Solved] Error: Django is not importable in this environment

1. Question: It shows that there is no django module > download one, and prompts that it has been installed > prompts that the django module cannot be imported after startup

 

 

2. Solutions:

Looking at the interpreter of the project found that it is python37

The default pip is the python36 pip added to the environment variable

So you need to add the pip path of the python37 interpreter to the environment variable, after restarting Pycharm

Install django with pip3.7 install django==xxx.