Tag Archives: ProgrammerAH

Springboot failed to parse MVC view

Problem Description:
@ requestmapping always reports an error when returning to the view: unable to parse MVC view “index”

reason:
unable to parse because the pre suffix of splicing cannot be found, so it cannot jump. Forget to import template engine dependencies

Solution:
Add dependency in POM

    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf-spring5</artifactId>
    </dependency>
    <dependency>
        <groupId>org.thymeleaf.extras</groupId>
        <artifactId>thymeleaf-extras-java8time</artifactId>
    </dependency>

The browser requires that samesite by default cookies be disabled

Some websites require that the default in samesite be set to disabled

However, into the browser’s flag page found that there is no problem   Samesite by default cookies because the kernel update page has changed

Solution:

1. Find the browser shortcut and right-click properties

2. Add in the target column

--disable-features=SameSiteByDefaultCookies,CookiesWithoutSameSiteMustBeSecure

 
3. Restart the browser and you will find that it is OK

 
be careful

It is said that this method is invalid after chrome kernel 94 +

 
 

[Solved] Unit test automatically injects error reporting nullpointer

Using @Autowired annotation to generate nullpointer in unit test

terms of settlement

1. Introduce POM

		<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>2.2.1.RELEASE</version>
            <scope>test</scope>
        </dependency>

2. Add notes to the unit test

@SpringBootTest(classes = EduApplication.class)
@RunWith(SpringJUnit4ClassRunner.class)
public class redisTemplate {

  @Autowired
  RedisTemplate redisTemplate;
    @Test
    public void testStringAdd(){
        BoundValueOperations str = redisTemplate.boundValueOps("str");
        // Set the value via redisTemplate
        str.set("test1");
        str.set("test2");
    }
}

Solution of node canvas error reporting in MacOS M1 installation

M1 native does not release binary version of canvas in node15. Therefore, when you install canvas, you will automatically compile from the source code, but if you do not install the corresponding dependency, you will report an error.

Solution

arch -arm64 brew install pkg-config cairo pango jpeg giflib librsvg

Troubleshooting

Homebrew cannot be installed

If you encounter

Error: Failure while executing; `tar --extract --no-same-owner --file /Users/wenbing/Library/Caches/Homebrew/downloads/6f65cc908bca8f42eeb93f33e25d76d748a7a28f20f30f41befe472ea2a01bc5--fribidi-1.0.10.arm64_big_sur.bottle.tar.gz --directory /private/tmp/d20210618-36598-16scyl7` exited with 1. Here's the output:
tar: Error opening archive: Failed to open '/Users/wenbing/Library/Caches/Homebrew/downloads/6f65cc908bca8f42eeb93f33e25d76d748a7a28f20f30f41befe472ea2a01bc5--fribidi-1.0.10.arm64_big_sur.bottle.tar.gz'

For this kind of error reporting, you need to manually install the dependency front dependency first, and then install the module

brew install libtiff gdk-pixbuf librsvg

Node gyp could not find the header file

If your homebrew is also M1 native, then homebrew will be installed under/opt/homebrew. Brew install will be under/opt/homebrew/cell/instead of linking to/usr/local/include. When node gyp is compiled, it is still compiled with clang in essence, and the header file cannot be found, so a fatal error: 'JPEG lib. H' file not found will be reported. The solution is to add/opt/homebrew/cell/to clang’s include path. My practice is in ~ /. Bash_ Add a line to profile

export CPLUS_INCLUDE_PATH=/opt/homebrew/include

Examination

Install 0 accounts on Apple M1.

Accounting subjects

Wechat applet background image error

In the development process, the background image is set by using background, and the error is reported as follows

Cause of error:   Wechat applet sets background through background image: only supports online pictures and Base64 pictures, not local pictures.

Solution: 1. Put pictures on the server and use online pictures

2. The steps of Base64 image setting are as follows:

2-1 on the website http://imgbase64.duoshitong.com/ Convert image to text in Base64 format

2-2 use the above text in wxss:

background- image:url (“ data:image/png; base64,iVBORw0KGgo=…”);

 

When idea writes JavaWeb, it can’t find servlet

When writing JSP, always worry about finding the location of servlet accurately
if the vallue of the servlet = (“/ myservlet”)
then use action = & lt;%= request.getContextPath()%>/ “Myservlet”, isn’t it very convenient

getcontextpath() is to find the project publishing path, that is, the root directory, while servlet value =/myservlet " represents that the servlet is in the root directory, so directly & lt;%= request.getContextPath()%>/ Myservlet can find the servlet. Similarly,
If value =/my/servlet "
then & lt;%= request.getContextPath()%>/ My/servlet is OK

DB2 timed task execution stored procedure cannot complete scheduler thread’s initialization

The following reports have been made in the implementation of failure checks.

2021-06-09-14.46.11.868000-420 I16975H265 LEVEL: Error PID : 1412 TID : 1800 FUNCTION: DB2 Tools, DB2 administration server, SchedulerThread_run, SchedulerThread_run, probe:5 DATA String, 50 bytes cannot complete scheduler thread’s initialization! 2008-05-01-14.46.16.868000-420 I170042H386 LEVEL: Error PID : 1412 TID : 1800 FUNCTION: DB2 Tools, DB2 administration server, MDUtility: :connectMD, MDUtility probe:10 DATA Sint32, 4 bytes – 300 DATA #2 : Sint32, 4 bytes 0 DATA #3 : Sint32, 4 bytes 0 DATA #4 : String, 7 bytes TOOLSDB DATA #5 : String, 8 bytes SYSTOLS DATA #6 : String, 4 bytes NULL

Reference is made to the website: https://www.ibm.com/support/pages/db2-scheduler-thread-initialization-error-db2diaglog
>

Yes

[Solved] This application has no explicit mapping for /error, so you are seeing this as a fallback

This application has no explicit mapping for /error, so you are seeing this as a fallback

Today, we use spring boot to build a background weather project. The database we use is weather and the table name is city. Adding annotations in the control layer writes getmapping as restmapping, which leads to errors. Fill in the address bar with localhost: port number/database table name/list. Only in this way can it be displayed normally