Tag Archives: development language

[Solved] SpringCloud Compile Error: java: JPS incremental annotation processing is disabled. Compilation results on partial recompilation may be inaccurate.

Error:

SpringCloud Compile Error: java: JPS incremental annotation processing is disabled. Compilation results on partial recompilation may be inaccurate. Use build process “jps.track.ap.dependencies” VM flag to enable/disable incremental annotation processing environment.

 

Solution:
1.Add: -Djps.track.ap.dependencies=false

2. Clear the caches

[Solved] matlab Error: Error in port widths or dimensions. ‘Output Port 1‘ of ‘sl_arm_ibvs/camera‘

When running the Manipulator Simulation in MATLAB visual servo toolbox, the following problems are encountered: error in port widths or dimensions. ‘ Output Port 1’ of ‘sl_ arm_ ibvs/camera’ is a [28×1] matrix.

The problem is caused by the wrong input vector dimension at the red circle dimension in the figure below.

Here the p for the camera pixel coordinate system under the coordinate value, should be 2 * 4 vectors.

Solution: The new version of Machine Vision Toolbox for MATLAB toolbox lacks the module “slcamera.m”, open the camera module in simulate.

Double click the MATLAB FCN module, and you will be prompted that “slcamera” cannot be found. Select new:

Type the following code:

function p = slcamera(cam, u)
    %if all(u == 0)
     if (u(1:16,:)==0)
        % Simulink is probing for the dimensions
        np = (length(u)-16)/3;
        p = zeros(2, np);
    else
        p = zeros(2, 4);
        P = reshape(u(17:end), 3, []);
        Tcam = reshape(u(1:16), 4, 4);
        p = cam.plot(P, 'pose', Tcam, 'drawnow');
        
    end

Run simulate again, you can see the error report and disappear, then you should encounter the following error.

Error in ‘sl_arm_ibvs/camera/MATLAB Fcn’. Evaluation of expression resulted in an invalid output.
Only finite double vector or matrix outputs are supported

I am also working on a solution for this error, so please stay tuned.

[Solved] This error might have occurred since this system does not have Windows Long Path support enabled.

This error might have occurred since this system does not have Windows Long Path support enabled.

pip install rife_ncnn_vulkan_python
WARNING: Ignoring invalid distribution -ip (d:\python3.8\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\python3.8\lib\site-packages)
Collecting rife_ncnn_vulkan_python
Using cached rife-ncnn-vulkan-python-1.1.2.post3.tar.gz (21.5 MB)
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: ‘C:\Users\Administrator\AppData\Local\Temp\pip-install-ti2fh5nq\rife-ncnn-vulkan-python_464f213e18974938aa0e4a998e825356\rife_ncnn_vulkan_python/rife-ncnn-vulkan/src/ncnn/glslang/Test/baseResults/spv.WorkgroupMemoryExplicitLayout.MixBlockNonBlock_Errors.comp.out’
HINT: This error might have occurred since this system does not have Windows Long Path support enabled. You can find information on how to enable this at https://pip.pypa.io/warnings/enable-long-paths

 

Solution:

[Solved] Error:maven-resources-production:ruoyi-ywjs: java.lang.NegativeArraySizeException

Error:maven-resources-production:ruoyi-ywjs: java.lang.NegativeArraySizeException

Cause: nothing is done. This exception is reported when restarting the project: array exception

Error:maven-resources-production:ruoyi-ywjs: java.lang.NegativeArraySizeException

Solution:

1. Click file,

2 Click void cache/restart,

3 Click: invalidate and restart,

4 Just restart the project

[Solved] Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find cla

preface

The problem encountered when learning Mybatis for the first time, when writing the global configuration file SqlMapConfig.xml, in the database connection pool section would like to introduce the configuration of db.properties as follows.

db.properties configuration

SqlMapConfig.xml

The error reports given are:

Error setting driver on UnpooledDataSource. Cause:java.lang.ClassNotFoundException: Cannot find class: ${jdbc.driver}

No corresponding connection was obtained. Because the properties file was not loaded:

After Add <properties> labeling, the program runs normally.

Done.

[Solved] javax.crypto.BadPaddingException: Decryption error

javax.crypto.BadPaddingException: Decryption error

When using RSA encrypt body spring boot for decryption. This error occurred

I access the interface in postman. As follows:

This error appears.

Solution:

The value in raw contains all the requested parameters.

The @RequestBody is also required, otherwise it will not receive the value it should.

back-end:

    @Encrypt
    @GetMapping("/encrypt")
    public Student encrypt(){
        Student stu = new Student();
        stu.setId(1);
        stu.setName("test");
        return stu;
    }


    @Decrypt
    @PostMapping("/decrypt")
    public String testDecrypt(@RequestBody String username){
        System.out.println(username);
        return username;
    }

The correct postman is as follows:

At this time, pay attention to the data format of the transfer. There may be a problem with submitting the wrong data type. Text is not necessarily right. After that problem, I changed to JSON.

[Solved] PageHelper Error: syntax error, error in :‘it 1 LIMIT ? ‘

Error Messages:

syntax error, error in :‘it 1 LIMIT ? ‘

 

Problem Cause:
The PageHelper method uses static ThreadLocal parameters, and the paging parameters and threads are bound.
This is safe as long as we ensure that the PageHelper method is called immediately after the MyBatis query method. This is because PageHelper automatically clears the ThreadLocal stored object in the finally snippet.
The page started in the thread does not guarantee that the thread will have cleared the page variable by the time the current execution exits.
One PageHelper paging process is as follows.
i. Set the page parameter
Second, execute the query method
Third, the Interceptor interface checks whether there is a set page parameter in ThreadLocal
If the page parameter exists, regenerate count sql and page sql, and execute the query. If the page parameter does not exist, return the query result directly.
V. Execute LOCAL_PAGE.remove() to clear the page parameter.

Solution:
Call PageHelper.clearPage() at the end of the method using PageHelper;

[Solved] PDF.js Error: Cannot use the same canvas during multiple render()

Background of the problem: business in the preview pdf file, the pdf to zoom in and out operations, if the frequency of operation is too fast or multiple execution page to display the contents of the pdf file is lost, the display is incomplete, the content is inverted and other phenomena. Open the console to find an error message: ERROR Error: Uncaught (in promise): Error: Cannot use the same canvas during multiple render() operations. use different canvas or Use different canvas or ensure previous operations were cancelled or completed.

Reason analysis: the meaning of the error may be the canvas tag in the display of pdf file content, pdf rendering errors, the problem may be in the scaling operation of the logic code in what operation caused.

Check the code found here to display the pdf file is not paged display, so in the scaling operation, go through all the canvas tags, and then the implementation of the pdf.getPage () this r function, re-modify the width and length of the canvasde rendering pdf. page.render (renderContext) is an asynchronous operation, traversing the canvas to modify the canvas rendering pdf may cause the last asynchronous rendering operation has not yet finished and start a new render, which will report an error resulting in pdf rendering errors.

pdfStreamRenderPage = (num) => { // A string of pdf 64-bit streams with zoom in/out rotation
      if (self.pageRendering) {
        self.pageNumPending = num;
      } else {

        const container = document.getElementById('thisCanvas1').getElementsByTagName('canvas');
        // This traversal operation will result in an error
        for (let i = 1; i <= container.length; i++) {
          self.pageRendering = true;
          self.pdfDoc.getPage(i).then((page) => {
            const viewport = page.getViewport(self.scale, self.rotate);
            container[i - 1].height = viewport.height;
            container[i - 1].width = viewport.width;
            const ctx = container[i - 1].getContext('2d');
            const renderContext = {
              canvasContext: ctx,
              viewport
            };
            const renderTask = page.render(renderContext);
            // You can wait here for rendering to finish before manipulating the next canvas
            renderTask.promise.then(() => {
              self.pageRendering = false;
              if (self.pageNumPending !== null) {
                renderPage(self.pageNumPending);
                self.pageNumPending = null;
              }
            });
          });
        }
      }
    };

Optimize this traversal operation logic to wait for the previous renderTask.promise.then() canvas rendering to finish before executing the next canvas rendering operation.
Modified code:

const pdfStreamRenderPage = (num) => {
      // A string of pdf 64-bit streams with zoom in/out rotation
      if (self.pageRendering) {
        self.pageNumPending = num;
      } else {
        const canvasElementMap = document.getElementById('thisCanvas1').getElementsByTagName('canvas');
        const canvasElement = canvasElementMap[0]
        const pageNum = 1
        scalePdfCanvas(canvasElement, pageNum, canvasElementMap)
      }
    };
 
     /**
     * Scaling the contents of each pdf page
     * @param canvasElement current page canvas
     * @param num current page number
     * @param canvasElementMap the set of all rendering pdf's canvas
     */
    const scalePdfCanvas = (
      canvasElement: HTMLCanvasElement, 
      num: number, 
      canvasElementMap: HTMLCollectionOf<HTMLCanvasElement>
      ) => {
        self.pageRendering = true;
        self.pdfDoc.getPage(num).then((page) => {
        const viewport = page.getViewport(self.scale, self.rotate);
        canvasElement.height = viewport.height;
        canvasElement.width = viewport.width;
        const ctx = canvasElement.getContext('2d');

        // Render PDF page into canvas context
        const renderContext = {
          canvasContext: ctx,
          viewport,
        };

        const renderTask = page.render(renderContext);
        // Wait for rendering to finish
        renderTask.promise.then(() => {
          self.pageRendering = false;
          num++;
          if (num <= canvasElementMap.length) {
            // scale next canvas
            scalePdfCanvas(canvasElementMap[num-1], num, canvasElementMap)
          }
          if (self.pageNumPending !== null) {
            // New page rendering is pending
            pdfStreamRenderPage(self.pageNumPending);
            self.pageNumPending = null;
          }
        });
      });
    }

[Solved] BeanCreationNotAllowedException:Error creating bean with name ‘rabbitConnectionFactory‘:

BeanCreationNotAllowedException:Error creating bean with name ‘rabbitConnectionFactory‘:

BeanCreationNotAllowedException: Error creating bean with name 'rabbitConnectionFactory': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)

My reason is: my timer class UnlockOverNumCrontab and DemoServiceImpl class at the same time @Autowired active injection of private IDemoService.
Solution: Add @Lazy annotation to the method name of the UnlockOverNumCrontab class, the default annotation is true

[Solved] shiro Error: SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“.

shiro error: SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“.

Shiro reports an error

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“.

Reason found after search:

Logging implication loading org.slf4j.impl.StaticLoggerBinder class failed
This warning message is reported when running the “org.slf4j.impl. Unable to load StaticLoggerBinder class into memory. This happens when a suitable SLF4J binding cannot be found on the class path. Putting one (and only one) of slf4j-nop.jar slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar, or logback-classic.jar on the class path should solve the problem.
Note that the slf4j-api version is 2.0. x and later using the ServiceLoader mechanism. Backends, such as logback 1.3 and later, target slf4j-api 2. Do not distribute with org.slf4j.impl.StaticLoggerBinder. If you set up a logging backend targeting slf4j-api 2.0. X, you need to install slf4j-api-2.x.jar on the class path. See the related faq entry.

Solution:
Remove one of the jar packages slf4j-nop.jar slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar, leaving only one
runs successfully

Python: How to Disable InsecureRequestWarning error

Python Disable InsecureRequestWarning error

Send HTTPS requests using Python 3 requests. When SSL authentication is turned off (verify = false):

import requests
response = requests.get(url='http://127.0.0.1:12345/test', verify=False)

Error Messages:

InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

Solution:

#python3
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

#python2
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

PS: as shown below, disable_warnings() will disable all warning types.

def disable_warnings(category=exceptions.HTTPWarning):
    """
    Helper for quickly disabling all urllib3 warnings.
    """
    warnings.simplefilter("ignore", category)

[Solved] VScode Run C++ File Error: fatal error:opencv2\core.hpp:No such file or diretory

Run c++ file with vscode error: fatal error: opencv2\core.hpp:No such file or diretory

The main error is that the corresponding header file cannot be found in the header file directory!
C header file directory %MINGW_PATH%/include under the header file, which has strcpy and other c function declaration.
C++ header file directory %MINGW_PATH%/lib/gcc/mingw32/4.4.0/include/c++ under the header file, which has the declaration of std::string class.
//home directory
MINGW_PATH=D:/MinGW

//C header file directory
C_INCLUDE_PATH=%MINGW_PATH%/include;%MINGW_PATH%/lib/gcc/mingw32/3.4.5/include

//C++ header file directory
CPLUS_INCLUDE_PATH=%MINGW_PATH%/include/c++/3.4.5;%MINGW_PATH%/include/c++/3.4.5/mingw32;%MINGW_PATH%/include/c++/3.4.5/backward;% C_INCLUDE_PATH%

//In QTSDK with MinGW the C++ header files are in the lib folder
CPLUS_INCLUDE_PATH=%MINGW_PATH%/lib/gcc/mingw32/4.4.0/include/c++;%C_INCLUDE_PATH%

//library directory
LIBRARY_PATH=%MINGW_PATH%/lib;%MINGW_PATH%/lib/gcc/mingw32/3.4.5

//executable program directory
PATH=%MINGW_PATH%/bin;%MINGW_PATH%/libexec/gcc/mingw32/3.4.5