Giter Site home page Giter Site logo

PersonDao Mappper Proxy about ngbatis HOT 3 OPEN

AhYi8 avatar AhYi8 commented on June 12, 2024
PersonDao Mappper Proxy

from ngbatis.

Comments (3)

CorvusYe avatar CorvusYe commented on June 12, 2024 1

新项目启动报这个异常:

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" }

Dao 类

图片

这里的@Component可以不需要,直接去掉就可以,扫描的发现是通过 xml 的 namespace 完成的,加了这个注解会形成二次代理,从而导致报错

from ngbatis.

AhYi8 avatar AhYi8 commented on June 12, 2024

哪位大佬知道为啥,刚学,踩的坑太多了

from ngbatis.

AhYi8 avatar AhYi8 commented on June 12, 2024

这是Mapper.xml 文件
图片

from ngbatis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.