Common Errors in ibatis.net debugging:
1. The daomanager instance is empty.
This problem is unavoidable for people who use ibatis.net for the first time.
The configuration of ibatis.net is flexible, but complicated, unless you use the ibatis.net code generator to avoid most of the errors.
When ibatis.net generates a daomanager instance, it reads files such as Dao. config and sqlmap. config.
If the property in the object class does not match the property value in resultmap, the error ibatisnet. Common. Exceptions. configurationexception is returned.
In addition, if the dynamic tag is used in the XML file, check whether your project has reference to loading Castle. dynamicproxy. dll.
{System. nullreferenceexception: object reference not set to an instance of an object.
At ESPs. ibatisnet. serviceconfig. getinstance () in H:/msl_oa/ESPs. ibatisnet/serviceconfig. CS: Line 43}
2. If the following error occurs, the main cause is that you may use the development environment of. NET Framework 4.0. Change the. NET Framework Version of the class library to 3.5. I don't understand the specific principle either. NET Framework version is too high and ibatis.net compatibility is not good.
{Ibatisnet. Common. Exceptions. configurationexception:
-The error occurred while configure daosessionhandler.
-Configure Dao
-Check the ESPs. persistence. mapperdao. newssqlmapdao, ESPs. persistence. ---> ibatisnet. common. exceptions. configurationexception: Error Processing ing Dao. cause: ambiguous match found. ---> system. reflection. ambiguousmatchexception: ambiguous match found.
At system. runtimetype. getmethodimpl (string name, bindingflags bindingattr, binder, callingconventions callconv, type [] types, parametermodifier [] modifiers)
At system. type. getmethod (string name)
At Castle. dynamicproxy. Builder. codebuilder. simpleast. lockblockexpression. emit (ieasymember Member, ilgenerator Gen)
At Castle. dynamicproxy. Builder. codebuilder. simpleast. expressionstatement. emit (ieasymember Member, ilgenerator Gen)
At Castle. dynamicproxy. Builder. codebuilder. abstractcodebuilder. Generate (ieasymember Member, ilgenerator il)
At Castle. dynamicproxy. Builder. codebuilder. easymethod. Generate ()
At Castle. dynamicproxy. Builder. codebuilder. abstracteasytype. ensurebuildersareinavalidstate ()
At Castle. dynamicproxy. Builder. codebuilder. abstracteasytype. buildtype ()
At Castle. dynamicproxy. Builder. codegenerators. basecodegenerator. createtype ()
At Castle. dynamicproxy. Builder. codegenerators. interfaceproxygenerator. generatecode (type [] interfaces, type targettype)
At Castle. dynamicproxy. Builder. defaultproxybuilder. createinterfaceproxy (type [] interfaces, type)
At Castle. dynamicproxy. proxygenerator. createproxy (type [] interfaces, iinterceptor interceptor, object target)
At ibatisnet. dataaccess. configuration. daoproxy. newinstance (DAO Dao)
At ibatisnet. dataaccess. configuration. Dao. initialize (daomanager)
--- End of inner exception stack trace ---
At ibatisnet. dataaccess. configuration. Dao. initialize (daomanager)
At ibatisnet. dataaccess. configuration. domdaomanagerbuilder. parsedaofactory (configurationscope, daomanager)
At ibatisnet. dataaccess. configuration. domdaomanagerbuilder. getcontexts (configurationscope)
At ibatisnet. dataaccess. configuration. domdaomanagerbuilder. getconfig (configurationscope)
At ibatisnet. dataaccess. configuration. domdaomanagerbuilder. builddaomanagers (xmldocument document, Boolean useconfigfilewatcher)
--- End of inner exception stack trace ---
At ibatisnet. dataaccess. configuration. domdaomanagerbuilder. builddaomanagers (xmldocument document, Boolean useconfigfilewatcher)
At ibatisnet. dataaccess. configuration. domdaomanagerbuilder. Configure (string resource)
At ESPs. ibatisnet. daoloader. getinstance () in H:/msl_oa/ESPs. ibatisnet/daoloader. CS: line 37}
Iii. Exceptions in the type initialization expression of 'esps. Service. lookupcodeservice'
In general, this problem occurs when Dao. config is read, and sqlmap. config must be tracked for errors,
Many XML files are added to the sqlmaps node of sqlmap. config. If the content of one of these XML files is incorrect,
Will cause the entire configuration error. To avoid errors, make sure that the contents of Dao. config, sqlmap. config, and XML files are correct.