zoukankan      html  css  js  c++  java
  • 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 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>
  • 相关阅读:
    java performance
    C# and Java: Comparing Programming Languages
    MYSQL blogs and articles
    网络基本功系列:细说网络那些事儿
    Spark 优化器 ML的论文
    逻辑回归
    MapReduce
    Spark
    Set-Theory-and-Logic
    k-means
  • 原文地址:https://www.cnblogs.com/suni/p/9088291.html
Copyright © 2011-2022 走看看