springboot集成mybatis报错

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-11-08 12:19:00.690 [main] ERROR org.springframework.boot.SpringApplication - Application startup failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties': Initialization of bean failed; nested exception is java.lang.StackOverflowError
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:723

            at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties': Initialization of bean failed; nested exception is java.lang.StackOverflowError
at org.springframework.beans.factory.support.AbstractAutow

                    ... 60 common frames omitted

Caused by: java.lang.StackOverflowError: null
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.naming.internal.VersionHelper12.getJndiProperties(VersionHelper12.java:105)
at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:216)
at javax.naming.InitialContext.init(InitialContext.java:240)

2个回答

jvm参数贴出来看看,应该是堆栈内存不够

what_we_are
what_we_are 这个和堆栈有关吗?不是mybatis配置问题吗?我在tomcat的catalina.sh文件里面设置了JAVA_OPTS=-Xms256m -Xmx512m 启动也是这个错误
接近 2 年之前 回复

知道了,,之前建项目时在intellj上面选择的springboot版本是2.0.0.m5,到官网上去看没有这个版本,有的是2.0.0.m6,换一下springboot版本就没问题了。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
SpringBoot集成Mybatis报错,有没有人遇到过
spring boot 集成mybatis报错,有没有大神遇到过,指导一下,谢谢n下面是报错信息n . ____ _ __ _ _n /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \n ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \n \\/ ___)| |_)| | | | | || (_| | ) ) ) )n ' |____| .__|_| |_|_| |_\__, | / / / /n =========|_|==============|___/=/_/_/_/n :: Spring Boot :: (v1.5.6.RELEASE)n n 2017-09-07 16:19:23.502 INFO 5220 --- [ main] com.tky.test.TestMacApplication : Starting TestMacApplication on WTB-PC with PID 5220 (D:\work\tky_workspace\test_mac\target\classes started by WTB in D:\work\tky_workspace\test_mac)n 2017-09-07 16:19:23.505 INFO 5220 --- [ main] com.tky.test.TestMacApplication : No active profile set, falling back to default profiles: defaultn 2017-09-07 16:19:23.601 INFO 5220 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@78b66d36: startup date [Thu Sep 07 16:19:23 CST 2017]; root of context hierarchyn 2017-09-07 16:19:25.807 INFO 5220 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8082 (http)n 2017-09-07 16:19:25.826 INFO 5220 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]n 2017-09-07 16:19:25.827 INFO 5220 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.16n 2017-09-07 16:19:25.986 INFO 5220 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContextn 2017-09-07 16:19:25.986 INFO 5220 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2390 msn 2017-09-07 16:19:26.193 INFO 5220 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]n 2017-09-07 16:19:26.198 INFO 5220 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]n 2017-09-07 16:19:26.199 INFO 5220 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]n 2017-09-07 16:19:26.199 INFO 5220 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]n 2017-09-07 16:19:26.199 INFO 5220 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]n 2017-09-07 16:19:26.668 WARN 5220 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'macController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [D:\work\tky_workspace\test_mac\target\classes\com\tky\test\dao\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NoSuchMethodError: org.apache.ibatis.session.Configuration.setVfsImpl(Ljava/lang/Class;)Vn 2017-09-07 16:19:26.672 INFO 5220 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]n 2017-09-07 16:19:26.682 WARN 5220 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:n java.lang.Object.wait(Native Method)n java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)n java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)n com.mysql.jdbc.NonRegisteringDriver$1.run(NonRegisteringDriver.java:93)n 2017-09-07 16:19:26.698 INFO 5220 --- [ main] utoConfigurationReportLoggingInitializer : n n Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.n 2017-09-07 16:19:26.709 ERROR 5220 --- [ main] o.s.boot.SpringApplication : Application startup failedn n org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'macController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [D:\work\tky_workspace\test_mac\target\classes\com\tky\test\dao\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NoSuchMethodError: org.apache.ibatis.session.Configuration.setVfsImpl(Ljava/lang/Class;)Vn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]n at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]n at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]n at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]n at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]n at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]n at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]n at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]n at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]n at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]n at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]n at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]n at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]n at org.springframework.boot.SpringApplication.run(SpringApplication.java:3
springboot 集成mybatis
springboot集成mybatis,转载的别人的,方便使用的人查询
SpringBoot集成Mybatis遇到问题
小白一个,第一次使用springboot,想用mybatis来做dao层框架,按网上资料进行了一下配置但是出现了一个错误,我不知道我的配置错在哪儿,麻烦大神帮忙指导一下,谢谢:napplication.properties配置如下:n mybatis.mapper-locations=classpath:mapper/mapper/*Mapper.xmln mybatis.config-location=classpath:mapper/sqlMapConfig.xmln spring.datasource.url=jdbc:mysql://127.0.0.1:3306/testn spring.datasource.driver-class-name=com.mysql.jdbc.Drivern spring.datasource.username=rootn spring.datasource.password=rootn接着是sqlMapConfig.xml:n n n n n n n n然后是mapp.xml的配置n n n select * from usern n nsercive层代码如下:n package com.tky.test.service;nn import java.util.List;n import javax.annotation.Resource;n import org.springframework.stereotype.Service;n import com.tky.test.dao.UserMapper;n import com.tky.test.emit.User;nn @Service(value="userService")n public class UserServiceImpl implements UserServicen @Resourcen private UserMapper userMapper;n n @Overriden public List findUser() n List findAll = userMapper.findAll();n return findAll;n n n n然后是Mapper接口的代码:n package com.tky.test.dao;n import java.util.List;n import com.tky.test.emit.User;nnn public interface UserMapper n n public List findAll();n n在下面是controller层的:n @RestController(value="userController")n public class UserController n n @Resourcen private UserService userService;n @RequestMapping("my")n public List getMy()n List findUser = userService.findUser();n return findUser;n n n最后是springboot的主函数代码:n import org.apache.ibatis.session.SqlSessionFactory;n import org.mybatis.spring.SqlSessionFactoryBean;n import org.mybatis.spring.annotation.MapperScan;n import org.springframework.boot.SpringApplication;n import org.springframework.boot.autoconfigure.SpringBootApplication;n import org.springframework.context.annotation.Bean;nn @SpringBootApplicationn @MapperScan(value="com.tky.test.dao")n public class Driver n public static void main(String[] args) n //项目入口n SpringApplication.run(Driver.class,args);n n @Beann public SqlSessionFactory sessionFactory() throws Exceptionn SqlSessionFactory sqlSessionFactory = n new SqlSessionFactoryBean().getObject();n return sqlSessionFactory;n nn n最后的报错信息很长是这样的:n org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [D:\work\tky_workspace\Test_SpringBoot\target\classes\com\tky\test\dao\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in com.tky.test.Driver: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sessionFactory' threw exception; nested exception is java.lang.IllegalArgumentException: Property 'dataSource' is requiredn n n有没有大神能看明白的帮忙指导一下,谢谢
springboot集成redis ,mybatis
springboot 集成mybatis ,mybatisPlus redis ,logback 实现多环境配置,及多环境日志配置,以及实现日志彩色打印,注释清楚,一看就会
SpringBoot集成MySQL和Mybatis
SpringBoot集成MySQL和Mybatis,包括sql语句和简单的案例
springBoot集成mybatis与shiro
最近在做一个springBoot集成mybatis与shiro的Demo 但是遇到shiro验证用户名密码一直提示不正确,实在是搞不明白,demo奉上http://pan.baidu.com/s/1jI3m9ZC,望解答,谢谢。
SpringBoot集成Mybatis的xml
SpringBoot集成Mybatis的xml,不是注解方式,而是xml配置文档格式
SpringBoot集成MyBatis实例
Spring Boot和mybatis整合的开发,包含数据库,下载下来即可运行
Springboot集成mybatis常见问题
1.Field shopMapper in com.wmx.demo.service.IServiceImpl required a bean of type 'com.wmx.demo.mapper.ShopMapper' that could not be found. 解决办法:Application上配置@MapperScan(value = “com.wmx.demo.mapper”) ...
springboot集成mybatis
springboot集成mybatis详细教程 可以快速完成springboot集成mybatis
springboot集成mybatis,mysql
eclipse上搭建springboot框架简单集成mybatis,mysql。。。。。。。。。。。。。。
第八节:SpringBoot集成MyBatis
pom.xml org.mybatis.spring.boot mybatis-spring-boot-starter 1.3.1 User实体类 package com.xiaowen.model; public class User { private Integer id; private String name; priva
SpringBoot学习笔记之mybatis集成
SpringBoot学习笔记之mybatis集成
SpringBoot集成MyBatis
<p>rn <span style="color:#3D3D3D;">SpringBoot是企业级开发的整体整合解决方案</span>,在现在企业项目开发中使用非常普遍,可以说现在是Java程序员到了必须学习SpringBoot的时候,本可程内容覆盖SpringBoot基本知识点,涵盖企业日常开发常用的组件,力求轻松应对开发需求,打牢基础知识,熟悉SpringBoot的开发模式,玩转SpringBoot。rn</p>
【笔记】SpringBoot集成Mybatis
1. 使用mysql数据库 建表语句 create table t_user( id bigint(20) primary key AUTO_INCREMENT, name varchar(50) not null comment'用户名', phone varchar(30) not null comment'手机' )ENGINE=InnoDB AUTO_INC...
springboot集成Mybatis的增删改查
注意:在使用mybatis时,要在启动类上加一个mapper扫描注解@MapperScan(“com.example.demo.mapper”) pom.xml中加入插件 &amp;amp;amp;amp;lt;dependency&amp;amp;amp;amp;gt; &amp;amp;amp;amp;lt;groupId&amp;amp;amp;amp;gt;org.mybatis.spring.boot&amp;amp;amp;amp;lt;/groupId&amp;amp;amp;amp
Dubbo SpringBoot集成MyBatis
Dubbo SpringBoot集成MyBatis——Spring Boot Project 使用Dubbo作为RPC Framework 轻松创建Spring Boot应用程序。
SpringBoot:第二篇 集成mybatis
1.添加依赖 &lt;dependency&gt; &lt;groupId&gt;org.mybatis.spring.boot&lt;/groupId&gt; &lt;artifactId&gt;mybatis-spring-boot-starter&lt;/artifactId&gt; &lt;version&gt;2.0.0&lt;/ver...
Springboot集成mybatis注解方式
参考文献: http://blog.csdn.net/gebitan505/article/details/54929287 使用的时候有两个要点:在测试的时候一直报这个错误,后来发现,是因为包名不一致的原因,在Springboot的Application类中上面注释寻找哪个包下的为mapper,所以test类中的包名也要与它一致,不然是无法成功的。 还有启动的时候一下就启动完了
springboot注解方式集成Mybatis
1、pom.xml文件 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
SpringBoot与mybatis结合报错:
项目无缘无故就报了一个这样的错:org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'username' cannot be found on null
springboot整合mybatis报错
[img=https://img-bbs.csdn.net/upload/201704/12/1491993880_491574.png][/img]这个是包结构rnrn[img=https://img-bbs.csdn.net/upload/201704/12/1491994020_725332.png][/img]这个是mybatiscongifg的部分代码rnrn[img=https://img-bbs.csdn.net/upload/201704/12/1491994420_808019.png][/img]这个是MyBatisMapperScannerConfigrnrnrn[img=https://img-bbs.csdn.net/upload/201704/12/1491994475_809940.png][/img]这个是spring.factoriesrnrnrn就是无法先执行mybatiscongifg,之前一直执行的是MyBatisMapperScannerConfig那个类,后来我把他换到另一个包里面,不让那个启动类扫描到,现在这两个mybatis都不执行了rnrnrn求助啊,好焦灼!!!!!rnrnrnrnrnrnrnrnrnrn
springMVC集成mybatis报错
springMVC集成mybatis报错:norg.apache.catalina.core.StandardContext listenerStartn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenernorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'basVideoMapper' defined in file [D:\TOOLS\software\apache-tomcat-7.0.69\wtpwebapps\TanWuAppAPI\WEB-INF\classes\com\tanwuapp\java\BasVideoMapper.class]: Cannot resolve reference to bean 'SqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'SqlSessionFactory' is definedn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)n at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)n at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)n at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)n at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)n at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)n at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)n at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)n at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)n at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)n at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)n at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)n at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)n at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)n at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)n at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)n at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)n at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)n at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:679)n at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1966)n at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)n at java.util.concurrent.FutureTask.run(FutureTask.java:262)n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)n at java.lang.Thread.run(Thread.java:745)nCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'SqlSessionFactory' is definedn at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529)n at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095)n at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277)n at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)n at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)n ... 28 morennnapplicationContext配置文件n```n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n```nspringMVC-servlet配置文件:nn```n n n n n n n n n```nnweb.xmlnn```n n contextConfigLocationn /WEB-INF/applicationContext.xmln n n n org.springframework.web.util.Log4jConfigListener n n n org.springframework.web.context.ContextLoaderListenern n n n org.springframework.web.util.IntrospectorCleanupListenern nn n n CharacterEncodingFiltern org.springframework.web.filter.CharacterEncodingFiltern n encodingn UTF-8n n n forceEncodingn truen n n n CharacterEncodingFiltern /*n n n n SpringMVC n org.springframework.web.servlet.DispatcherServlet n n contextConfigLocation n /WEB-INF/springMVC-servlet.xml n n 1 n n n SpringMVC n *.do n n n n index.jspn nn```nntomcat服务启动时报错,求帮忙看下。nnn
【SpringBoot系列】六、SpringBoot 数据库操作(集成MyBatis)
Spring对持久化的支持,不单只支持JDBC,为各种支持的持久化技术都提供了简单的模板和回调: ORM持久化技术 模板类 JDBC(JdbcTemplate) org.springframework.jdbc.core.JdbcTemplate Hibernate5.0 org.springframework.orm.hibernate5.HibernateTempl...
SpringBoot视频教程_SpringBoot集成MyBatis测试
Spring Boot是Spring家族下的一个全新开发框架,其设计目的主要是用来简化Spring应用的创建及开发过程,它提供了自动配置,起步依赖等特性,从而使开发人员从大量的XML配置中解脱出来,Spring Boot致力于在蓬勃发展的应用开发领域(rapid application development)成为领导者。
springboot集成spring mvc,mybatis
springboot集成spring mvc,mybatis的一个工程demo。maven工程。前端使用freemarker模板。数据库使用mysql。例子要跑起来了,可以添加下面数据库表结构: DROP TABLE IF EXISTS `sys_user`; CREATE TABLE `sys_user` ( `id` int(20) NOT NULL AUTO_INCREMENT COMMENT '用户id', `user_name` varchar(50) DEFAULT NULL, `user_password` varchar(50) DEFAULT NULL, `user_email` varchar(50) DEFAULT NULL, `user_info` text, `head_img` blob, `create_time` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1016 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_user -- ---------------------------- INSERT INTO `sys_user` VALUES ('1', 'admin', '123456', 'admin@mybatis.tk', '管理员', null, '2018-05-09 10:13:20'); INSERT INTO `sys_user` VALUES ('1001', 'test', '123456', 'test@mybatis.tk', '测试用户', null, '2018-05-09 10:13:20'); INSERT INTO `sys_user` VALUES ('1015', 'test1', '123456', 'test1@mybatis.tk', 'test info', 0x010203, '2018-05-15 10:30:39');
Mybatis 的使用(集成Spring、SpringBoot)
Mybatis 的使用(集成Spring、SpringBoot)昨天在学习项目工程时发现项目对mybatis用的还是挺多的,之前也是有用过,觉得还是自己做下笔记记录一下。Mybatis是一个数据访问层框架,和大多数同类框架一样,Mybatis节省了开发人员使用jdbc底层操作数据库很大一部分代码,使用mybatis,开发人员只需要将sql写在配置文件中,并声明该sql返回值和java类型的映射即可...
深入浅出SpringBoot系列--与mybatis集成
[TOC] 本文主要介绍下常见的spring boot与mybatis集成方案,下面简单介绍下集成步骤。spring boot的集成方案不同于传统的spring mvc,基本上是零配置;这个方案中只有数据库连接字符串还放在配置文件中,后续其实在阿波罗配置,实现零配置。 集成步骤 1.POM文件需要引入以下相关的jar: &amp;amp;lt;!-- mybatis配置相关 begin --&amp;amp;gt; ...
springboot集成mybatis问题分享
springboot集成mybatis当项目springboot框架集成mybatis的时候,需要注意以下两点: 1.xml文件编译不到项目中去; 2.mapper接口没有被扫描到; 3.xml文件被编译到项目中,但是没有和mapper形成对应关联关系; 4.xml文件被编译到项目中,但是运行报错提示没有对应的mapper方法; 博主整理经验分享如下: 第一点问题:一般存在于xml定义在项目src...
springboot 集成mybatis配置说明
#默认为开发环境 spring.profiles.active=dev #===server 端口号配置=== server.port=8090 #===mybatis 配置=== # 注意:一定要对应mapper映射xml文件的所在路径 mybatis.mapper-locations=classpath:dao/*.xml,classpath*:mapper/*.xml # 注意:对应实...
springboot系列(一)集成mybatis
springboot在我的理解的话,就是可以使整合主流框架更简单的一个集合框架,而且会使得部署,配置更为简单,并且有内嵌的servlet容器,可以快速地开发一个简单的应用,但是缺点的话也会有,因为高度集成了,所以一出bug,问题会比较难排查,这篇文章写的相对详细,可以看看https://blog.csdn.net/fly_zhyu/article/details/76407830。 然后开始编写...
springboot 集成mybatis自动生成工具
mybatis自动生成工具给我们的开发带来了很大的便利,所以我们希望在实际的项目开发中也可以加入。生成工具可以单独运行,但是需要把生成的文件自行添加到项目对应的包中,比较耗时,所以就把生成工具集成到项目中直接生成到项目对应的包或者类中,比较方便,具体就看下面的代码配置了 1.项目结构 2.pom.xml中加入依赖 &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt...
SpringBoot学习:入门+集成mybatis
文章目录一、什么是springboot二、spring提供了哪些功能三、spring-boot 快速入门3.1、环境要求3.2、创建maven项目(略),导入Spring Boot依赖3.3 、代码测试四、热部署4.1、介绍4.2、添加依赖包五、spring Boot配置5.1、什么是yaml5.2、原则5.3、Spring Boot运行方式和测试5.3.1、运行方式5.3.2、测试5.4、spr...
SpringBoot 集成mybatis完整流程
SpringBoot 集成mybatis,使用maven自动生成工具,生成数据库表对应Java类,Mapper接口及Mapper.xml 1.Pom.xml中配置依赖和mybatis自动生成工具,生成数据库表对应Java类,Mapper接口及Mapper.xml &lt;dependency&gt; &lt;groupId&gt;mysql&lt...
springboot集成mybatis环境Demo
springboot集成mybatis环境Demo。 直接部署即可使用、Eclipse环境 springboot集成mybatis环境 Demospringboot集成mybatis环境Demo
SpringBoot集成MyBatis开启事务
SpringBoot集成MyBatis开启事务
SpringBoot | 第三十五章:Mybatis的集成和使用
2019独角兽企业重金招聘Python工程师标准&gt;&gt;&gt; ...
springboot集成mybatis源码分析(一)
springboot集成mybatis源码分析(一) 本篇文章只是简单接受使用,具体源码解析请看后续文章 1、新建springboot项目,并导入mybatis的pom配置 配置数据库驱动和mybatis dependency &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;org.mybatis.spri...
SpringBoot集成Mybatis配置动态数据源
很多人在项目里边都会用到多个数据源,下面记录一次SpringBoot集成Mybatis配置多数据源的过程。 pom.xml &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://m...
SpringBoot视频教程_SpringBoot集成MyBatis配置
Spring Boot是Spring家族下的一个全新开发框架,其设计目的主要是用来简化Spring应用的创建及开发过程,它提供了自动配置,起步依赖等特性,从而使开发人员从大量的XML配置中解脱出来,Spring Boot致力于在蓬勃发展的应用开发领域(rapid application development)成为领导者。
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview