请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

章节6-7出了一个Closing non transactional SqlSession

检测了一下,代码应该是没有问题的,这个异常百度好像也没找到解决方案,求教
> Preparing: SELECT param_key, param_value FROM sys_config WHERE status = 1;
> Parameters:
< Columns: param_key, param_value
< Row: attendance_start_time, 06:00
<== Row: attendance_time, 08:30
<== Row: attendance_end_time, 09:30
<== Row: closing_start_time, 16:30
<== Row: closing_time, 17:30
<== Row: closing_end_time, 23:59
<== Total: 6
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@791202af]
19:50:55 ERROR 执行异常
java.lang.NoSuchFieldException: attendanceStartTime
at java.lang.Class.getDeclaredField(Class.java:2070)
at com.example.emos.wx.EmosWxApiApplication.lambda$init0(EmosWxApiApplication.java:61)atjava.util.ArrayList.forEach(ArrayList.java:1259)atcom.example.emos.wx.EmosWxApiApplication.init(EmosWxApiApplication.java:56)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:498)atorg.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor0(EmosWxApiApplication.java:61) at java.util.ArrayList.forEach(ArrayList.java:1259) at com.example.emos.wx.EmosWxApiApplication.init(EmosWxApiApplication.java:56) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor0(EmosWxApiApplication.java:61)atjava.util.ArrayList.forEach(ArrayList.java:1259)atcom.example.emos.wx.EmosWxApiApplication.init(EmosWxApiApplication.java:56)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:498)atorg.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessorLifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessorLifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333)atorg.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)atorg.springframework.beans.factory.support.AbstractBeanFactory.lambdaLifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractBeanFactory.lambdaLifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333)atorg.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)atorg.springframework.beans.factory.support.AbstractBeanFactory.lambdadoGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332)
at com.example.emos.wx.EmosWxApiApplication.main(EmosWxApiApplication.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
19:50:55 ERROR 执行异常
java.lang.NoSuchFieldException: attendanceTime

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

1回答

神思者 2021-08-17 20:42:33

检查你代码里面的各种注解

0 回复 有任何疑惑可以回复我~
  • 提问者 慕码人2456996 #1
    Creating a new SqlSession
    SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1d1bf61e] was not registered for synchronization because synchronization is not active
    JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@2252ec27] will not be managed by Spring
    
    视频重看了一边,代码应该是正确的
    回复 有任何疑惑可以回复我~ 2021-08-17 20:57:07
  • 神思者 回复 提问者 慕码人2456996 #2
    这怎么还出现了JDBC连接错误?
    回复 有任何疑惑可以回复我~ 2021-08-17 21:22:17
  • 提问者 慕码人2456996 #3
    找到问题了已经解决,因为是个小白想问一下这是为什么会这样
    SystemConstants 我这个类写到了 controller 包下,就出现了这个异常,
    放到config下就是正常的这是为甚了老师?
    回复 有任何疑惑可以回复我~ 2021-08-17 21:23:03
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信