Comments (6)
在application类上添加注解:@MapperScan(basePackages = "org.sang.mapper")
from vblog.
下载下来就改了下配置文件,报错,刚学习spring boot,什么原因报错?
from vblog.
需要在启动类的@EnableAutoConfiguration或@SpringBootApplication中添加exclude = {DataSourceAutoConfiguration.class},排除此类的autoconfig。启动以后就可以正常运行。
以上,网搜的,改好后运行,也报了题主同样的错误,但是加了楼上的注解,错误更多了。。。
package org.sang;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@EnableScheduling//开启定时任务支持
@MapperScan(basePackages = "org.sang.mapper")
public class BlogserverApplication {
public static void main(String[] args) {
SpringApplication.run(BlogserverApplication.class, args);
}
}
from vblog.
resources文件夹右击 mark directory as resources root,看了之前关闭的问题,IEDEA这样操作解决了。
from vblog.
@zuoee 我也遇到这个问题,发现是因为资源文件没被打包,从IDE层面去设置不如从代码层面去修改,我的解决方案是:在pom文件标签内增加一个资源节点:
<resource> <directory>src/main/resources</directory> <includes> <include>**/*.*</include> </includes> </resource>
from vblog.
更新mybatis框架到2.0.0之后,项目即可以运行
尝试过close上的做法,没有作用,而且看文件夹格式和pom文件,resource Root作者应该是已经修改过了
from vblog.
Related Issues (20)
- 登录失败 HOT 3
- 注册功能在哪里
- 启动和源码问题
- 演示平台挂掉了
- 挺不错 HOT 1
- 大佬,为什么使用默认的密码登录显示密码错误呢? HOT 1
- 登陆密码
- 登陆的时候不显示验证码图片.
- 没有数据库结构 HOT 1
- 修改文章时tags操作bug
- Hdnd
- sql呢,大佬能不能直接上传一波,不用自己写了 HOT 2
- 演示地址挂了? HOT 4
- blogserver已经运行,数据库也正常,但是无法显示登录页面,报错401登录超时
- 【项目自荐】: ❤️一个基于Springboot的个人博客
- 前后端分离报跨域错误 HOT 1
- npm install 报错的小伙伴看过来 HOT 13
- 登陆失败 HOT 3
- 注释 HOT 1
- VBlog <=May 15, 2020 version has arbitrary file upload vulnerability
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vblog.