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 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器