spring-mybatis.xml配置出错了,请大神看看

问题描述

spring-mybatis.xml配置出错了,请大神看看

这是第一个错

org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.fishoad.services.QuartzService] for bean with name 'quartzTask' defined in class path resource [spring-quartz.xml]; nested exception is java.lang.ClassNotFoundException: com.fishoad.services.QuartzService
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1327)
Caused by: java.lang.ClassNotFoundException: com.fishoad.services.QuartzService
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
`



三月 07, 2016 10:49:24 上午 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.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:/com/fishoad/dao/*.xml]: class path resource [com/fishoad/dao/] cannot be resolved to URL because it does not exist
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)

第二个错

Caused by: 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:/com/fishoad/dao/*.xml]: class path resource [com/fishoad/dao/] cannot be resolved to URL because it does not exist
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:479)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:511)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:505)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1502)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1461)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
... 21 more
Caused by: java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:/com/fishoad/dao/*.xml]: class path resource [com/fishoad/dao/] cannot be resolved to URL because it does not exist
at org.springframework.core.io.support.ResourceArrayPropertyEditor.setAsText(ResourceArrayPropertyEditor.java:140)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:430)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:403)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:181)
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:459)
... 27 more


解决方案

在pom.xml 下面的build便签下加上

src/main/resources

/*.properties
/*.xml
**/*.tld

false

解决方案二:

class path resource [com/fishoad/dao/] cannot be resolved to URL because it does not exist
提升路径不存在啊。

解决方案三:

对了你第一个错误 com.fishoad.services.QuartzService 这个也没有。

解决方案四:

配置文件路径修正下:classpath:/com/fishoad/dao/*.xml去掉第一个斜杠试试。

解决方案五:

图片说明](http://img.ask.csdn.net/upload/201605/02/1462120759_183219.png)


时间: 2024-11-27 16:37:59

spring-mybatis.xml配置出错了,请大神看看的相关文章

做错了请大神帮忙解决问题java

问题描述 做错了请大神帮忙解决问题java DSAJKHUI发货我jqehwuwqop9dcuiofjopasfhUI黑的啊啊你还覅迷城UI一uihvusadf i tgerqwt 解决方案 http://www.cnblogs.com/linlf03/archive/2013/01/17/2865251.html 解决方案二: 把scanner.next 换成 scanner.nextLine(): next()一定要读取到有效字符后才可以结束输入,对输入有效字符之前遇到的空格键.Tab键或E

gradle构建spring源码报错,请大神指教

问题描述 spring源码版本:spring-framework-4.0.6.RELEASEgradle版本:gradle-1.12错误如下:MicrosoftWindows[版本6.1.7601]版权所有(c)2009MicrosoftCorporation.保留所有权利.C:UsersAdministrator>gradletasks:tasks------------------------------------------------------------Alltasksrunnab

struts2 0-spring+struts+hibernate整合问题,请大神帮忙!

问题描述 spring+struts+hibernate整合问题,请大神帮忙! 求大神解答,兄弟初学ssh,今天整合他们三个.报错很多,但是最后竟然可以正确运行(我只实现了一个从数据库读用户名密码来登陆的功能.) 报错如下:(其中第一个错误就是Could not open ServletContext resource [/WEB-INF/applicationContext.xml],我在这个目录下有这个文件的. 而且我的web.xml里有这些内容. contextConfigLocation

xml-XML文件问题,请大神看下并帮忙解释下,感激不尽

问题描述 XML文件问题,请大神看下并帮忙解释下,感激不尽 XML文件问题,下边两段bean代码,我新手不理解,请大神看下并帮忙解释下,感激不尽 <bean id="dingDanDengJiDao" class="com.sysgrrj.module.DingDanDengJi.dao.DingDanDengJiDao"> <property name="sessionFactory"> <ref bean=&qu

我用spring mvc+mybatis整合为什么出这个错误,是不是路径错误?我是新手,请大神指教

问题描述 我用spring mvc+mybatis整合为什么出这个错误,是不是路径错误?我是新手,请大神指教 org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:JAVANewWorkspace.metadata.pluginsorg.eclipse.wst.server.coretmp0wtpwebappsstudent

springmvc 事务-springmvc+mybatis 事务该怎么配置,请大神详细解答 谢啦

问题描述 springmvc+mybatis 事务该怎么配置,请大神详细解答 谢啦 我搭建的是maven项目 用springmvc框架 数据库用mybatis管理 ,现在要用到事务了,该怎么配置呢,求大神讲解,每个配置文件该怎么写,还有什么地方该注解什么,详细的说清楚,谢啦 解决方案 <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" > <property

c语言-刚学C,编了个小程序出错了,请大神帮忙看一下。

问题描述 刚学C,编了个小程序出错了,请大神帮忙看一下. 知道长方形的长和宽,求面积和周长 #include main() { float x,y,a,b; printf ("请输入长和宽且用逗号分隔:); scanf ("%f,%f,&x,&y); a=x*y; b=(x+y)*2; printf ("面积=%f,周长=%fn",a,b); } 解决方案 错误一:include后面缺少头文件包含 错误二:printf中没有右半边的引号 错误三:sc

汇编语言-请大神们帮我看一下这个程序哪出错了,万分感谢!!

问题描述 请大神们帮我看一下这个程序哪出错了,万分感谢!! STACK1 SEGMENT STACK DW 200 DUP (?) STACK1 ENDS DATA SEGMENT SPACE DB 1000 DUP (' ') PATTERN DB 6 DUP (' '),0C9H,26 DUP (0CDH),0BBH,6 DUP (' ') DB 6 DUP (' '),0BAH,26 DUP (20H),0BAH,6 DUP (' ') DB 6 DUP (' '),0C8H,26 DUP

spring和hibernate整合出错,请大神帮忙解决,谢谢

问题描述 spring和hibernate整合出错,请大神帮忙解决,谢谢 <!-- Hibernate和spring整合的配置 配置SessionFactory --> <!-- 指定hibernate的配置文件位置 --> <!-- 配置c3p0数据库连接池 --> <!--通过反射设置set方法--> <!-- 数据连接信息 --> <!-- 其他配置 --> <!-- 初始化时获取三个连接,取值应在minPoolSize与