前后端分离智能停车场系统项目,报错解决

文章目录

    • 跨域访问问题
    • swagger突然跳转登录页面
    • 报错:Skipping MapperFactoryBean with name 'userMapper' and 'cn.mbz.parkingsystem.mapper.UserMapper' mapperInterface. Bean already defined with the same name!
    • 用户列表加载不出来Request failed with status code 500

跨域访问问题

Failed to load resource: net::ERR_CONNECTION_REFUSED
Access toXMLHttpRequest at ‘http://localhost:8080/user/login’ from origin
‘http://localhost:9999’ has been blocked by CORS policy: No
‘Access-Control-Allow-Origin’ header is present on the requested
resource.

添加 @CrossOrigin
前后端分离智能停车场系统项目,报错解决_第1张图片

swagger突然跳转登录页面

最后原因是导入了security的包,导致权限安全拦截
前后端分离智能停车场系统项目,报错解决_第2张图片

注释后运行成功

报错:Skipping MapperFactoryBean with name ‘userMapper’ and ‘cn.mbz.parkingsystem.mapper.UserMapper’ mapperInterface. Bean already defined with the same name!

No MyBatis mapper was found in ‘[xx.mapper]‘ package. Please check your configuration.

解决方案:
前后端分离智能停车场系统项目,报错解决_第3张图片

在启动主文件里面把@MapperScan(“com.tony.ssmmd.mapper”)注释掉就可以了,只保留配置文件com.xxx.xxx.config.MyBatiesPlusConfiguration里面的@MapperScan(“com.xxx.xxx.mapper”)
其实两个保留一个就可以了

用户列表加载不出来Request failed with status code 500

后端报错
ERROR 18400 — [nio-8080-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

前后端分离智能停车场系统项目,报错解决_第4张图片
不能用data,将其改为params。

你可能感兴趣的:(web,Java,mybatis,java,mysql,vue,spring)