Author Archives: Robins

[Solved] swagger Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is java.lang.NullP

Null pointer exception when adding swagger dependency to the project

Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException

The swagger and UI I use here are both version 2.9.2, but my springboot is version 2.6

Springfox uses path matching based on AntPathMatcher, while spring boot 2.6.x uses PathPatternMatcher. The two solutions are as follows:

1. Modify the version of springboot and use the earlier version to solve this problem;

2. Add in the configuration file

spring.mvc.pathmatch.matching-strategy=ant_path_matcher

​

 

[Solved] UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring it

UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring it

After installing anaconda, there will report an error when you import some module in ipython:

UserWarning: mkl-service package failed to import, therefore Intel® MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package

 

Solution:
First configure three environment variables, one is missing
E:\Anaconda3
E:\Anaconda3\Scripts
E:\Anaconda3\Library\bin
Put E:\Anaconda3\Library\bin under
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
Copy the above two files to
E:\Anaconda3\DLLs
OK, you can restart pycharm and it will work

[Solved] wxauto error: ImportError: DLL load failed while importing win32gui: Can’t find the specified program

Background

Using wxauto to develop wechat robot, there was an error when running the program in Pycharm

Error prompt

Traceback (most recent call last):
  File "D:\Project\wechatBot\test.py", line 2, in <module>
    from wxauto import WeChat
  File "C:\Users\pokeu\anaconda3\envs\wechatbot\lib\site-packages\wxauto\__init__.py", line 2, in <module>
    from .wxauto import WxParam, WxUtils, WeChat, COPYDICT
  File "C:\Users\pokeu\anaconda3\envs\wechatbot\lib\site-packages\wxauto\wxauto.py", line 10, in <module>
    import win32gui, win32con
ImportError: DLL load failed while importing win32gui: Can't find the specified program.

Solution:

Check if the win32gui.pyd file exists in the C:\Users\username\anaconda3\envs\wechatbot\Lib\site-packages\win32 directory

If not, run pip install pywin32 to install it.

Add C:\Users\username\anaconda3\envs\wechatbot\Lib\site-packages\pywin32_system32 to the system environment variable.

Notes.
a. User name Replace with your own user name.
b. The first half of C:\Users\username\anaconda3 is the installation path of anaconda, replace it with your own.
c. \envs\wechatbot is the path of the new environment I created (wechatbot), replace it with your own environment, or ignore it if you didn’t create it, and just find \Lib\site-packages\win32.

In the original import … import the following library before the original import …: import pywintypes, e.g.

import pywintypes
#import pythoncom # Uncomment this if some other DLL load will fail
from wxauto import WeChat
import time, random

Now run the program again, and there should be no error.

nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied) This is because port 80 can only be started by the root user, so just let the non-root user use port 80.

The solution is as follows:

# Set CAP_NET_BIND_SERVICE capability for the specified program
$ setcap cap_net_bind_service=+eip /path/to/application
The tests are as follows:
# sudo setcap cap_net_bind_service=+eip /usr/local/nginx/sbin/nginx

It’s OK to start nginx again.

/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf

[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] JAVA fx Error: java.lang.instrument ASSERTION FAILED ***: “!errorOutstanding“ with message transform

java fx error: java.lang.instrument ASSERTION FAILED ***: “!errorOutstanding“ with message transform

Problem description

Errors encountered in Java FX

In fxml, the controller is bound by fx:controller.
FXMLLoader.load is used in the controller of control to get the fxml file

An error is reported

java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent

Cause analysis:

The reason for the error is that there is a cycle, similar to the cycle dependency problem

as a result of:

a.fxml depends on the controller AController.java
But AController.java will load this fxml again


Solution:

Remove FXMLLoader.load from the controller or remove fx:controller from fxml

 

[Solved] Failed to execute ‘getRangeAt‘ on ‘Selection‘: 0 is not a valid index.“

Failed to execute ‘getRangeAt‘ on ‘Selection‘: 0 is not a valid index.“

const sel = window.getSelection()
range = sel.getRangeAt(0)

The following error message appears when getting the object in the text area selected by the mouse

Solution:

const sel = window.getSelection()
for (let i = 0; i < sel.rangCount; i++) {
    range[i] = sel.getRangeAt(i)
}

[Solved] VSCode package Error: Command failed: npm list –production –parseable –depth=99999 –loglevel=error

After VSCode package, there is an error report: command failed: NPM list –production –parseable –depth=99999 –loglevel=error appears. missing: vsce@^2.10.0, required by [email protected]

Note: this error pops up when I try to package the vscode plug-in

I found that many situations may lead to this error Command failed: npm list --production --parseable --depth=99999 --loglevel=error. Please pay attention.

reason

After some troubleshooting, I found that the reason I got this error was because I started installing the vsce package in the current location, and then I decided that it was wrong and changed it to a global installation. Then, instead of uninstalling vsce from the current location, I just deleted the node_modules folder. The error occurred because the vsce package command was not executed correctly because it was not uninstalled and then deleted.

 

Solution:

Reinstall the vsce package at the current location, npm install vsce,

Use npm uninstall vsce to uninstall.

Finally, you can choose to delete node_modules folder.

 

[Solved] npm Error: error:0308010C:digital envelope routines::unsupported

error:0308010C:digital envelope routines::unsupported
This error occurs because of the recent release of OpenSSL3.0 in node.js V17 version, and OpenSSL3.0 adds strict limits on allowed algorithms and key sizes, which may affect the ecosystem cause some impact.

Some applications that can run normally before node.js V17, but in V17 and above versions may throw the following exceptions:

node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports.__webpack_modules__.57442.module.exports (/Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:135907:62)
    at NormalModule._initBuildHash (/Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:109317:16)
    to handleParseError ( /Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/ 4 /bundle4.js: 109371 : 10 )
    at /Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:109403:5
    at /Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:109258:12
    at /Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:61157:3
    at iterateNormalLoaders (/Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:60998:10)
    at Array.<anonymous> (/Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:60989:4) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.7.0
✨  Done in 1.92s.

It is said that this can be temporarily fixed by running the following command line

export NODE_OPTIONS=--openssl-legacy-provider

But the current test does not work, so I reinstalled node-v16.12.0, and npm also installed the corresponding version

Refer to https://nodejs.org/en/download/releases/ for the correspondence between node and npm versions

[Solved] kafka Error: java.net.UnknownHostException: ls-bptysztw

kafka connect error:

java.net.UnknownHostException: ls-bptysztw

2022-07-20 15:48:28.701  INFO 15924 --- [ntainer#0-0-C-1] org.apache.kafka.clients.Metadata        : [Consumer clientId=consumer-abc-1, groupId=abc] Cluster ID: LFbHxG8qSSu7PyPKXoDD4g
2022-07-20 15:48:28.703  INFO 15924 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-abc-1, groupId=abc] Discovered group coordinator ls-bptysztw:9092 (id: 2147483647 rack: null)
2022-07-20 15:48:30.990  WARN 15924 --- [ntainer#0-0-C-1] org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-abc-1, groupId=abc] Error connecting to node ls-bptysztw:9092 (id: 2147483647 rack: null)

java.net.UnknownHostException: ls-bptysztw
	at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_144]
	at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928) ~[na:1.8.0_144]
	at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323) ~[na:1.8.0_144]
	at java.net.InetAddress.getAllByName0(InetAddress.java:1276) ~[na:1.8.0_144]
	at java.net.InetAddress.getAllByName(InetAddress.java:1192) ~[na:1.8.0_144]
	at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[na:1.8.0_144]
	at org.apache.kafka.clients.DefaultHostResolver.resolve(DefaultHostResolver.java:27) ~[kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.ClientUtils.resolve(ClientUtils.java:110) ~[kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.ClusterConnectionStates$NodeConnectionState.currentAddress(ClusterConnectionStates.java:511) ~[kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.ClusterConnectionStates$NodeConnectionState.access$200(ClusterConnectionStates.java:468) ~[kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.ClusterConnectionStates.currentAddress(ClusterConnectionStates.java:173) ~[kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.NetworkClient.initiateConnect(NetworkClient.java:988) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.NetworkClient.ready(NetworkClient.java:301) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.tryConnect(ConsumerNetworkClient.java:575) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.AbstractCoordinator$FindCoordinatorResponseHandler.onSuccess(AbstractCoordinator.java:854) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.AbstractCoordinator$FindCoordinatorResponseHandler.onSuccess(AbstractCoordinator.java:830) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.RequestFuture$1.onSuccess(RequestFuture.java:206) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.RequestFuture.fireSuccess(RequestFuture.java:169) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.RequestFuture.complete(RequestFuture.java:129) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient$RequestFutureCompletionHandler.fireCompletion(ConsumerNetworkClient.java:602) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.firePendingCompletedRequests(ConsumerNetworkClient.java:412) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:297) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:236) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:215) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.AbstractCoordinator.ensureCoordinatorReady(AbstractCoordinator.java:246) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.coordinatorUnknownAndUnready(ConsumerCoordinator.java:459) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.poll(ConsumerCoordinator.java:487) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.KafkaConsumer.updateAssignmentMetadataIfNeeded(KafkaConsumer.java:1262) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1231) [kafka-clients-3.1.1.jar:na]
	at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1211) [kafka-clients-3.1.1.jar:na]
	at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.pollConsumer(KafkaMessageListenerContainer.java:1522) [spring-kafka-2.8.7.jar:2.8.7]
	at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doPoll(KafkaMessageListenerContainer.java:1512) [spring-kafka-2.8.7.jar:2.8.7]
	at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.pollAndInvoke(KafkaMessageListenerContainer.java:1340) [spring-kafka-2.8.7.jar:2.8.7]
	at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.run(KafkaMessageListenerContainer.java:1252) [spring-kafka-2.8.7.jar:2.8.7]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_144]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_144]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]

analysis

It can be found from the log that ls-bptysztw:9092 is the address information of the host. Because the host cannot recognize the IP corresponding to ls-bptysztw, which leads to an unknownHost exception. Therefore, as long as the host is configured to point to the correct IP, this error will be solved.

Solution:

Configure the C:\Windows\System32\drivers\etc\hosts file

123.123.123.123       ls-bptysztw

[Solved] vueCli 4.x Upgrade to 5.x Error: Progress Plugin Invalid Options

Running the compile command after upgrading vueCli 4.x to 5.x may result in the following error:

ERROR  ValidationError: Progress Plugin Invalid Options
 
        options should NOT have additional properties
        options should NOT have additional properties
        options should NOT have additional properties
        options should pass "instanceof" keyword validation
        options should match exactly one schema in oneOf

This may be caused by the inconsistency between the locally installed version of webpack and the version of vue-cli.

Solution:

1. Check if the webpack version in node_modules is also upgraded to version 5.x. If not, upgrade to version 5.x.

2. Check if the devServer in vue.config.js has overlay configuration, this configuration will be incompatible in vue-cli 5.x version, you have to remove it, otherwise it will also report an error when running

3. delete the wrong node_modules and package-lock.json

4. Clear npm cache: npm cache clean –force

5. reinstall the dependencies: npm install