qq_38711872 2019-10-16 21:12 采纳率: 9.1%
浏览 407

ssm配置文件突然报错,哪位大神知道哪错了?

刚创建一个项目,之前配置文件一直用的这个,运行jsp页面报错404,把这段代码注释掉就不报错了,那位大神知道哪错了怎么改?在线等 急急急!控制台报错如下:
Error creating bean with name 'sqlSessionFactory' defined in file [E:\sht.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\MySht\WEB-INF\classes\springconfig\common.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:dao/*.xml]: class path resource [dao/] cannot be resolved to URL because it does not exist
spring配置:<?xml version="1.0" encoding="UTF-8"?>
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">

<bean id="propertyConfigurer"
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations" value="classpath:jdbc.properties"></property>


destroy-method="close">









<!--



自动扫描mapping.xml文件



-->






                                            把这行注释掉就不报错了:
                                            <!-- <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">  
    <property name="dataSource" ref="ds" />  
    自动扫描mapping.xml文件  
    <property name="mapperLocations" value="classpath:dao/*.xml"></property>  

-->

  • 写回答

2条回答 默认 最新

  • Json-Huang 2019-10-16 22:50
    关注
    classpath:dao/*.xml中的路经可能不对,看看是不是少了目录
    
    评论

报告相同问题?

悬赏问题

  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题