项目启动报了一堆错误,其实都是class path resource [com/ssm/mapping/] cannot be resolved to URL because it does not exist这一个错误引起的

原来的session工厂的配置是这样写的

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<!-- 自动扫描entity目录, 省掉Configuration.xml里的手工配置 -->
<property name="mapperLocations" value="classpath:com/ssm/mapping/*.xml"></property>
</bean>

把classpath后加上*号,所有的问题都解决了,更改后的代码

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<!-- 自动扫描entity目录, 省掉Configuration.xml里的手工配置 -->
<property name="mapperLocations" value="classpath*:com/ssm/mapping/*.xml"></property>
</bean>

maven项目启动报错;class path resource [com/ssm/mapping/] cannot be resolved to URL because it does not exist的更多相关文章

  1. eclipse 中导入 maven项目 启动报错

    导入Maven项目到Eclipse中时,出现问题如下: java.lang.ClassNotFoundException: org.springframework.web.context.Contex ...

  2. 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 解决方 ...

  3. maven项目启动报错:SLF4J: Class path contains multiple SLF4J bindings.

    SringBoot的Application启动报错: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding ...

  4. Maven项目启动报错

    错误信息如下: 六月 , :: 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{S ...

  5. 启动Maven项目启动报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

    tomcat在发布项目的时候没有同时发布maven依赖所添加的jar包,你需要设置一下eclipse:项目 -> 属性 -> Deployment Assembly -> Add - ...

  6. maven项目 启动报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

    tomcat在发布项目的时候没有同时发布maven依赖所添加的jar包,所以找不到解决方法:设置一下eclipse:项目 -> properties -> Deployment Assem ...

  7. Maven项目启动报错:org.springframework.web.filter.CharacterEncodingFilter cannot be cast to javax.servlet.Filter

    看网上说法tomcat启动时会把lib目录下的jar包加载进内存,而项目里也有相同的jar包就会导致jar包冲突 解决办法: 把pom依赖里相应的jar包添加<scope>标签 <d ...

  8. Maven项目启动报错:java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

    1.场景 1.1.先确认pom.xml文件已添加mysql依赖: <dependency>    <groupId>mysql</groupId>     < ...

  9. eclipse中Maven项目启动报错“3 字节的 UTF-8 序列的字节 3 无效。”

    发生原因不知道. 解决方法是在pom.xml中追加 <properties> <project.build.sourceEncoding>UTF-8</project.b ...

随机推荐

  1. 工具篇-Mac上搭建本地svn服务器以及使用Cornerstone进行本地版本控制

    1.在桌面上见一个文件夹命名为svn,然后打开终端: 创建一个mycode仓库:svnadmin create /Users/gaoyizhen736(自己的mac的用户名)/Desktop/svn/ ...

  2. Spark之数据倾斜 --采样分而治之解决方案

    1 采样算法解决数据倾斜的思想 2 采样算法在spark数据倾斜中的具体操作

  3. [Java in NetBeans] Lesson 11. While Loops

    这个课程的参考视频和图片来自youtube. 主要学到的知识点有:(the same use in C/C++) 1. while loop while(i < max){} will keep ...

  4. ubuntu 的远程命令行,老是不能支持联想

    首先发现没有source命令,非常奇怪,google发现是dash命令的问题. $ls -l `which sh` /bin/sh -> dash $sudo dpkg-reconfigure ...

  5. python threading acquire release

    线程同步 //test.py import threading import time exitFlag = 0 class myThread (threading.Thread): def __in ...

  6. Node.JS 项目打包 JXCore

    哈哈,又回来了 当你开发完成了Node.JS项目,你应该需要打包发行吧 好,JXCore就是干这个的啦! 嗯,可能你会这样来安装 1. curl http://jxcore.com/xil.sh | ...

  7. andorid CmakeLists

    # cmake要求低版本 cmake_minimum_required(VERSION 3.4.1) # Creates and names a library, sets it as either ...

  8. Selenium基础知识(一)环境与搜索

    所需环境: 1.python2.7 + pycharm 2.Selenium 3.浏览器驱动(IEDriverServer.exe)  这里使用的是ie浏览器 将驱动放到一个环境变量路径,这里直接放在 ...

  9. time_t time()

    time_t  atime,  btime; time(&atime); btime = time(0); 两种方式效果一样.

  10. HDU 2256 Problem of Precision(矩阵)

    Problem of Precision [题目链接]Problem of Precision [题目类型]矩阵 &题解: 参考:点这里 这题做的好玄啊,最后要添加一项,之后约等于,但是有do ...