Category Archives: Error

Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id ‘com.android.internal.application’]

Two Error Messages:

Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'com.android.internal.application']

and

Caused by: org.gradle.api.tasks.StopExecutionException: Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.

 

Solution:

Add the following line in the gradle.properties file of your project

android.overridePathCheck=true

How to Solve Rancher Install Longhorn Error

1. Rancher Install Longhorn

When you are installing Longhorn, longhorn-driver-deployerand longhorn-managerfailing to start successfully.

Search in the app storeLonghorn

image-20220222110610953

Others keep the default, just startclick

image-20220222110716492

 

2. Solution

View longhorn-managerone of the Pod logs as follows:

2022/02/22 02:45:53 proto: duplicate proto type registered: VersionResponse 
time="2022-02-22T02:45:53Z" level=error msg="Failed environment check, please make sure you have iscsiadm/open-iscsi installed on the host" 
time="2022-02-22T02:45:53Z" level=fatal msg="Error starting manager: Environment check failed: Failed to execute: nsenter [--mount=/host/proc/1/ns/mnt --net=/host/proc/1/ns/net iscsiadm --version], output , stderr, nsenter: failed to execute iscsiadm: No such file or directory\n, error exit status 127" 

Snipaste_2022-02-22_10-56-54

The missing iscsiadmcommand is found through the log error report. You can install the command according to your system. The relevant information queried is as follows:

https://github.com/longhorn/longhorn/issues/1493

https://longhorn.io/docs/0.8.0/install/requirements/

image-20220222111946811

My system is CentOS and each node needs to install:

[root@k8s-master01 ~]# yum install iscsi-initiator-utils

After installation, select the Pod that cannot be successfully started and redeploy it.

image-20220222112618218

Axios gets the upload progress error: xhr.upload.addEventListener is not a function

Error problem

Vue:xhr.upload.addEventListener is not a function

This problem is caused by mockjs changing the XMLHttpRequest object in Axios

According to the Axios source code, l is an XMLHttpRequest object

Mockjs changed the l variable from XMLHttpRequest object to MockXMLHttpRequest object

Therefore, l.upload is an empty object, which has no addEventListener method, so an error is reported

Solution:

Method 1

In the project node_modules/mockjs/dist/mock.js file, in the place where mockjs determines the conditions (search) -> / If no matching data template is found, then the native XHR is used to send the request. / is usually the location of line 8308, add the code

MockXMLHttpRequest.prototype.upload = xhr.upload;

Add a native xhr.upload method to the MockXMLHttpRequest object.

Method 2

Add the code to the project node_modules/mockjs/src/xhr/xhr.jsprototype usually on line 216

MockXMLHttpRequest.prototype.upload = xhr.upload;

This method needs to be recompiled to take effect

[Solved] scheduler Error: maximum number of running instances reached

Let’s look at a demo to reproduce this error:

from apscheduler.schedulers.blocking import BlockingScheduler
import time
from threading import Timer
from datetime import datetime

def test1(who):
    print("hello")
    print(datetime.now())

    time.sleep(20)
    print("this is %s" %who)
    print(datetime.now())


def scheduler_test():
    scheduler = BlockingScheduler()

    i=0
    while i<1:
        scheduler.add_job(test1, 'interval', seconds=10, id='test_job'+str(i), args=["xiao"+str(i)],next_run_time=datetime.now())
        i=i+1
        print("mmmmmmm")
    scheduler.start()

def timer1(who):
    who_tmp=who
    test1(who)
    Timer(20, timer_test,
          kwargs={'who': who_tmp}).start()

def timer_test():
    i=0
    while i<3:
        timer1("xiao"+str(i))


if __name__ == '__main__':
    #timer_test()
    scheduler_test()
    print("when")

You can see that the interval length is less than the execution length of the job, it will trigger this error maximum number of running instances reached

There are two solutions, 1, modify the interval duration of the add_job interface to make it greater than the execution duration of the job 2, add a parameter to the add_job interface, such as max_instances=20, to adjust the number of concurrency allowed.

[Solved] hive service hiveserver2 Error: GC overhead limit exceeded

1. Causes

Hive — service hiverver2 reports an error, which makes the hiverver2 service unusable

 

2. Error information

Exception in thread “HiveServer2-Handler-Pool: Thread-556” java.lang.OutOfMemoryError: GC overhead limit exceeded

 

3. Reasons for error reporting

JVM started by hive shell script is out of memory

 

4. Solution

cp hive-env.sh.template hive-env.sh
vi hive-env.sh
Release export HADOOP_HEAPSIZE=1024 (if you still get an error, make the memory bigger)

[Solved] android.content.res.Resources$NotFoundException: String resource ID #0xffffff85

java.lang.RuntimeException: Unable to start activity ComponentInfo:android.content.res.Resources$NotFoundException: String resource ID #0xffffff85

Reason: It usually happens when the parameter int resId is wrong, you assign String to the int resId, so the compiler can’t find the correct resource and report an error.

For example, I set the bill amount to int type

But in setText list.get(i).getNum() is int type, so the error is reported

Solution 1: change the parameter to String type

Solution 2: use String.valueOf(list.get(i).getNum())

[Solved] JMeter Generate the report of html Error

Error generating the report: org. apache. jmeter. report. dashboard. GenerationException: Error while processing samples: Consumer failed with message :Consumer failed with message :Consumer failed with message :Consumer failed with message :Begin size 0 is not equal to fixed size 5

The jdk I installed at first was jdk-17_linux-x64_bin.rpm which is jdk 17. When I generated the html report from the jtl file, I got the above error.

Later uninstalled the jdk. I reinstalled jdk1.8, jdk-8u202-linux-x64.rpm, and it generated it normally.

The uninstallation method of rpm is attached:

1. Check the version of JDK:

rpm -qa | grep jdk

2. Uninstall the JKD version installed by rpm

rpm -e –nodeps jdk1.8-1.8.0_202-fcs.x86_64

The conclusion is: it should be the compatibility problem of version 17 JDK. Try to change the JDK.

[Solved] android.content.ActivityNotFoundException: Unable to find explicit activity class

android.content.ActivityNotFoundException: Unable to find explicit activity class {com.x210.communication/com.x210.communication.ShowActivity};have you declared this activity in your AndroidManifest.xml?

The root cause of the error is that the Activity is not registered in the manifest file.

Solution: Open the manifest file AndroidManifest.xml

Check whether the activity is registered as shown in the picture

If not, register it, and if so, change the code of android:name=, and fill in the path of package com.example.xml in front of it. Fill in the path of package com.example.jizhangben1 in front of it

 

This should be written clearly package name to register it can be successful, try “ctrl + left click” click on those blue Activity name can jump, run a success also on the line

If it does not work

Check whether the button controlling the jump to this interface is set

 Button btnadd = (Button)findViewById(R.id.btn_add);

   btnadd.setOnClickListener(this);

[Solved] UserInfo()’ in ‘com.example.gmall.cart.pojo.UserInfo’ cannot be applied to ‘(long, java.lang.String)’

Create a new POJO class

@Data
public class UserInfo {
    private Long userId;
    private String userKey;
}

Use the data annotation in lombook, but make an error when using it

UserInfo()’ in ‘com.example.gmall.cart.pojo.UserInfo’ cannot be applied to ‘(long, java.lang.String)’

Reason: POJO class only uses Data annotation and lacks construction method,

Solution: use annotation @AllArgsConstructor @NoArgsConstructor  or construct directly

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo {
    private Long userId;
    private String userKey;
}

[Solved] no such column: id (code 1): , while compiling: DELETE FROM zhangdan WHERE id=?

Possible reason one: simply put, the name of the id column is wrongly written, can not find the id column

Double-check your delete in the sql statement id has not been written wrong, there may be a time when you set up a table may be different from the current one, the project with the former table, for example, I started to build a table with _id, and then change the code too many times, the statement to build the table also changed, but the project with the beginning of the table, so the sql statement still need to use _id

Possible reason 2: The database version was not increased, which led to this error

Add the following code to your MySQLHelper.java, which is used to upgrade the database

  @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }
}