I am having this exact problem with iBatis DataMapper 1.5.1 and the .NET 2.0 runtime.
I've copied examples, changed as much as I can, yet I get the below exception.
If I leave my CV.xml file (a mapping file) empty, I get the same thing.. no idea what is causing this...
did anyone find something that might be useful to me? Is there a debug flag or build
I can use to see the line numbers in the stack trace?
Unhandled Exception: IBatisNet.Common.Exceptions.ConfigurationException :
- The error occurred while loading SqlMap.
- The error occurred in <sqlMap resource="CV.xml" xmlns="http://ibatis.apache.org/dataMapper" />. ---> System.NullRefer
nceException: Object reference not set to an instance of an object.
at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureSqlMap()
at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Initialize ()
at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument document, DataSource dataSource, Boolean us
ConfigFileWatcher, Boolean isCallFromDao)
--- End of inner exception stack trace ---
at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument document, DataSource dataSource, Boolean us
ConfigFileWatcher, Boolean isCallFromDao)
at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Configure (String resource)
at HttpTestListener.test_ibatis() in c:\novartis\remoteReg\lwa\dev\cs\HttpTestListener.cs:line 235
at HttpTestListener.Main(String[] args) in c:\novartis\remoteReg\lwa\dev\cs\HttpTestListener.cs:line 249
--- Alexandre Grenier <[EMAIL PROTECTED]> wrote:
> Thanks Luke,
>
> I wish to be doing whatever you do that makes it work :)
>
> The files are all just sitting in the bin folder. The Domain.dll is
> there.
> I tried with Mapper.Instance() and the error is the same.
>
> I have made a 2nd unit test project, this time using the
> iBatistutorial.mdb access database and the OleDb2.0 provider. I am
> getting the same error:
>
> iBatisTutorial.Model.PersonTest.GetMapper :
> IBatisNet.Common.Exceptions.ConfigurationException :
> - The error occurred while Validate SqlMap config.
> - initialize ResultMap
> - The error occurred in <sqlMap resource="Person.xml"
> xmlns="http://ibatis.apache.org/dataMapper" ; />.
> - Check the Person.SelectAllResult.
> ----> IBatisNet.Common.Exceptions.ConfigurationException : Could
> not
> configure ResultMap. ResultMap named "SelectAllResult" not found,
> failed.
> Cause: Object reference not set to an instance of an object.
>
> If I set validateSqlMap to false, the error is very similar:
>
> iBatisTutorial.Model.PersonTest.GetMapper :
> IBatisNet.Common.Exceptions.ConfigurationException :
> - The error occurred while loading SqlMap.
> - initialize ResultMap
> - The error occurred in <sqlMap resource="Person.xml"
> xmlns="http://ibatis.apache.org/dataMapper"; />.
> - Check the Person.SelectAllResult.
> ----> IBatisNet.Common.Exceptions.ConfigurationException : Could
> not
> configure ResultMap. ResultMap named "SelectAllResult" not found,
> failed.
> Cause: Object reference not set to an instance of an object.
>
> The folder structure is very straightforward. 1 solution, 2 projects,
> Model and Test. Model has a Person class. Test has a reference to
> Model.
> All the iBatis DLLs, Castle, log4net, config, sqlmap and mdb as well
> as
> Test and Model DLLs are in Test's bin\debug.
>
> Maybe I can send that simple unit test zipped up as email attachment
> and
> it would be easy to find out what's wrong. Maybe just replacing my
> iBatis DLLs with yours would fix it. Maybe there's something about
> compiled iBatis with 2.0 I'm not aware of. I really don't know at
> this
> point... except that it's 9pm and I'm at the office :(
>
> Thanks!
>
> Alex
--
---------------------------------------
Donald Dwoske
Software Journeyman
http://www.loraxis.com/ddwoske

