Springboot Cangqiong takeaway actual combat: 1. Environment construction (nginx startup failure solution + Entity, DTO, VO, POJO difference explanation + nio.charset.Input length = 2 error report solution)

Environment setup Front-end environment construction There is a “front-end operating environment” folder in day01 of the information. Extract the “nginx-1.20.2” folder to non-Chinese directory, and then directly click nginx in the folder .exe (it doesn’t matter if it crashes). Then enter localhost directly in the browser. If the following page appears, it means the front […]

Download/export problem (uniform return): No converter for xxx with preset Content-Type application/octet-stream; charset=UTF-8

1. Preface The download interface returns download data normally. After the file stream is closed, the response returns success and the console reports an error all content: Probably means there is no converter. Contains the default content type “application/octet-stream;charset=UTF-8” org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class com.cn.common.AjaxResult] with preset Content-Type ‘application/octet-stream;charset=UTF-8’ at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:319) at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:194) at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:78) […]

SPECjvm2008_1_01 openjdk8 error Name.java:54: Unable to access java.lang.CharSequence card startup.compiler.sunflow

Test command root@yeqiang-greatwall:/opt/SPECjvm2008# ./run-specjvm.sh -ikv Failure (cannot access java.lang.CharSequence) /tmp/SPECjvm2008/compiler.compiler/compiler/src/share/classes/javax/lang/model/element/Name.java:54: cannot access java.lang.CharSequence Bad class file: spec.benchmarks.compiler.SpecFileManager$CachedFileObject@63eea6e Wrong constant pool tag: 18 at 10 Please delete the file or make sure the file is in the correct classpath subdirectory. public interface Name extends CharSequence { ^ ERROR: compiler exit code: 1 Reason Check openjdk and […]

org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input length = 1

Question Running the SpringBoot project, the console reports an error java.lang.IllegalStateException: Failed to load property source from ‘file:/D:/JavaProjects/seckilldemo/target/classes/application.yml’ (classpath:/application.yml) Detailed question For the newly downloaded IDEA, the author runs the SpringBoot project, and the console reports an error 16:55:17.982 [main] ERROR org.springframework.boot.SpringApplication – Application run failed java.lang.IllegalStateException: Failed to load property source from ‘file:/D:/JavaProjects/seckilldemo/target/classes/application.yml’ (classpath:/application.yml) […]

CharSequence (character sequence) interface for Java learning

CharSequence 1. Related interfaces java.lang. CharSequence Interface java.lang. Appendable interface java.lang. Comparable interface java.io. Seralization Interface 2, java.lang.String 2.1. Concept: String is a class character strings are strings 1. Multiple characters caused by directly using “” in the Java language are character strings. 2. Strings caused by directly using “” in the Java source code […]

Simple and easy-to-understand Echars case, realize click list linkage pie chart

## Simple and easy-to-understand Echars case, realize click list linkage pie chart 1. Install echarts-for-react 2. Introduce import ReactECharts from ‘echarts-for-react’ into the project; 3. Start writing the case! ! ! 1. First, let’s write a left list StageLine Use StageItem to traverse and display the data in data. import React = require(‘react’); import { […]

java.nio.charset.MalformedInputException: Input length = 1 or Input length = 2

java.nio.charset.MalformedInputException: Input length = 1 or Input length = 2 Problem recurrence 1. Reason 2. Solutions 2.1 Get rid of Chinese-related characters in yml, including those in comments 2.2 It must be in Chinese, or must have notes 2.3 If none of the above can solve your problem, the ultimate solution maven.compiler.encoding 3 Run the […]