1.出现报错:“Cannot resolve table xxx”
    问题与解决:IDEA下SpringData-JPA根据数据库表生成实体类,并解决table等注解下的下红色波浪线Cannot resolve table需要进行以下操作
    1)在Persistence窗口,点击Assign Data Sources…image.png
    2)打开后会发现Data Source是空白image.png
    3)点击空白选择刚刚配置的数据库即可消除红色波浪线警告image.png

    2.运行报错:A component required a bean of type ‘com.example.demo.mapper.GuestMapper’ that could not be found.
    解决:1、再启动类添加mapper包扫描注解即可
    @MapperScan(“com.example.demo.mapper”)

    3.出现报错:Request processing failed; nested exception is java.lang.IllegalArgumentException: When allowCredentials is true, allowedOrigins cannot contain the special value “*” since that cannot be set on the “Access-Control-Allow-Origin” response header. To allow credentials to a set of origins, list them explicitly or consider using “allowedOriginPatterns” instead.
    解决办法:跨域配置报错,将.allowedOrigins替换成.allowedOriginPatterns即可。

    4.出现F12报错:Failed to load resource: the server responded with a status of 404 ()
    原因:springboot项目默认是不允许直接访问templates下的文件的,是受保护的。如果要访问templates下的文件,推荐使用thymeleaf。即你页面如果放在template里面要设置classpath的。

    5.出现报错:org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unrecognized token ‘gid’: was expecting
    原因:spring(springboot、springmvc)出现标题的异常一般是由于controller的入参失败引起的。经过多次排查和Debug 发现是json格式对不上,将json格式对上就好了,特别是数组不能对应单个字符串

    6.出现报错:rg.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
    原因:mapper文件没有添加@Mapper注解