Tag Archives: development language

[Solved] com.highgo.jdbc.util.PSQLException:bad value for long

environment
system platform: Galaxy Kirin u system (CPU Feiteng) 4
version: 4.3.4.5
symptom
application error:

com.highgo.jdbc.util.PSQLException:bad value for long:{"w":1341,"h":700,"widgets":[{"id":1,"c":1,"r":1,"x":24,"y":27},{"id":2,"c":25,"r":1,"x":51,"y":54},{"id":3,"c":25,"r":55,"x":51,"y":32},{"id":4,"c":1,"r":28,"x":24,"y":27},{"id":5,"c":76,"r":1,"x":25,"y":26},{"id":6,"c":76,"r":55,"x":25,"y":32},{"id":7,"c":76,"r":27,"x":25,"y":28},{"id":8,"c":1,"r":55,"x":24,"y":32}]}

Cause of the problem
MyBatis in the query for select mapping, the return type can be used resultTy, investigation and analysis found that the customer’s program to return the field type is longvarchar, so take the jar package within the tolong method, causing errors.

Solution
Modify the return field type longvarchar to varchar in the program.

Error code

com.highgo.jdbc.util.PSQLException:bad value for long

Springboot thymeleaf Error: Exception processing template “table/dynamic_table”: Error resolving template [common]…

1. Error reporting:

[THYMELEAF][http-nio-8080-exec-3] Exception processing template "table/dynamic_table": Error resolving template [common], template might not exist or might not be accessible by any of the configured Template Resolvers (template: "table/dynamic_table" - line 17, col 10)

2. Occurrence

An error is reported when thymeleaf introduces a public page

3. Reasons for error reporting

Original code:

<div th:replace="common :: #leftmenu"></div>

Error report caused by not adding a path

After modification:

<div th:replace="table/common :: #leftmenu"></div>

[Solved] igb Compile Error: igb_main.c:10044:7: error: implicit declaration of function ‘isdigit’

Recently, the IGB compiler driver found this problem:

[email protected]:~/igb/igb-5.7.2/src$ make
#@+ echo "*** The target kernel has CONFIG_MODULE_SIG_ALL enabled, but" ; echo "*** the signing key cannot be found. Module signing has been" ; echo "*** disabled for this build." ; make  ccflags-y="" -C "/lib/modules/4.15.0-142-generic/build" CONFIG_IGB=m CONFIG_MODULE_SIG=n CONFIG_MODULE_SIG_ALL= M="/home/zacha/igb/igb-5.7.2/src"   modules  
make -C /home/zacha/yulong810/kernel M=/home/zacha/igb/igb-5.7.2/src CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm
make[1]: Entering directory '/home/zacha/yulong810/kernel'
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_main.o
/home/zacha/igb/igb-5.7.2/src/igb_main.c: In function ‘igb_get_os_driver_version’:
/home/zacha/igb/igb-5.7.2/src/igb_main.c:10044:7: error: implicit declaration of function ‘isdigit’ [-Werror=implicit-function-declaration]
   if(!isdigit(*c) && *c != '.')
       ^~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:303: recipe for target '/home/zacha/igb/igb-5.7.2/src/igb_main.o' failed
make[2]: *** [/home/zacha/igb/igb-5.7.2/src/igb_main.o] Error 1
Makefile:1519: recipe for target '_module_/home/zacha/igb/igb-5.7.2/src' failed
make[1]: *** [_module_/home/zacha/igb/igb-5.7.2/src] Error 2
make[1]: Leaving directory '/home/zacha/yulong810/kernel'
Makefile:88: recipe for target 'default' failed
make: *** [default] Error 2

There are also solutions online:
https://github.com/geerlingguy/raspberry-pi-pcie-devices/issues/3

Solution:

Add #include <linux/ctype.h> inigb)main.c
then compile and generate IGB.ko

[email protected]:~/igb/igb-5.7.2/src$ make
#@+ echo "*** The target kernel has CONFIG_MODULE_SIG_ALL enabled, but" ; echo "*** the signing key cannot be found. Module signing has been" ; echo "*** disabled for this build." ; make  ccflags-y="" -C "/lib/modules/4.15.0-142-generic/build" CONFIG_IGB=m CONFIG_MODULE_SIG=n CONFIG_MODULE_SIG_ALL= M="/home/zacha/igb/igb-5.7.2/src"   modules  
make -C /home/zacha/yulong810/kernel M=/home/zacha/igb/igb-5.7.2/src CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm
make[1]: Entering directory '/home/zacha/yulong810/kernel'
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_main.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_api.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_ethtool.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_hwmon.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_mbx.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_mac.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_manage.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_nvm.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_param.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_phy.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_procfs.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_vmdq.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_82575.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_i210.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_debugfs.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_ptp.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/kcompat.o
  LD [M]  /home/zacha/igb/igb-5.7.2/src/igb.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/zacha/igb/igb-5.7.2/src/igb.mod.o
  LD [M]  /home/zacha/igb/igb-5.7.2/src/igb.ko
make[1]: Leaving directory '/home/zacha/yulong810/kernel'

[Solved] Shell loop execute error: syntax error: bad for loop variable

#!/bin/bash

for ((i = 10 ; i>=0 ; i--))
do
	echo $i
done

Syntax error: bad for loop variable

The reason is that since Ubuntu 6.10, Ubuntu has replaced the previous default bash shell with dash shell; It shows that the/bin/sh link reverses/bin/dash instead of the traditional/bin/bash.

Question 1: why #/ Bin/bash doesn’t work?

./execution will read #/ Bin/bash specifies the shell parser, and the script needs execution permission

Executing with SH will not read #/ Bin/bash, which is equivalent to executing the/bin/sh shell script and passing it in as a parameter. The script does not need execution permission, but only reading permission

Solution 1:

Execute sudo dpkg reconfigure dash and select No

Solution 2:

Modify cycle


for i in `seq 1 10`                                                                                                
do                                                                                                               
        echo $i                                                                                                  
done                                                                                                             
         
OR
                                                                                                        
for i in {0..10}                                                                                                 
do                                                                                                               
        echo $i                                                                                                  
done  

BlazingSQL Error: AttributeError: module ‘cio‘ has no attribute ‘RunQueryError‘

When using blazingsql, the following error was encountered:

Exception:
java.lang.IllegalStateException: Unable to instantiate java compiler
at org.apache.calcite.rel.metadata.JaninoRelMetadataProvider.compile(JaninoRelMetadataProvider.java:433)
at org.apache.calcite.rel.metadata.JaninoRelMetadataProvider.load3(JaninoRelMetadataProvider.java:374)
at org.apache.calcite.rel.metadata.JaninoRelMetadataProvider.lambda$static$0(JaninoRelMetadataProvider.java:109)
at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:151)
·····

File "/root/bsqlserver/gce_app/libs/bsql_util.py", line 22, in jsonstr_bsql_exec
gdf = bc.sql(sql)
File "/usr/local/envs/bsql/lib/python3.7/site-packages/pyblazing/apiv2/context.py", line 2880, in sql
except cio.RunQueryError as e:
AttributeError: module 'cio' has no attribute 'RunQueryError'

Possible causes: blazingsql modules are imported in multiple places
keep a from blazingsql import blazingcontext to restore normal operation

error C4996: ‘pcl::SAC_SAMPLE_SIZE‘ [How to Solve]

Error: pcl-1.8\pcl\sample_consensus\model_types.h(99): error C4996: ‘pcl::SAC_SAMPLE_SIZE’: This map is deprecated and is kept only to prevent breaking existing user code. Starting from PCL 1.8.0 model sample size is a protected member of the SampleConsensusModel class

Solution:
Open the project property page > C/C++ > General > SDL Check (set to No).

[Solved] PHP Fatal error: Uncaught Elasticsearch\Common\Exceptions\NoNodesAvailableException: No alive nodes

The environment background is docker DNMP installation of ES + PHP

Corresponding docker compose configuration and corresponding port

Port 9200 can also be accessed normally

Code

Then 500 errors are reported, including:

 PHP Fatal error:  Uncaught Elasticsearch\Common\Exceptions\NoNodesAvailableException: No alive nodes found in your cluster in /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php:67
Stack trace:
#0 /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php(87): Elasticsearch\ConnectionPool\StaticNoPingConnectionPool->nextConnection()
#1 /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php(105): Elasticsearch\Transport->getConnection()
#2 /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php(275): Elasticsearch\Transport->performRequest('POST', '/my_index/my_ty...', Array, '{"testField":"a...', Array)
#3 /www/localhost/vendor/react/promise/src/FulfilledPromise.php(28): Elasticsearch\Connections\Connection->Elasticsearch\Connections\{closure}(Array)
#4 /www/localhost/vendor/ezimuel/ringphp/src/Future/CompletedFutureValue.php(55): React\Promise\FulfilledPromise->then(Object(Clos in /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php on line 67

The reason is that the node cannot be found. The solution is as follows: find your own IP and specify the IP

Then the execution is OK

Function declare Error: Error C231: ‘delay300us’: redefinition

First of all, we know that we can’t avoid declaring sub functions when writing programs.

There was a problem during the test today:

After thinking about it, I declared the function in the previous writing, but the error “redefinition” was still reported. Later, I tried it

You need to prefix the function name with “void”.

Spring MVC project error: Namespace in turns red

Namespace in <mapper namespace> turns red

Solution:

The XML file header language should be changed to the mapper mapping instead of the config
previously used as follows:

<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">

Change to

<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

Create folders with different functions