I have generated a c# and an xml configuration file
following the guidelines of the tutorial, and produced
a test file which I try to run using Nunit 2.2.1. and
.net framework 1.1.

When I run the test I get the following error:
airline.dao.FlightDAOTest.FlightDAOList :
System.NullReferenceException : Object reference not
set to an instance of an object.

at
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureSqlMap(SqlMapper
sqlMap, XmlNode sqlMapNode)
   at
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Initialize()
   at
IBatisNet.DataMapper.SqlMapper.ConfigureAndWatch(String
fileName, ConfigureHandler configureDelegate)
   at IBatisNet.DataMapper.Mapper.Instance()
   at airline.dao.FlightDAOTest.FlightDAOList()

The code I produce is:
  [TestFixture]
  public class FlightDAOTest
  {  
    [Test]
    public void FlightDAOList ()
    {
    // try it 
      IList objectList =
Mapper.Instance().QueryForList("SelectAll",null);

and the xml file is:
<xml version="1.0" encoding="utf-8" ?> 

<sqlMap 
 namespace="airline.dao" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

 xsi:noNamespaceSchemaLocation="SqlMap.xsd">

 <alias>
  <typeAlias alias="FlightDAO"
assembly="airline.dao.dll"
type="airline.dao.FlightDAO" />
 </alias>

 <resultMaps>
  <typeAlias alias="FlightDAO"
assembly="airline.dao.dll" 
   type="airline.dao.FlightDAO" />

  <resultMap id="SelectAllResult" class="FlightDAO">
   <result property="flightId" column="flight_id" />
   <result property="name" column="name" />
   <result property="departureUtc"
column="departure_utc" />
   <result property="arrivalUtc" column="arrival_utc"
/>
  </resultMap>
 </resultMaps>

 <statements>
  <select id="SelectAll" resultMap="SelectAllResult">
   select
    flight_id,
    name,
    departure_utc,
    arrival_utc
   from flights
  </select>

th esql config file is
<?xml version="1.0" encoding="UTF-8" ?>
<sqlMapConfig
 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
  xsi:noNamespaceSchemaLocation="SqlMapConfig.xsd">


 <providers file="providers.config"/>
<database>
  <provider name="OleDb1.1" />
  <dataSource name="airlines"  
   
connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=airlines.mdb"/>
 </database>
 
 <sqlMaps>
  <sqlMap file="../dao/Flight.xml"/>
 </sqlMaps>

</sqlMapConfig>


Does anybody have any idea of what is going wrong or
how I can get more information about the problem?

=====
Philip Kerrigan
Tel 02-25241
Milano
Italy
[EMAIL PROTECTED]


        
        
                
___________________________________________________________ 
Win a castle for NYE with your mates and Yahoo! Messenger 
http://uk.messenger.yahoo.com

Reply via email to