class path resource [com/cn/bonc/mapping/] cannot be resolved to URL because it does not exist
来源:互联网 发布:淘宝没有品牌授权 编辑:程序博客网 时间:2024/06/16 06:58
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">Caused by: </span><span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"><u><span style="color:rgb(0,0,128)">java.lang.IllegalArgumentException</span></u></span><span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">: Could not resolve resource location pattern [classpath:/com/cn/bonc/mapping/*.xml]: class path resource [com/cn/bonc/mapping/] cannot be resolved to URL because it does not exist</span>
at org.springframework.core.io.support.ResourceArrayPropertyEditor.setAsText(ResourceArrayPropertyEditor.java:140)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:430)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:403)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:181)
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:459)
... 45 more
首先要理解配置文件中:classpath的含义?
<property name="mapperLocations" value="classpath:com/cn/bonc/mapping/*.xml"></property>
编写的java源文件经过编译后生成class文件,需要指定目录存放这些文件。web程序默认都在web-info/classes目录下存放我们的java编译后的文件。
但是web-info目录下还有各种jar包和配置文件呢,确切说web-info根目录才是程序运行时classpath
打开深入,突然发现,确实没有mapping文件??????
原来是编译后, 没有生成相应的文件:
处理:
在pom里面添加:
<build> <finalName>filecontrol</finalName> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> <include>**/*.tld</include> </includes> <filtering>false</filtering> </resource> <resource> <directory>src/main/java</directory> <excludes> <exclude>**/*.java</exclude> </excludes> </resource></resources> </build>
- class path resource [com/cn/bonc/mapping/] cannot be resolved to URL because it does not exist
- class path resource [logConfig.xml] cannot be resolved to URL because it does not exist
- class path resource [setting.xml] cannot be resolved to URL because it does not exist
- eclipse下项目报错class path resource [com/xzhang/mapping/] cannot be resolved to URL because it does not
- 报错:classpath resource [com/qinkangdeid/mapping/] cannot be resolved to URL because it does not exist
- 关于class path resource [WEB-INF/content/] cannot be resolved to URL because it does not exist解决办法
- java.io.FileNotFoundException: class path resource [WEB-INF/classes/cn/golaxy/yqpt/pojo/] cannot be resolved to URL because it
- 关于class path resource [applicationContext.xml] cannot be opened because it does not exist
- class path resource [META-INF/xfire/services.xml] cannot be opened because it does not exist
- spring class path resource [jdbc.properties] cannot be opened because it does not exist
- class path resource [spring.xml] cannot be opened because it does not exist
- class path resource [applicationContext.xml] cannot be opened because it does not exist
- java.io.FileNotFoundException: class path resource ..cannot be opened because it does not exist
- Spring问题:class path resource [xxx.xml] cannot be opened because it does not exist
- class path resource [applicationContext.xml] cannot be opened because it does not exist
- class path resource [spring-mvc.xml] cannot be opened because it does not exist
- java.io.FileNotFoundException: class path resource [META-INF/xfire/services.xml] cannot be opened because it does not exist
- java.io.FileNotFoundException: class path resource [beans.xml] cannot be opened because it does not exist 解决方法
- androir 遍历所有文件夹,查询视频文件
- 欢迎使用CSDN-markdown编辑器
- jdk环境变量配置后java,java
- log
- 使用phpstom的点点滴滴记录,持续更新中...
- class path resource [com/cn/bonc/mapping/] cannot be resolved to URL because it does not exist
- 【面向代码】学习Deep Learning
- 回文串
- MySQL自增长列,设置主键和索引
- java迭代Iterator
- Json
- Oracle用sql增删改字段,并添加索引
- rhel修改ip地址的3个方法(命令修改)
- Ubuntu启动tomact问题