maven common error query

1. If the "main" error is reported, it is basically that the comment is missing. The comment
@Autowired injects
@Service service layer annotation
@Transactional to start the transaction (transaction rollback)
@RequestMapping("request page") request address
@DataTimeFormot("yyyy -mm-dd") time
@PathVariable(value="xxx") get address value

2. If a Process terminated error is reported, then look at the pom configuration file. The
configured project name cannot have spaces.

3. If reported booktype( typeid))

com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (backup.book, CONSTRAINT FK_BOOK_TYPEID FOREIGN KEY (typeid) REFERENCES booktype (typeid))

Usually the database primary key error

4. Date format conversion error

Resolved exception caused by handler execution: org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type ‘java.lang.String’ to required type ‘java.util.Date’; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.util.Date] for value ‘2019-12-03’; nested exception is java.lang.IllegalArgumentException

在Date前加上注解
@DateTimeFormat(pattern ="yyyy-MM-dd" )Date brithday

Guess you like

Origin blog.csdn.net/Xin_shou__/article/details/118187275