class path resource [logback.xml] cannot be resolved to URL because it does not exist 问题解决
今天在自己搭建Springboot 框架的时候,在配置 logging.config=classpath:logback.xml 出现找不到这个文件的错误
经发现是maven的一个写法问题,本来我是打算打算替换 .properties文件中的内容,后面启动的时候报错,发现主要原因是
mavne 默认的resource会把src/main/resources中资源文件全部放在claaapath目录下,可是我自己重新定义已resource,只把./properties 文件放入,所有导致找不到loback.xml文件
<build>
<resources>
<resource>
<targetPath>${project.build.directory}/classes</targetPath>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</build>
正确的写法如下:
<build>
<resources>
<resource>
<targetPath>${project.build.directory}/classes</targetPath>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.properties</include>
<include>**/logback.xml</include>
</includes>
</resource>
</resources>
</build>
写好以后,记得更新下maven,要不然有时候因为缓存问题,而失效
class path resource [logback.xml] cannot be resolved to URL because it does not exist 问题解决的更多相关文章
- Could not resolve resource location pattern [classpath:com/****/mappers/*.xml]: class path resource [com/****/mappers/] cannot be resolved to URL because it does not exist的问题
这里建议先去看看路径的问题,看看application.xml的里面的导入的相应的配置文件的路径有没有问题,如下: 再者看看相应的注解有没有加上,service和controller等的注解 如果再不 ...
- maven项目启动报错;class path resource [com/ssm/mapping/] cannot be resolved to URL because it does not exist
项目启动报了一堆错误,其实都是class path resource [com/ssm/mapping/] cannot be resolved to URL because it does not ...
- spring 编译时抱错纪录class path resource [spring/] cannot be resolved to URL because it does not exist
class path resource [spring/] cannot be resolved to URL because it does not exist; 在 pom.xml 里添加如下代码 ...
- class path resource [processes/] cannot be resolved to URL because it does not exist
springboot整合activiti时报以下错误,原因是项目启动时检查流程文件 nested exception is java.io.FileNotFoundException: class p ...
- Maven项目启动失败:class path resource [spring/] cannot be resolved to URL because it does not exist
目录 Maven项目启动失败:class path resource [spring/] cannot be resolved to URL because it does not exist 解决方 ...
- Caused by: java.io.FileNotFoundException: class path resource [com/cxy/springboot/mapping/] cannot be resolved to URL because it does not exist
java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.conte ...
- 项目中运行报错: Loading XML bean definitions from class path resource [applicationContext.xml]
记录一下: org.springframework.context.support.AbstractApplicationContext prepareRefresh Refreshing org.s ...
- Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; neste
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto ...
- Caused by: java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be ope
1.错误描述 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.tes ...
随机推荐
- java的排序算法
分享网页:https://yq.aliyun.com/articles/136085?utm_content=m_26483
- [ActionScript 3.0] 如何控制加载swf动画的播放与暂停
此方法适用于用as 1.0或者as2.0以及as3.0编译的swf,因为as1.0和as2.0编译的swf是AVM1Movie类型,因此需要通过类ForcibleLoader.as将其转换为versi ...
- 恢复 MSSQL bak 文件扩展名数据(上)
恢复 MSSQL bak 文件扩展名数据 一.概念: Microsoft SQL Server是由美国微软公司所推出的关系数据库解决方案,最新的版本是SQL Server 2016,已经在2016年6 ...
- Hibernate 自动创建表bug问题解决
我在hibernate.cfg.xml配置文件中添加了自动创建表的的属性:(这样当数据库中没有此表是,hibernate就会自动帮我们创建一张表) <property name="hb ...
- 1.jQuery入口函数
<!--注意,如果需要对ie67兼容,我们可以使用原生低版本的jquery 比如说jquery-1.12.4.js--> <!DOCTYPE html> <html la ...
- 4.1、支持向量机(SVM)
1.二分类问题 在以前的博客中,我们介绍了用于处理二分类问题的Logistic Regression算法和用于处理多分类问题的Softmax Regression算法,典型的二分类问题,如图: 对于上 ...
- Intellij IDEA 封装Jar包(提示错误: 找不到或无法加载主类)
封装的过程如下: 然后准备打包 选择Build或者ReBuild即可. 但这样就会引起开始第一个图的问题.提示无法加载主类,另外一个情况就是所有的外部第三方jar包都被封装到一个jar包里面了. 那么 ...
- jquery ajax的getJSON使用
getJSON的定义和用法 通过 HTTP GET 请求载入 JSON 数据. 在 jQuery 1.2 中,您可以通过使用 JSONP 形式的回调函数来加载其他网域的 JSON 数据,如 " ...
- [转]矩阵树$Matrix-Tree$定理与行列式
[https://www.cnblogs.com/zj75211/p/8039443.html][矩阵树Matrix-Tree定理与行列式]
- CentOS7 MongoDB安装及基本配置
一.安装包的获取 1.创建文件: vi /etc/yum.repos.d/mongodb-org-4.0.repo 2.在上一步创建的文件中,写入如下内容: [mongodb-org-4.0] nam ...