IDEA中使用Springboot+SSM的踩坑记(一)

今天由于电脑无限蓝屏,不知怎么把我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文件,非常无奈之际看到了下面这个大问题
![大问题](https://img2018.cnblogs.com/blog/1868074/202001/1868074-20200102160659949-1116847334.png)
target输出文件夹下,完全没有resources的一点东西!
找到问题所在,在pom.xml的build标签中加入以下代码
```xml
        <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热部署插件的功劳,才让我耗了这么多时间(迷),现在暂时找不到破解的方法了,不过前阵子用起来真是香到不行

posted on 2020-01-02 15:52  鲁叔  阅读(351)  评论(0)    收藏  举报

导航