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个回答

classpath:dao/*.xml中的路经可能不对,看看是不是少了目录

没有dao的文件夹,我只是把配置文件复制过来,就创建了一个jsp页面

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问