[WEB-INF/ftl] cannot be resolved to URL because it does not exist

[WEB-INF/ftl] cannot be resolved to URL because it does not exist

C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2021.3.2\lib\idea_rt.jar=61520:C:\Program Files\JetBrains\IntelliJ IDEA 2021.3.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2021.3.2\lib\idea_rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2021.3.2\plugins\junit\lib\junit5-rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2021.3.2\plugins\junit\lib\junit-rt.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\charsets.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\ext\access-bridge-64.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\ext\cldrdata.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\ext\dnsns.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\ext\jaccess.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\ext\jfxrt.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\ext\localedata.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\ext\nashorn.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\ext\sunec.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\ext\sunjce_provider.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\ext\sunmscapi.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\ext\sunpkcs11.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\ext\zipfs.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\jce.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\jfr.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\jfxswt.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\jsse.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\management-agent.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\resources.jar;C:\Users\dxz-DC\.jdks\corretto-1.8.0_322\jre\lib\rt.jar;C:\Users\dxz-DC\eclipse-workspace\imooc-reader\target\test-classes;C:\Users\dxz-DC\eclipse-workspace\imooc-reader\target\classes;C:\Users\dxz-DC\.m2\repository\org\springframework\spring-webmvc\5.2.6.RELEASE\spring-webmvc-5.2.6.RELEASE.jar;C:\Users\dxz-DC\.m2\repository\org\springframework\spring-aop\5.2.6.RELEASE\spring-aop-5.2.6.RELEASE.jar;C:\Users\dxz-DC\.m2\repository\org\springframework\spring-beans\5.2.6.RELEASE\spring-beans-5.2.6.RELEASE.jar;C:\Users\dxz-DC\.m2\repository\org\springframework\spring-context\5.2.6.RELEASE\spring-context-5.2.6.RELEASE.jar;C:\Users\dxz-DC\.m2\repository\org\springframework\spring-core\5.2.6.RELEASE\spring-core-5.2.6.RELEASE.jar;C:\Users\dxz-DC\.m2\repository\org\springframework\spring-jcl\5.2.6.RELEASE\spring-jcl-5.2.6.RELEASE.jar;C:\Users\dxz-DC\.m2\repository\org\springframework\spring-expression\5.2.6.RELEASE\spring-expression-5.2.6.RELEASE.jar;C:\Users\dxz-DC\.m2\repository\org\springframework\spring-web\5.2.6.RELEASE\spring-web-5.2.6.RELEASE.jar;C:\Users\dxz-DC\.m2\repository\org\freemarker\freemarker\2.3.31\freemarker-2.3.31.jar;C:\Users\dxz-DC\.m2\repository\org\springframework\spring-context-support\5.2.6.RELEASE\spring-context-support-5.2.6.RELEASE.jar;C:\Users\dxz-DC\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.11.0\jackson-core-2.11.0.jar;C:\Users\dxz-DC\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.11.0\jackson-annotations-2.11.0.jar;C:\Users\dxz-DC\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.11.0\jackson-databind-2.11.0.jar;C:\Users\dxz-DC\.m2\repository\org\springframework\spring-jdbc\5.2.6.RELEASE\spring-jdbc-5.2.6.RELEASE.jar;C:\Users\dxz-DC\.m2\repository\org\springframework\spring-tx\5.2.6.RELEASE\spring-tx-5.2.6.RELEASE.jar;C:\Users\dxz-DC\.m2\repository\org\mybatis\mybatis\3.5.9\mybatis-3.5.9.jar;C:\Users\dxz-DC\.m2\repository\org\mybatis\mybatis-spring\2.0.3\mybatis-spring-2.0.3.jar;C:\Users\dxz-DC\.m2\repository\mysql\mysql-connector-java\8.0.26\mysql-connector-java-8.0.26.jar;C:\Users\dxz-DC\.m2\repository\com\google\protobuf\protobuf-java\3.11.4\protobuf-java-3.11.4.jar;C:\Users\dxz-DC\.m2\repository\com\alibaba\druid\1.2.8\druid-1.2.8.jar;C:\Users\dxz-DC\.m2\repository\org\springframework\spring-test\5.2.6.RELEASE\spring-test-5.2.6.RELEASE.jar;C:\Users\dxz-DC\.m2\repository\junit\junit\4.12\junit-4.12.jar;C:\Users\dxz-DC\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;C:\Users\dxz-DC\.m2\repository\javax\servlet\javax.servlet-api\3.1.0\javax.servlet-api-3.1.0.jar;C:\Users\dxz-DC\.m2\repository\ch\qos\logback\logback-classic\1.2.9\logback-classic-1.2.9.jar;C:\Users\dxz-DC\.m2\repository\ch\qos\logback\logback-core\1.2.9\logback-core-1.2.9.jar;C:\Users\dxz-DC\.m2\repository\org\slf4j\slf4j-api\1.7.32\slf4j-api-1.7.32.jar;C:\Users\dxz-DC\.m2\repository\com\baomidou\mybatis-plus\3.3.2\mybatis-plus-3.3.2.jar;C:\Users\dxz-DC\.m2\repository\com\baomidou\mybatis-plus-extension\3.3.2\mybatis-plus-extension-3.3.2.jar;C:\Users\dxz-DC\.m2\repository\com\baomidou\mybatis-plus-core\3.3.2\mybatis-plus-core-3.3.2.jar;C:\Users\dxz-DC\.m2\repository\com\baomidou\mybatis-plus-annotation\3.3.2\mybatis-plus-annotation-3.3.2.jar;C:\Users\dxz-DC\.m2\repository\com\github\jsqlparser\jsqlparser\3.1\jsqlparser-3.1.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 com.imooc.reader.service.CategoryServiceImplTest,testSelectAll

21:53:13 DEBUG [main] o.s.t.c.j.SpringJUnit4ClassRunner -SpringJUnit4ClassRunner constructor called with [class com.imooc.reader.service.CategoryServiceImplTest]

21:53:13 DEBUG [main] o.s.t.context.BootstrapUtils -Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]

21:53:13 DEBUG [main] o.s.t.context.BootstrapUtils -Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]

21:53:13 DEBUG [main] o.s.t.context.BootstrapUtils -Instantiating TestContextBootstrapper for test class [com.imooc.reader.service.CategoryServiceImplTest] from class [org.springframework.test.context.support.DefaultTestContextBootstrapper]

21:53:13 DEBUG [main] o.s.t.c.s.AbstractDelegatingSmartContextLoader -Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@3ecd23d9 declaringClass = 'com.imooc.reader.service.CategoryServiceImplTest', classes = '{}', locations = '{classpath:applicationContext.xml}', inheritLocations = true, initializers = '{}', inheritInitializers = true, name = [null], contextLoaderClass = 'org.springframework.test.context.ContextLoader'].

21:53:13 DEBUG [main] o.s.t.c.s.ActiveProfilesUtils -Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [com.imooc.reader.service.CategoryServiceImplTest]

21:53:13 DEBUG [main] o.s.t.c.s.DefaultTestContextBootstrapper -@TestExecutionListeners is not present for class [com.imooc.reader.service.CategoryServiceImplTest]: using defaults.

21:53:13 INFO  [main] o.s.t.c.s.DefaultTestContextBootstrapper -Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener]

21:53:13 INFO  [main] o.s.t.c.s.DefaultTestContextBootstrapper -Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@588df31b, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@33b37288, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@77a57272, org.springframework.test.context.support.DirtiesContextTestExecutionListener@7181ae3f, org.springframework.test.context.transaction.TransactionalTestExecutionListener@46238e3f, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@6e2c9341, org.springframework.test.context.event.EventPublishingTestExecutionListener@32464a14]

21:53:13 DEBUG [main] o.s.t.a.ProfileValueUtils -Retrieved @ProfileValueSourceConfiguration [null] for test class [com.imooc.reader.service.CategoryServiceImplTest]

21:53:13 DEBUG [main] o.s.t.a.ProfileValueUtils -Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.imooc.reader.service.CategoryServiceImplTest]

21:53:13 DEBUG [main] o.s.t.a.ProfileValueUtils -Retrieved @ProfileValueSourceConfiguration [null] for test class [com.imooc.reader.service.CategoryServiceImplTest]

21:53:13 DEBUG [main] o.s.t.a.ProfileValueUtils -Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.imooc.reader.service.CategoryServiceImplTest]

21:53:13 DEBUG [main] o.s.t.a.ProfileValueUtils -Retrieved @ProfileValueSourceConfiguration [null] for test class [com.imooc.reader.service.CategoryServiceImplTest]

21:53:13 DEBUG [main] o.s.t.a.ProfileValueUtils -Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.imooc.reader.service.CategoryServiceImplTest]

21:53:13 DEBUG [main] o.s.t.a.ProfileValueUtils -Retrieved @ProfileValueSourceConfiguration [null] for test class [com.imooc.reader.service.CategoryServiceImplTest]

21:53:13 DEBUG [main] o.s.t.a.ProfileValueUtils -Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.imooc.reader.service.CategoryServiceImplTest]

21:53:13 DEBUG [main] o.s.t.c.s.AbstractDirtiesContextTestExecutionListener -Before test class: context [DefaultTestContext@80ec1f8 testClass = CategoryServiceImplTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]], attributes = map[[empty]]], class annotated with @DirtiesContext [false] with mode [null].

21:53:13 DEBUG [main] o.s.t.a.ProfileValueUtils -Retrieved @ProfileValueSourceConfiguration [null] for test class [com.imooc.reader.service.CategoryServiceImplTest]

21:53:13 DEBUG [main] o.s.t.a.ProfileValueUtils -Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.imooc.reader.service.CategoryServiceImplTest]

21:53:13 DEBUG [main] o.s.t.c.s.DependencyInjectionTestExecutionListener -Performing dependency injection for test context [[DefaultTestContext@80ec1f8 testClass = CategoryServiceImplTest, testInstance = null(com.imooc.reader.service.CategoryServiceImplTest), testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]], attributes = map[[empty]]]].

21:53:13 DEBUG [main] o.s.t.c.s.AbstractDelegatingSmartContextLoader -Delegating to GenericXmlContextLoader to load context from [MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]].

21:53:13 DEBUG [main] o.s.t.c.s.AbstractGenericContextLoader -Loading ApplicationContext for merged context configuration [[MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]].

21:53:13 DEBUG [main] o.s.c.env.StandardEnvironment -Activating profiles []

21:53:13 DEBUG [main] o.s.c.a.ClassPathBeanDefinitionScanner -Identified candidate component class: file [C:\Users\dxz-DC\eclipse-workspace\imooc-reader\target\classes\com\imooc\reader\controller\TestController.class]

21:53:13 DEBUG [main] o.s.c.a.ClassPathBeanDefinitionScanner -Identified candidate component class: file [C:\Users\dxz-DC\eclipse-workspace\imooc-reader\target\classes\com\imooc\reader\service\CategoryServiceImpl.class]

21:53:13 DEBUG [main] o.s.c.a.ClassPathBeanDefinitionScanner -Identified candidate component class: file [C:\Users\dxz-DC\eclipse-workspace\imooc-reader\target\classes\com\imooc\reader\service\TestService.class]

21:53:13 DEBUG [main] o.s.b.f.x.XmlBeanDefinitionReader -Loaded 35 bean definitions from class path resource [applicationContext.xml]

21:53:13 DEBUG [main] o.s.c.s.GenericApplicationContext -Refreshing org.springframework.context.support.GenericApplicationContext@1b68b9a4

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'

21:53:13 DEBUG [main] o.a.ibatis.logging.LogFactory -Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.

21:53:13 DEBUG [main] o.m.s.m.ClassPathMapperScanner -Identified candidate component class: file [C:\Users\dxz-DC\eclipse-workspace\imooc-reader\target\classes\com\imooc\reader\mapper\CategoryMapper.class]

21:53:13 DEBUG [main] o.m.s.m.ClassPathMapperScanner -Identified candidate component class: file [C:\Users\dxz-DC\eclipse-workspace\imooc-reader\target\classes\com\imooc\reader\mapper\TestMapper.class]

21:53:13 DEBUG [main] o.m.s.m.ClassPathMapperScanner -Creating MapperFactoryBean with name 'categoryMapper' and 'com.imooc.reader.mapper.CategoryMapper' mapperInterface

21:53:13 DEBUG [main] o.m.s.m.ClassPathMapperScanner -Enabling autowire by type for MapperFactoryBean with name 'categoryMapper'.

21:53:13 DEBUG [main] o.m.s.m.ClassPathMapperScanner -Creating MapperFactoryBean with name 'testMapper' and 'com.imooc.reader.mapper.TestMapper' mapperInterface

21:53:13 DEBUG [main] o.m.s.m.ClassPathMapperScanner -Enabling autowire by type for MapperFactoryBean with name 'testMapper'.

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerProcessor'

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerFactory'

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.transaction.config.internalTransactionalEventListenerFactory'

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.aop.config.internalAutoProxyCreator'

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'testController'

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0'

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'categoryService'

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'categoryMapper'

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'sessionFactory'

21:53:13 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'dataSource'

21:53:14 DEBUG [main] c.b.m.e.s.MybatisSqlSessionFactoryBean -Parsed configuration file: 'class path resource [mybatis-config.xml]'

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.insert

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.delete

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.deleteByMap

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.deleteById

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.deleteBatchIds

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.update

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.updateById

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.selectById

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.selectBatchIds

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.selectByMap

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.selectOne

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.selectCount

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.selectMaps

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.selectMapsPage

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.selectObjs

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.selectList

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.CategoryMapper.selectPage

21:53:14 DEBUG [main] c.b.m.e.s.MybatisSqlSessionFactoryBean -Parsed mapper file: 'file [C:\Users\dxz-DC\eclipse-workspace\imooc-reader\target\classes\mappers\category.xml]'

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.insertSample

21:53:14 WARN  [main] c.b.m.c.m.TableInfoHelper -This "id" is the table primary key by @TableId annotation in Class: "com.imooc.reader.entity.Test",So @TableField annotation will not work!

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.insert

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.delete

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.deleteByMap

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.deleteById

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.deleteBatchIds

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.update

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.updateById

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.selectById

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.selectBatchIds

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.selectByMap

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.selectOne

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.selectCount

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.selectMaps

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.selectMapsPage

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.selectObjs

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.selectList

21:53:14 DEBUG [main] c.b.m.c.MybatisConfiguration -addMappedStatement: com.imooc.reader.mapper.TestMapper.selectPage

21:53:14 DEBUG [main] c.b.m.e.s.MybatisSqlSessionFactoryBean -Parsed mapper file: 'file [C:\Users\dxz-DC\eclipse-workspace\imooc-reader\target\classes\mappers\test.xml]'

 _ _   |_  _ _|_. ___ _ |    _ 

| | |\/|_)(_| | |_\  |_)||_|_\ 

     /               |         

                        3.3.2 

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'testService'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'testMapper'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.transaction.interceptor.TransactionInterceptor#0'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'mvcContentNegotiationManager'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'mvcCorsConfigurations'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.web.servlet.handler.MappedInterceptor#0'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.format.support.FormattingConversionServiceFactoryBean#0'

21:53:15 DEBUG [main] o.s.w.s.m.m.a.RequestMappingHandlerMapping -2 mappings in 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter'

21:53:15 DEBUG [main] o.s.w.s.m.m.a.RequestMappingHandlerAdapter -ControllerAdvice beans: 0 @ModelAttribute, 0 @InitBinder, 1 RequestBodyAdvice, 1 ResponseBodyAdvice

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'mvcUriComponentsContributor'

21:53:15 DEBUG [main] o.s.w.s.m.m.a.RequestMappingHandlerAdapter -ControllerAdvice beans: 0 @ModelAttribute, 0 @InitBinder, 1 RequestBodyAdvice, 1 ResponseBodyAdvice

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0'

21:53:15 DEBUG [main] o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver -ControllerAdvice beans: 0 @ExceptionHandler, 1 ResponseBodyAdvice

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0'

21:53:15 DEBUG [main] o.s.w.s.h.SimpleUrlHandlerMapping -Patterns [/**] in 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'freemarkerConfig'

21:53:15 DEBUG [main] o.s.w.s.v.f.FreeMarkerConfigurer -Cannot resolve template loader path [/WEB-INF/ftl] to [java.io.File]: using SpringTemplateLoader as fallback

java.io.FileNotFoundException: class path resource [WEB-INF/ftl] cannot be resolved to URL because it does not exist

at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:195)

at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:150)

at org.springframework.ui.freemarker.FreeMarkerConfigurationFactory.getTemplateLoaderForPath(FreeMarkerConfigurationFactory.java:345)

at org.springframework.ui.freemarker.FreeMarkerConfigurationFactory.createConfiguration(FreeMarkerConfigurationFactory.java:297)

at org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer.afterPropertiesSet(FreeMarkerConfigurer.java:120)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:895)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)

at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:128)

at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)

at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:275)

at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:243)

at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)

at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)

at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:123)

at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118)

at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)

at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:244)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)

at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)

at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)

at org.junit.runners.ParentRunner.run(ParentRunner.java:363)

at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)

at org.junit.runner.JUnitCore.run(JUnitCore.java:137)

at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)

at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)

at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)

at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)

at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)

at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)

21:53:15 DEBUG [main] o.s.u.f.SpringTemplateLoader -SpringTemplateLoader for FreeMarker: using resource loader [org.springframework.context.support.GenericApplicationContext@1b68b9a4, started on Thu Jul 14 21:53:13 CST 2022] and template loader path [/WEB-INF/ftl/]

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'ViewResolver'

21:53:15 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory -Creating shared instance of singleton bean 'transactionManager'

21:53:15 DEBUG [main] o.s.t.c.c.DefaultCacheAwareContextLoaderDelegate -Storing ApplicationContext [459848100] in cache under key [[MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]

21:53:15 DEBUG [main] o.s.test.context.cache -Spring test ApplicationContext cache statistics: [DefaultContextCache@b273a59 size = 1, maxSize = 32, parentContextCount = 0, hitCount = 0, missCount = 1]

21:53:15 DEBUG [main] o.s.t.c.c.DefaultCacheAwareContextLoaderDelegate -Retrieved ApplicationContext [459848100] from cache with key [[MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]

21:53:15 DEBUG [main] o.s.test.context.cache -Spring test ApplicationContext cache statistics: [DefaultContextCache@b273a59 size = 1, maxSize = 32, parentContextCount = 0, hitCount = 1, missCount = 1]

21:53:15 DEBUG [main] o.s.t.c.s.AbstractDirtiesContextTestExecutionListener -Before test method: context [DefaultTestContext@80ec1f8 testClass = CategoryServiceImplTest, testInstance = null(com.imooc.reader.service.CategoryServiceImplTest), testMethod = testSelectAll@CategoryServiceImplTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]], attributes = map[[empty]]], class annotated with @DirtiesContext [false] with mode [null], method annotated with @DirtiesContext [false] with mode [null].

21:53:15 DEBUG [main] o.s.t.c.c.DefaultCacheAwareContextLoaderDelegate -Retrieved ApplicationContext [459848100] from cache with key [[MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]

21:53:15 DEBUG [main] o.s.test.context.cache -Spring test ApplicationContext cache statistics: [DefaultContextCache@b273a59 size = 1, maxSize = 32, parentContextCount = 0, hitCount = 2, missCount = 1]

21:53:15 DEBUG [main] o.s.t.c.c.DefaultCacheAwareContextLoaderDelegate -Retrieved ApplicationContext [459848100] from cache with key [[MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]

21:53:15 DEBUG [main] o.s.test.context.cache -Spring test ApplicationContext cache statistics: [DefaultContextCache@b273a59 size = 1, maxSize = 32, parentContextCount = 0, hitCount = 3, missCount = 1]

21:53:15 DEBUG [main] o.m.spring.SqlSessionUtils -Creating a new SqlSession

21:53:15 DEBUG [main] o.m.spring.SqlSessionUtils -Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2617f816]

21:53:15 DEBUG [main] o.s.j.d.DataSourceUtils -Fetching JDBC Connection from DataSource

21:53:16 INFO  [main] c.a.druid.pool.DruidDataSource -{dataSource-1} inited

21:53:16 DEBUG [main] o.m.s.t.SpringManagedTransaction -JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@1a5f7e7c] will be managed by Spring

21:53:16 DEBUG [main] c.i.r.m.C.selectList -==>  Preparing: SELECT category_id,category_name FROM category

21:53:16 DEBUG [main] c.i.r.m.C.selectList -==> Parameters: 

21:53:16 DEBUG [main] c.i.r.m.C.selectList -<==      Total: 4

21:53:16 DEBUG [main] o.m.spring.SqlSessionUtils -Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2617f816]

21:53:16 DEBUG [main] o.m.spring.SqlSessionUtils -Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2617f816]

21:53:16 DEBUG [main] o.m.spring.SqlSessionUtils -Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2617f816]

[com.imooc.reader.entity.Category@51e0301d, com.imooc.reader.entity.Category@47d7bfb3, com.imooc.reader.entity.Category@770b3be0, com.imooc.reader.entity.Category@1eb6e1c]

21:53:16 DEBUG [main] o.s.t.c.c.DefaultCacheAwareContextLoaderDelegate -Retrieved ApplicationContext [459848100] from cache with key [[MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]

21:53:16 DEBUG [main] o.s.test.context.cache -Spring test ApplicationContext cache statistics: [DefaultContextCache@b273a59 size = 1, maxSize = 32, parentContextCount = 0, hitCount = 4, missCount = 1]

21:53:16 DEBUG [main] o.s.t.c.c.DefaultCacheAwareContextLoaderDelegate -Retrieved ApplicationContext [459848100] from cache with key [[MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]

21:53:16 DEBUG [main] o.s.test.context.cache -Spring test ApplicationContext cache statistics: [DefaultContextCache@b273a59 size = 1, maxSize = 32, parentContextCount = 0, hitCount = 5, missCount = 1]

21:53:16 DEBUG [main] o.s.t.c.s.AbstractDirtiesContextTestExecutionListener -After test method: context [DefaultTestContext@80ec1f8 testClass = CategoryServiceImplTest, testInstance = null(com.imooc.reader.service.CategoryServiceImplTest), testMethod = testSelectAll@CategoryServiceImplTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]], attributes = map[[empty]]], class annotated with @DirtiesContext [false] with mode [null], method annotated with @DirtiesContext [false] with mode [null].

21:53:16 DEBUG [main] o.s.t.c.c.DefaultCacheAwareContextLoaderDelegate -Retrieved ApplicationContext [459848100] from cache with key [[MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]

21:53:16 DEBUG [main] o.s.test.context.cache -Spring test ApplicationContext cache statistics: [DefaultContextCache@b273a59 size = 1, maxSize = 32, parentContextCount = 0, hitCount = 6, missCount = 1]

21:53:16 DEBUG [main] o.s.t.c.s.AbstractDirtiesContextTestExecutionListener -After test class: context [DefaultTestContext@80ec1f8 testClass = CategoryServiceImplTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@1445d7f testClass = CategoryServiceImplTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]], attributes = map[[empty]]], class annotated with @DirtiesContext [false] with mode [null].

21:53:16 DEBUG [SpringContextShutdownHook] o.s.c.s.GenericApplicationContext -Closing org.springframework.context.support.GenericApplicationContext@1b68b9a4, started on Thu Jul 14 21:53:13 CST 2022

21:53:16 INFO  [SpringContextShutdownHook] c.a.druid.pool.DruidDataSource -{dataSource-1} closing ...

21:53:16 INFO  [SpringContextShutdownHook] c.a.druid.pool.DruidDataSource -{dataSource-1} closed


Process finished with exit code 0


非常郁闷!以下未我的applicationContext.xml下的配置 明明是有WEB-INF/ftl的设置


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:task="http://www.springframework.org/schema/task"
       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/task
            http://www.springframework.org/schema/task/spring-task.xsd
            http://www.springframework.org/schema/mvc
            http://www.springframework.org/schema/mvc/spring-mvc.xsd
            http://www.springframework.org/schema/tx
            http://www.springframework.org/schema/tx/spring-tx.xsd">
    <!--3.开启SpringMVC注解模式-->
    <context:component-scan base-package="com.imooc"/>
    <mvc:annotation-driven>
        <mvc:message-converters>
            <bean class="org.springframework.http.converter.StringHttpMessageConverter">
                <property name="supportedMediaTypes">
                    <list>
                        <value>text/html;charset=utf-8</value>
                        <!--6.JSON(Jackson)序列化输出配置 -->
                        <value>application/json;charset=utf-8</value>
                    </list>
                </property>
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>
    <mvc:default-servlet-handler/>
    <!-- 5.配置Freemarker模板引擎 -->
    <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
        <property name="templateLoaderPath" value="/WEB-INF/ftl"/>
        <property name="freemarkerSettings">
            <props>
                <prop key="defaultEncoding">UTF-8</prop>
            </props>
        </property>
    </bean>
    <bean id="ViewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
        <property name="contentType" value="text/html;charset=utf-8"/>
        <property name="suffix" value=".ftl"/>
    </bean>
    <!-- MyBatis与Spring的整合配置 -->
    <!--2.配置数据源-->
    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
        <property name="driverClassName" value="com.mysql.cj.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://localhost:3306/imooc_reader?useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=Asia/Shanghai&amp;allowPublicKeyRetrieval=true"/>
        <property name="username" value="root"/>
        <property name="password" value="abc123456"/>
        <property name="initialSize" value="10"/>
        <property name="maxActive" value="20"/>
    </bean>
    <!-- 3. SqlSessionFactoryBean用于根据配置信息创建SqlSessionFactory,不再需要我们自己编码创建 -->
    <!-- 原生Mybaits与Spring整合
    <bean id="sessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    -->
    <bean id="sessionFactory" class="com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="mapperLocations" value="classpath:mappers/*.xml"/>
        <!-- 5.MyBatis配置文件地址 -->
        <property name="configLocation" value="classpath:mybatis-config.xml"/>
    </bean>
    <!--4.配置Mapper扫描器 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="com.imooc.reader.mapper"/>
    </bean>
    <!--声明式事务配置-->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <tx:annotation-driven transaction-manager="transactionManager"/>
</beans>

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕小蓝 2022-07-15 09:50:52

同学你好,出现这个报错是因为测试类能够正常读取src/main/resources下的内容,但是模板文件,是放在 webapp/WEB-INF/ftl 目录下的,所以会出现不能正确读取的现象。如果把模板文件,放在resources目录下,并且建立名为“WEB-INF/ftl”的目录,将模板文件放在其中,就可以读取的,比如:

https://img1.sycdn.imooc.com//climg/5f472f7d090abefd00000000.jpg

祝学习愉快~

  • 提问者 晓舟 #1

    WEB-INF不是默认放在webapp下的吗?也就是还要复制同一个目录到resources下了?

    2022-07-15 09:54:10
  • 好帮手慕小蓝 回复 提问者 晓舟 #2

    同学你好,是这样的,需要复制一份过去。

    这是因为在使用单元测试时,是不启动Tomcat服务器的,所以在索引文件时是从src作为根进行的。但是实际项目运行时,在Tomcat服务器上,索引文件是以webapp作为根的。

    此时就会出现,如果src下没有相同结构的目录和文件,使用单元测试无法读取文件的问题。

    祝学习愉快~

    2022-07-15 10:40:13
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师