u013213140
zdomo
采纳率25%
2018-02-01 06:12 阅读 1.9k
已采纳

spring boot 单元测试出错

5

2018-02-01 14:08:03.005 WARN 34600 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1406, SQLState: 22001
2018-02-01 14:08:03.005 ERROR 34600 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : Data truncation: Data too long for column 'name' at row 1
2018-02-01 14:08:03.007 WARN 34600 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Warning Code: 1406, SQLState: HY000
2018-02-01 14:08:03.008 WARN 34600 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : Data too long for column 'name' at row 1
2018-02-01 14:08:03.019 INFO 34600 --- [ main] o.s.t.c.transaction.TransactionContext : Rolled back transaction for test context [DefaultTestContext@5a8e6209 testClass = ApplicationTests, testInstance = com.didispace.ApplicationTests@4f970963, testMethod = test@ApplicationTests, testException = org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.DataException: could not execute statement, mergedContextConfiguration = [MergedContextConfiguration@4b4523f8 testClass = ApplicationTests, locations = '{}', classes = '{class com.didispace.Application}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.boot.test.SpringApplicationContextLoader', parent = [null]]].
2018-02-01 14:08:03.029 INFO 34600 --- [ Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@20d28811: startup date [Thu Feb 01 14:07:59 GMT+08:00 2018]; root of context hierarchy
2018-02-01 14:08:03.035 INFO 34600 --- [ Thread-2] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

5条回答 默认 最新

  • 已采纳
    xcg132566 同是天涯程序猿 2018-02-02 01:24

    插入字段name过长,超过数据库表结构字段长度

    点赞 1 评论 复制链接分享
  • shizhiyuan_2011 shizhiyuan_2011 2018-02-01 07:40

    检查一下你的数据表吧,某个字段类型不符的问题

    点赞 1 评论 复制链接分享
  • u014794644 瓦史托德 2018-02-01 10:19

    2018-02-01 14:08:03.005 ERROR 34600 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : Data truncation: Data too long for column 'name' at row 1

    点赞 1 评论 复制链接分享
  • u013213140 zdomo 2018-02-01 06:16

    spring boot 操作mongodb出错:2018-02-01 14:13:21.542 INFO 37436 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@4b5a5ed1: startup date [Thu Feb 01 14:13:21 GMT+08:00 2018]; root of context hierarchy
    2018-02-01 14:13:23.308 INFO 37436 --- [ main] com.didispace.ApplicationTests : Started ApplicationTests in 2.102 seconds (JVM running for 2.695)
    2018-02-01 14:13:23.526 INFO 37436 --- [ Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@4b5a5ed1: startup date [Thu Feb 01 14:13:21 GMT+08:00 2018]; root of context hierarchy

    点赞 评论 复制链接分享
  • u010496857 u010496857 2018-02-01 06:43

    spring boot 操作mongodb出错:2018-02-01 14:13:21.542 INFO 37436 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@4b5a5ed1: startup date [Thu Feb 01 14:13:21 GMT+08:00 2018]; root of context hierarchy
    2018-02-01 14:13:23.308 INFO 37436 --- [ main] com.didispace.ApplicationTests : Started ApplicationTests in 2.102 seconds (JVM running for 2.695)
    2018-02-01 14:13:23.526 INFO 37436 --- [ Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@4b5a5ed1: startup date [Thu Feb 01 14:13:21 GMT+08:00 2018]; root of context hierarchy

    点赞 评论 复制链接分享

相关推荐