Category Archives: Error

[Solved] Appium Error: InvalidArgumentException: Message: invalid argument: invalid locator

Appium Error:
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid locator

 

Solution: Add the following two parameters when you create a driver.

desired_caps[‘chromeOptions’] = {‘w3c’:False}
desired_caps[‘showChromedriverLog’] = True

 

Refer:
Fail to locate an web element using “findElement” on Android 9 using Appium 1.15.0 · Issue #13306 · appium/appium · GitHub

[Solved] ANTRL Compile HiveLexer.g File Error: syntax error: antlr: NoViableAltException(@[])

Project scenario:

The need for programming to obtain data pedigrees is not common for data warehouses, and separate data pedigree work is only necessary when the scale of data reaches a significant level, or the number of reports with complex data production relationships increases to a significant level.
Until scale is reached, manual identification and management is more cost effective.

antlr is the open source syntax parser that automatically generates syntax trees based on input and displays them visually. antlr-Another Tool for Language Recognition, formerly PCCTS, provides a syntax tree for languages including Java, C++, and C# by description to automatically construct a custom language recognizer (recognizer), compiler (parser) and interpreter (translator) framework. ANTLR is available in v2 v3 v4, with most of the Chinese documentation being in v2 and the hive 1.1.0 version mentioning antlr 3.4 in the comments. antlr combines the above by allowing us to define lexical rules for recognizing character streams and syntactic parser rules for interpreting Token streams. ANTLR will then automatically generate the appropriate lexical/syntactic parser based on the syntax file provided by the user. The user can use them to compile the input text and convert it into other forms (e.g. AST-Abstract Syntax Tree).

Use ANTLR version 3.5.2 to parse Hivesql’s source code grammar file for HiveLexer.g, and place the code:

@lexer::header {
package org.apache.hadoop.hive.ql.parse

import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.hive.conf.HiveConf
}

@lexer::members {
  private Configuration hiveConf
  
  public void setHiveConf(Configuration hiveConf) {
    this.hiveConf = hiveConf
  }
  
  protected boolean allowQuotedId() {
    if(hiveConf == null){
      return false
    }
    String supportedQIds = HiveConf.getVar(hiveConf, HiveConf.ConfVars.HIVE_QUOTEDID_SUPPORT)
    return !"none".equals(supportedQIds)
  }
}

This paragraph needs to be annotated so that Java compiled with ANTLR does not contain this package.


Problem description

After this paragraph is annotated with/* * /, it is still compiled and an error is found:

[10:58:10] error(100): HiveLexer.g:42:1: syntax error: antlr: NoViableAltException(9@[])
[10:58:10] error(100): HiveLexer.g:42:2: syntax error: antlr: NoViableAltException(49@[])
[10:58:10] error(100): HiveLexer.g:42:7: syntax error: antlr: MissingTokenException(inserted [@-1,0:0='<missing ACTION>',<4>,42:6] at :)
[10:58:10] error(100): HiveLexer.g:42:8: syntax error: antlr: NoViableAltException(22@[])
[10:58:10] error(100): HiveLexer.g:42:9: syntax error: antlr: NoViableAltException(80@[])
[10:58:10] error(100): HiveLexer.g:42:9: syntax error: antlr: NoViableAltException(80@[])
[10:58:10] error(100): HiveLexer.g:47:1: syntax error: antlr: MissingTokenException(inserted [@-1,0:0='<missing SEMI>',<82>,47:0] at KW_TRUE)

Cause analysis:

Query data discovery

‘; ‘ is a terminator in comment and so error occurred


Solution:

Delete all the original annotation documents or delete them; Delete it.

Problem solved.

VS Open the UI file of QT Crash and Report Error [How to Solve]

Trigger behavior: open the project with VS, click the UI file, and the QT designer will flashback after a few seconds

Error reporting content:

Solution:

Method 1: right click

After QT designer is opened and before flashing back, right-click

Method 2: open QT designer and open the nearest window

Extension -> qt-> qt vs tools-> launch qt designer

Method 3: customize the opening method

Right-click the UI file, select the opening method, select QT designer, click add, and point to the designer corresponding to the compiler under the QT installation location

Find the QT installation location, find the corresponding compiler 1.mingw2.msvc, and click OK.

[Solved] Postman Error: Error:‌ NETERR:‌ getaddrinfo ENOTFOUND localhost

1. Error report description

I created a new Monitor using postman here, but an error was reported when running

Since the mailbox is used when creating a new one, the mailbox also receives an error message

The key points are: error: neterr: getaddrinfo enotfound localhost

The reason may be that the host file localhost is not bound to 127.0.0.1

2. Solution

Under Windows, you can see the host file through the C:\Windows\System32\drivers\etc directory, copy it to the desktop, edit it with Notepad, write 127.0.0.1 localhost, and then overwrite the previous host file.

Replace the original file with the modified hosts

At this time, close the postman and try again, but it still doesn’t work

Let’s go to the next step and click File–>Settings

Turn off SSL certificate verification

Select postman — settings — proxy — proxy server to enter the IP and port you need to debug (the third figure) is also a successful step!!!


be careful!!!

Restart postman after setting

[Solved] git Error: error: Your local changes to the following files would be overwritten by merge

A git pull error, error: Your local changes to the following files would be overwritten by merge, occurs because changes to the local branch are not saved when git pulls.

There are two general solutions. There is also a special case, that is, the change of permissions such as file reading and writing.

Method 1: discard local changes

If the local modification is not important, you can directly discard the local modification:

# Discard all local uncommitted changes
git checkout .

Some local files are newly added but not Add, the status in git status is untrack , and they need to be deleted through git clean

# First check what files will be deleted
git clean -nxdf

# Make sure the files that will be deleted are correct, then execute the delete
git clean -xdf

# You can also delete files one by one, for example, delete file xxx
git clean -f xxx

Or

Direct execution:

git reset --hard
git pull

Note: discarding local files is a dangerous operation and must be considered before deleting.

Method 2: temporarily store to the stack area

If local modifications are important. If it needs to be used later, the current modification can be temporarily stored in the stack area:

# Staging to the stack area
git stash

# View stash contents
git stash list

To use local modification, apply the stash content to the local branch:

git stash pop

The contents in stash are popped up. If multiple temporary contents are saved, the pop-up order is first in and last out (stack).

If you do not want to pop up the content, but still apply the stash content to the local branch:

git stash apply

In this way, the contents in stash will not be ejected.

In addition, you can manually delete the content in stash

# Delete the contents of a specified stash, the name of which can be obtained from the git stash list
git stash drop xxx
# Delete all stash content
git stash clear

Generally:

 git stash
 git commit
 git stash pop

Git stash: back up the contents of the current workspace, read the relevant contents from the latest submission, and ensure that the workspace is consistent with the last submission. At the same time, save the current workspace content to the GIT stack
git stash Pop: read the last saved content from the GIT stack and recover the relevant content of the workspace. Since there may be multiple stash contents, it is managed by stack. Pop will read the contents from the latest stash and recover them
git stack list: displays all backups in the GIT stack. You can use this list to decide where to recover
git stack clear: clear the GIT stack. At this time, graphical tools such as gitg will be used to find out which nodes of the original stash have disappeared.

Note: merge after using git stash to temporarily store content, and then git stash pop, branch conflict may be reported. At this time, you can create a new branch locally and recover the stash content on the new branch.

exceptional case:

Git prompts that the file has been modified, but the actual content has not been modified. The reason is that all git libraries will ignore the change of FileMode.

Git diff prompts the change of FileMode, as follows:

git diff xxx
diff --git a/xxx b/xxx
old mode 100755
new mode 100644

Solution:

#Terminal Execution 
git config --add core.filemode false

[Solved] Mybatis Error: Resources.getResourceAsStream(resource) cannot find the method

Problem Description: mybatisdemo.java
when loading the core configuration file of mybatis and obtaining SqlSessionFactory, the getResourceAsStream() method is marked in red, and the idea indicates that there is no such method.

1, Load the core configuration file of mybatis and get the SqlSessionFactory
    String resource = "mybatis-config.xml";
    InputStream inputStream = Resources.getResourceAsStream(resource);
    SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
    
Error:Cannot resolve method ‘getResourceAsStream‘ in ‘Resources‘

Solution: import import.org.apache.ibatis.io.Resources

~~

If the error is still reported, it will display: org.apache.ibatis.io does not exist, check the setting information of Maven.

1. First, open the installation root directory of Maven and find settings.xml

Set up the storage repository in settings.xml:
<localRepository>E:\maven\apache-maven-3.6.1\mvn_repo</localRepository>

2. Enter the IDE and make settings
File-Settings-Build,Execution,Depolyment-BuildTools-Maven
take the following configuration as an example:

At this time, the problem was solved!

[Solved] kafka Startup Error: ERROR Shutdown broker because all log dirs in /…/kafka/logs have failed (kafka.log.LogManager)

Error when starting kafka

 

The problem occurs in the logs file

ERROR Shutdown broker because all log dirs failed: It means that all log files cannot be used, which may be a permission problem

Then enter the logs to view

 

Currently our user is hadoop, and the log files belong to the root user, so it can be solved by modifying the permissions

sudo chown hadoop.hadoop logs -R

 

You can see that the file ownership has been changed to hadoop

try to start kafka

successfully started

[Solved] No tf data. Actual error: Fixed Frame [world] does not exist

1. No tf data. Actual error: Fixed Frame [world] does not exist

When using rviz to view relevant coordinate information, you may encounter No tf data. Actual error: Fixed Frame [world] does not exist, the main reason is that there is no world coordinate system in the TF tree. The solution is to let rviz know where the world coordinate system is. You can manually publish using the following command

rosrun tf static_transform_publisher 0 0 0 0 0 0 1 map world 5

2. nvalid argument “/world” passed to canTransform argument source_frame in tf2 frame_ids cannot start with a ‘/’ like

After the first problem is solved, another problem may appear Invalid argument "/world" passed to canTransform argument source_frame in tf2 frame_ids cannot start with a '/' like: as shown in the figure:

this problem is mainly because “/ world” is used in the release code and “world” is used in our release It may be good to recompile the code from “/world” to “world”

[Solved] Halcon & C# Error: HalconDotNet.HOperatorException:“HALCON error #5190: Invalid window parameter in op

Error occurred when calling HSmartWindowControlWPF control in C# WPF

HalconDotNet.HOperatorException:“HALCON error #5190: Invalid window parameter in operator set_window_param”

 


The main reason is that the required dynamic library files are missing.

Solution:
From the installation directory
C:\Program Files\MVTec\HALCON-xxxx-Progress\bin\x64-win64
Find the hcanvas.dll file and put it in your own runtime directory.

[Solved] appium Error: An unknown server-side error occurred while processing the command

Error Messages:

UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up

Solution:
Close/uninstall the service

adb uninstall io.appium.settings

adb uninstall io.appium.uiautomator2.server.test
     
adb uninstall io.appium.uiautomator2.server  

Re execution, automatic installation

[Solved] Camera Calibration Error: ErrorMessage: Image size does not match the measurement in camera parameters

1. problem description

ErrorMessage: Image size does not match the measurement in camera parameters

In the process of Halcon camera calibration, the above error is reported when finding_calib_object to find the calibration plate model and profile after generating the preliminary camera Camera.

2. Solutions and error causes

The problem is that when creating the startCamera parameter, the size of the original image is used, and when finding_calib_object information, the center rotation of the image is rotated, resulting in inconsistent size information.