创建spring boot项目启动报错遇到的问题
2018-06-03 13:54
711 查看
1、Spring boot,Mybatis 启动报错 Failed to auto-configure a DataSource
解决方法:
注解这样写:@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
2、非法反射,报错信息
警告信息,暂时没影响
3、idea运行springBoot项目报错 Process finished with exit code 0
Deleting provided scope of spring-boot-starter-tomcat dependency helps me.
在pom.xml中添加,然后导入
4、alt + enter 导入类
在使用idea开发java项目的时候,经常需要导入jdk或者是第三方类库的类,如果是自己手工导入的话,非常麻烦,效率很低,下面来介绍下如何设置idea,就可以实现自动导入
设置自动导入的方式,来自动批量导入,打开idea的settings设置对话框
在左上角的输入框中输入auto import关键字搜索,找到Editor>General>Auto Import
勾选上add unambiguous imports on the fly选项,点击确认,关闭对话框
在设置自动导入的窗口,还有一个Optimize imports on the fly选项,也可以勾选上,可以帮助我们自动去除不需要的导入类
*************************** APPLICATION FAILED TO START *************************** Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
解决方法:
注解这样写:@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
2、非法反射,报错信息
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/C:/Users/%e5%85%b3%e6%96%87%e5%b3%b0/.m2/repository/org/springframework/spring-core/5.0.6.RELEASE/spring-core-5.0.6.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release
警告信息,暂时没影响
3、idea运行springBoot项目报错 Process finished with exit code 0
Deleting provided scope of spring-boot-starter-tomcat dependency helps me.
在pom.xml中添加,然后导入
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </dependency>
4、alt + enter 导入类
在使用idea开发java项目的时候,经常需要导入jdk或者是第三方类库的类,如果是自己手工导入的话,非常麻烦,效率很低,下面来介绍下如何设置idea,就可以实现自动导入
设置自动导入的方式,来自动批量导入,打开idea的settings设置对话框
在左上角的输入框中输入auto import关键字搜索,找到Editor>General>Auto Import
勾选上add unambiguous imports on the fly选项,点击确认,关闭对话框
在设置自动导入的窗口,还有一个Optimize imports on the fly选项,也可以勾选上,可以帮助我们自动去除不需要的导入类
相关文章推荐
- spring-boot创建项目遇到配置问题
- 解决maven同步的eclipse中的springboot项目无法启动问题
- 因默认包扫描问题导致的SpringBoot项目无法启动问题
- spring boot 项目增加flyway的使用遇到问题解决
- spring boot集成mybatis,启动报无法创建dataSource问题
- 在本地tomcat中调试Spring boot项目遇到的一些问题
- 新建一个maven spring boot项目中遇到的问题
- maven +SpringMVC项目的创建中遇到的问题总结
- 创建springboot项目时 yml或application.properties无效或无法读取的问题
- 使用Interllij Idea2017.2创建SpringBoot 启动不了Tomcat问题
- springboot中整合activiti流程设计器时遇到访问项目需要输入tomcat用户名和密码的问题
- 解决SpringBoot项目打成jar包访问不了jsp模板的问题: SpringBoot项目集成jsp模板打成war包 然后通过java -jar 命令启动访问
- IDEA上面搭建一个SpringBoot的web-mvc项目遇到的问题
- spring Boot项目遇到的一个小问题学习到repeatable annotations
- 初学Spring Boot遇到的启动问题
- 关于SpringBoot创建时候遇到的问题之网页打开不显示信息
- IDEA 创建spring boot项目无法启动
- Idea使用Maven创建多模块SpringBoot项目问题记录
- 遇到问题---maven---启动项目出现出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoa
- springboot项目打成war包部署到tomcat遇到的一些问题