We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.NullPointerException: null at org.nebula.contrib.ngbatis.proxy.MapperProxy.invoke(MapperProxy.java:73) ~[ngbatis-1.1.3.jar:1.1.3] at com.ayi.ngbatis.dao.PersonDao$Proxy.select1(Unknown Source) ~[na:na] at com.ayi.ngbatis.service.impl.PersonServiceImpl.select1(PersonServiceImpl.java:79) ~[classes/:na] at com.ayi.ngbatis.controller.PersonController.select1(PersonController.java:18) ~[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_321] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_321] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_321] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_321] ......
The text was updated successfully, but these errors were encountered:
哪位大佬知道为啥,刚学,踩的坑太多了
Sorry, something went wrong.
这是Mapper.xml 文件
新项目启动报这个异常: java.lang.NullPointerException: null at org.nebula.contrib.ngbatis.proxy.MapperProxy.invoke(MapperProxy.java:73) ~[ngbatis-1.1.3.jar:1.1.3] at com.ayi.ngbatis.dao.PersonDao$Proxy.select1(Unknown Source) ~[na:na] at com.ayi.ngbatis.service.impl.PersonServiceImpl.select1(PersonServiceImpl.java:79) ~[classes/:na] at com.ayi.ngbatis.controller.PersonController.select1(PersonController.java:18) ~[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_321] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_321] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_321] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_321] ...... 启动类
这里的报空是因为基本包的内置组件没有扫描到,可以改成 scanBasePackages = { "org.nebula.contrib.ngbatis", "com.ayi.ngbatis" }
scanBasePackages = { "org.nebula.contrib.ngbatis", "com.ayi.ngbatis" }
Dao 类
这里的@Component可以不需要,直接去掉就可以,扫描的发现是通过 xml 的 namespace 完成的,加了这个注解会形成二次代理,从而导致报错
@Component
No branches or pull requests
新项目启动报这个异常:
启动类
项目结构
Dao 类
ServiceImp 类
The text was updated successfully, but these errors were encountered: