项目启动报了一堆错误,其实都是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. wx:Textctrl

    import wx class Mywin(wx.Frame): def __init__(self, parent, title): super(Mywin, self).__init__(pare ...

  2. edraw的符号制作

    1.选中要制作的符号,在"符号"->"保存符号",这将保存为两个文件,1个是ede,另一个是png文件. 2. 3.名称,提示,随意写,只要你明白什么意思 ...

  3. GOROOT、GOPATH、GOBIN

    GOROOT golang安装路径. GOPATH GOPATH可以设置多个工程目录,linux下用冒号分隔(必须用冒号,fish shell的空格分割会出错),windows下用分号分隔,但是go ...

  4. Android使用SpannableString设置多样式文本

    Android将一行文本设置为多种样式时,可以使用 SpannableString 来实现 private void setTips(){ String big = "大字深色"; ...

  5. Django进阶Model篇—数据库操作(ORM)

    一.数据库配置 django 默认支持sqlite.mysql.oracle.postgresql数据库,像db2和sqlserver之类的数据库需要第三方的支持,具体详见https://docs.d ...

  6. 更新合并数组的es6方法

  7. [LeetCode] 329. Longest Increasing Path in a Matrix_Hard tag: Dynamic Programming, DFS, Memoization

    Given an integer matrix, find the length of the longest increasing path. From each cell, you can eit ...

  8. Oracle相关安装经验总结

    1. 安装的是oracle 12c client for windows,从同事处拿到的,说是64位的,不过我没有找到包含有64这样的文件名或者里面内容有64位的.从同事处拿到的plsqldev110 ...

  9. 通过Referer设置来防盗链

    在Servlet中需要设置防盗链功能时可以通过以下代码: String referer = request.getHeader("Referer"); if(referer == ...

  10. hbase-java-api003(put list)

    package api; import java.io.IOException; import java.util.ArrayList; import java.util.List; import o ...