In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Maven+mybatis+spring encountered the following error during development:
Org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'xxxService': Unsatisfied dependency expressed through field' xxxMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxxMapper' defined in file [xxxMapper.class]: Cannot resolve reference to bean' sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name' sqlSessionFactory' defined in class path resource [xxx-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/xxx/xxx/mapping/*.xml]: classpath resource [com/xxx/xxx/mapping/] cannot be resolved to URL because it does not exist
After checking, it is found that after maven compilation, the xml file is not packaged to the output path, resulting in the failure of bean creation.
So the solution is to add the following code to the pom file:
... Src/main/java * * / * .xml true...
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.