The online reflection can not find the data, according to the business logic to find out the SQL to execute, there is actually data. For some reason, record the process of finding the problem. Greys Finding problems
Greys to find the problem on the line is still very helpful, address https://github.com/oldmanpushcart/greys-anatomy into Greys
The Java Process ID is first checked by JPS
sudo jps-l
Switch to jetty account, execute Greys script to enter
sudo su-jetty
SH greys.sh 16092 View Call Parameters
Ga?>watch-b com.dfire.soa.order.dao.ITotalPayDAO selecttotalpaycountinfo params[1]+ ' | ' +PARAMS[2]
Press Ctrl+d to abort.
Affect (Class-cnt:2, method-cnt:4) cost in 228 Ms.
Thu Oct 00:00:00 CST 2017| Sat Oct 00:00:00 CST 2017
Thu Oct 00:00:00 CST 2017| Sat Oct 00:00:00 CST 2017
Thu Oct 00:00:00 CST 2017| Sat Oct 00:00:00 CST 2017
Thu Oct 00:00:00 CST 2017| Sat Oct 00:00:00 CST 2017
Thu Oct 00:00:00 CST 2017| Sat Oct 00:00:00 CST 2017
OK, no problem. View return Parameters
Ga?>watch-s *mapper selecttotalpaycountinfo returnobj-x 1
Press Ctrl+d to abort.
Affect (Class-cnt:2, method-cnt:2) cost in 341 Ms.
Null
found that the return parameter is NULL, the return value has a problem locating
No problem from SQL, but the view type is Totalpaypo,
<select id= "Selecttotalpaycountinfo" resulttype= "Com.dfire.soa.order.domain.po.TotalPayPo" >
Returns the actual type required Totalpaycount
Totalpaycount Selecttotalpaycountinfo (@Param ("EntityId") String entity, @Param ("Currdate") Date currdate, @Param (" Twodayago ") Date Twodayago, @Param (" Ishide ") Integer ishide);
this place MyBatis no error, unbelievable.
View MyBatis source only to find that the problem occurs in the processing of the Defaultresultsethandler class, which is responsible for the assembly conversion of the returned data, where the Getrowvalue method foundvalues not found directly return NULL. Feel unreasonable here, should throw an exception, at least here should be able to configure, otherwise this configuration error can not be found in time.
Private Object Getrowvalue (Resultsetwrapper rsw, Resultmap resultmap) throws SQLException {final Resultloadermap LA
Zyloader = new Resultloadermap ();
Object resultobject = Createresultobject (RSW, Resultmap, lazyloader, NULL); if (resultobject! = null &&!typehandlerregistry.hastypehandler (Resultmap.gettype ())) {Final MetaObject met
Aobject = Configuration.newmetaobject (Resultobject);
Boolean foundvalues = Resultmap.getconstructorresultmappings (). Size () > 0; if (Shouldapplyautomaticmappings (Resultmap,! AutoMappingBehavior.NONE.equals (Configuration.getautomappingbehavior ()))) {foundvalues = APPLYAUTOMATICMA Ppings (RSW, Resultmap, metaobject, null) | |
Foundvalues; } foundvalues = Applypropertymappings (RSW, Resultmap, metaobject, Lazyloader, null) | |
Foundvalues; Foundvalues = lazyloader.size () > 0 | |
Foundvalues; Resultobject = foundvalues?
Resultobject:null;
return resultobject; } return Resultobject; }
Note: mybatis-3.2.7