首页 > 编程语言 > 详细

IDEA中使用Springboot+SSM的踩坑记

时间:2020-01-02 16:51:34      阅读:132      评论:0      收藏:0      [点我收藏+]

今天由于电脑无限蓝屏,不知怎么把我IDEA里面破解过的一些东西给搞没了,包括IDEA本体和JRebel,照着原来的方法破解连本体都开不起来了(哭死),索性下了个最新版来用,结果JRebel还是破解不得。


将就把毕设pull放到新的idea里使用,结果已启动就报错

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'studentController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'checksystem.root' in value "${checksystem.root}"



度娘捣鼓了一波,发现问题是找不到properties配置文件里面的root标签导致控制器@Value注解找不到,于是索性一根筋自己给@Value手动注值


满怀信心启动项目发现又报错

***************************
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).


Process finished with exit code 0

龟龟,有完没完,数据库的配置又找不到了,还是没有读到properties文件,非常无奈之际看到了下面这个大问题
技术分享图片
target输出文件夹下,完全没有resources的一点东西!
找到问题所在,在pom.xml的build标签中加入以下代码

        <resources>
            <!-- 顺便加一下呗,万一用得到呢 -->
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.*</include>
                </includes>
            </resource>
            <!-- 如下 -->
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.*</include>
                </includes>
            </resource>
        </resources>

问题解决!


后面百度发现IDEA中是不会自动把这些文件夹下的东西输出到target中的,需要像上面一样配置,纳闷为什么旧版本的idea没加居然可以。。。再转念想一下,可能是JRebel热部署插件的功劳,才让我耗了这么多时间(迷),现在暂时找不到破解的方法了,不过前阵子用起来真是香到不行

IDEA中使用Springboot+SSM的踩坑记

原文:https://www.cnblogs.com/ALuShu/p/12133411.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!