ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: can't run iBatis Tutorial
Date Wed, 18 Oct 2006 04:03:34 GMT
Are you able to update the wiki with your changes?


----- Original Message ----
From: robsosno <robsosno@gmail.com>
To: user-cs@ibatis.apache.org
Sent: Tuesday, October 17, 2006 4:24:56 PM
Subject: Re: can't run iBatis Tutorial

robsosno wrote:
> I'm trying to evaluate iBatis to check if it will be useful for me. 
> I've converted my existing application to use iBatis but I've got 
> several errors when trying it to run (compilation was successfull).
> I know that it could be that this is due to my lack of knowledge so 
> I've tried tutorial application downloaded from:
> http://prdownloads.sourceforge.net/ibatisnet/Tutorial-1.2.1.zip?download
> Unfortunately I've got the same bugs related to SqlMapConfig.xsd as 
> from my application.
> I'm using IBatisNet.DataMapper-bin-1.5.1, .NET 1.1, Visual Studio 2003.
> Attachments contains all details. First I've got "Cannot load 
> schema..." error message. I've tried to copy all 3 xsd 
> (SqlMapConfig.xsd, SqlMap.xsd, provider.xsd) files into all possible 
> places within tutorial directory. Also I've tried to include xsd file 
> into the VS solution as a resource but error message haven't changed. 
> So in the end I've copied SqlMapConfig.xsd as message Could not find 
> file "c:\winnt\system32\SqlMapConfig.xsd" suggest it.
> I've got new error message which is completely not understandable for me.
> I'm beginner with iBatis so I'm not able to tackle with this issue 
> myself - please help with running this tutorial.
> Regards,
> RobertS
I've found a way to run Tutorial. However it was very painful for the 

First I've tried available samples and tutorials:

Nothing works. Then I've got what it seemed most simple for me:

Of course it also doesn't work. However sample was so small then I've 
tried to fix it issue by issue.
I've found following issues and solutions::
Cannot implicitly convert type 'IBatisNet.DataMapper.ISqlMapper' to 

After googling I've found that API have changed so it is necessary to 
change from:
  private static volatile SqlMapper _mapper = null;
  private static volatile ISqlMapper _mapper = null;
Then all methods returning SqlMapper needs to return ISqlMapper instead 
(methods Instance, Get).

In all other tutorials I see the same issue.

2. Couldn't find SqlMap.config
  I've copied it to directory where are all executables (bin\Debug).

3. Couldn't find providers.config
  I've copied it to directory where are all executables (bin\Debug).

4. Error while configuring the Provider named "OleDb1.1". Cause: The 
provider is not in 'providers.config' or is not enabled.
   <providers> tag in providers.config should be replaced by:

5. Could not find Person.xml
  I've copied Person.xml to bin\Debug\Resources

6. Unable to load file via resource "Resource/Person.xml" as resource. 
Cause: There are multiple root elements. Line 5 position 4.

Added missing root tag to person.xml (copied from tutorial, file 

7. Object reference not set to an instance of the object
   After googling much I've found that somebody else had similar issue. 
Solution is to replace:
    iin sqlmap.config .

7. System.TypeLoadException : Could not load type from string value 
'iBatisTutorial.Model.Person, iBatisTutorial.Model'.
   Changed to 'iBatisTutorial.Model.Person'.

8. This SQL map does not contain a MappedStatement named SelectAll.
   I've added missing <resultMaps> tag to person.xml

9. There is no Set member named 'FirstName', in class 'Person'.
   I've changed in class Person:
    // Other public properties for the private fields ...
   to the full class definition.

10. This SQL map does not contain a MappedStatement named SelectAll.
   I've added missing <statements> tag to person.xml

11. SqlMapper.ConfigureAndWatch (handler) (warning): This method will be 
remove in future version, use DomSqlMapBuilder.Configure
    I leaved as is. I do not know how to emulate ConfigureAndWatch with 
DomSqlMapBuilder.Configure yet.

It was really hardest "Quick start" tutorial I've encountered so far.

I've back to the tutorial from 
With my new knowledge it was quite simple: solution no 7 was enough to 
run it successfully.

Then I've returned back to my application I've started to work with. 
Unfortunately I still have some problems. I have "Object reference not 
set to an instance of the object" from Configure() method even after 
using all solutions which I've found earlier. Even empty xml map (which 
is obviously error free) doesn't help.
This time I'm sure that this is my own fault. Nevertheless more friendly 
error message concerning what is wrong with the configuration would be 
the best.

I'm wondering if iBatisNet is designed only for heavy crackers who are 
not using any docs because they remember every byte of iBatis source.


Robert Sosnowski

View raw message