Hi All,

Who can help me to find my problem thanks a lot

I 'am trying to use iBatisNet with this technical environment :

MS-SQL Server 2000 , DataBase Nortwind
VS 2003
C#
Dot NET 1.1

IBatisNet.DataMapper.dll   1.3.0.0
IBatisNet.Common.dll        1.3.0.0
Castle.DynamicProxy.dll     1.1.5.0

So I try to map the first row from the Customers table into the class Customer with a simple windows application like this :
.......
private void btnTest_Click(object sender, System.EventArgs e)
        {
             SqlMapper mapper = Mapper.Instance();
             Object obj = mapper.QueryForObject("GetAAAAA", null);           
             txtRes.Text = obj.ToString();      
        }

The application raise this error message :

'DefaultDomain' : chargé 'f:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', aucun symbole chargé.
'iBatisWnApp' : chargé 'G:\Dot.Net\iBatis_Net\Marc_Test\TestIbatis\TestiBatis\DataMapper1-3\iBatisWnApp\bin\Debug\iBatisWnApp.exe', symboles chargés.
'iBatisWnApp.exe' : chargé 'f:\windows\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll', aucun symbole chargé.
'iBatisWnApp.exe' : chargé 'f:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', aucun symbole chargé.
'iBatisWnApp.exe' : chargé 'g:\dot.net\ibatis_net\marc_test\testibatis\testibatis\datamapper1-3\ibatiswnapp\bin\debug\ibatisnet.datamapper.dll', aucun symbole chargé.
'iBatisWnApp.exe' : chargé 'g:\dot.net\ibatis_net\marc_test\testibatis\testibatis\datamapper1-3\ibatiswnapp\bin\debug\ibatisnet.common.dll', aucun symbole chargé.
'iBatisWnApp.exe' : chargé 'f:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll', aucun symbole chargé.
'iBatisWnApp.exe' : chargé 'f:\windows\assembly\gac\mscorlib.resources\1.0.5000.0_fr_b77a5c561934e089\mscorlib.resources.dll', aucun symbole chargé.
25/02/2006 08:42:23 [WARN]  IBatisNet.Common.Logging.LogManager - Unable to read configuration IBatisNet/logging. Using default logger (ConsoleLogger).
'iBatisWnApp.exe' : chargé 'f:\windows\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll', aucun symbole chargé.
Une exception non gérée du type 'IBatisNet.Common.Exceptions.ConfigurationException' s'est produite dans ibatisnet.datamapper.dll

Informations supplémentaires :
- The error occurred while loading SqlMap.
- initialize result property: Id
- The error occurred in <sqlMap resource="Customer.xml" xmlns="http://ibatis.apache.org/dataMapper" />. 
- Check the Customer.customer-result.


25/02/2006 08:42:23 [INFO]  IBatisNet.DataMapper.Configuration.DomSqlMapBuilder - Add property "userid" value "sa"
25/02/2006 08:42:23 [INFO]  IBatisNet.DataMapper.Configuration.DomSqlMapBuilder - Add property "password" value "XXXX"
25/02/2006 08:42:23 [INFO]  IBatisNet.DataMapper.Configuration.DomSqlMapBuilder - Add property "database" value "Northwind"
25/02/2006 08:42:23 [INFO]  IBatisNet.DataMapper.Configuration.DomSqlMapBuilder - Add property "datasource" value "(local)"
25/02/2006 08:42:23 [INFO]  IBatisNet.DataMapper.Configuration.DomSqlMapBuilder - Add property "useStatementNamespaces" value "false"
Le programme '[224] iBatisWnApp.exe' s'est arrêté avec le code 0 (0x0).

All the files under are in ..\bin\Debug directory

Here is my sqlMap config file:

<?xml version="1.0" encoding="utf-8"?>
<sqlMapConfig xmlns="http://ibatis.apache.org/dataMapper"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
    <!-- Rem : If used via a DataAccess context, properties tag will be ignored -->
    <properties resource="database.config"/>
    <settings>
        <setting useStatementNamespaces="${useStatementNamespaces}"/>
        <setting cacheModelsEnabled="true"/>
        <setting validateSqlMap="false"/>
    </settings>
    <providers resource="providers.config"/>
    <database>
        <!-- Optional ( default ) -->
        <provider name="sqlServer1.1"/>
        <dataSource name="iBatisNet" connectionString="data source=${datasource};database=${database};user id=${userid};password=${password};connection reset=false;connection lifetime=5; min pool size=1; max pool size=50"/>
    </database>

    <alias>
        <typeAlias alias="Customer" type="iBatisWnApp.Domain.Customer, iBatisWnApp"/>
    </alias>
   
    <sqlMaps>
        <!-- <sqlMap url=""/>   -->
        <sqlMap resource="Customer.xml"/>
        <!-- Rem : If used as embbeded Resources, use
        <sqlMap embedded="Maps.MSSQL.SqlClient.Account.xml, IBatisNet.DataMapper.Test"/>-->
    </sqlMaps>

</sqlMapConfig>

Here is the Customer.xml file :

<?xml version="1.0" encoding="UTF-8" ?>
<sqlMap namespace="Customer"
xmlns="http://ibatis.apache.org/mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >    
      
    <cacheModels>
        <cacheModel id="account-cache" implementation="MEMORY" >
            <flushInterval hours="24"/>
            <flushOnExecute  statement="UpdateAccountViaInlineParameters"/>
            <flushOnExecute  statement="UpdateAccountViaParameterMap"/>
            <property name="Type" value="Weak"/>
        </cacheModel>      
    </cacheModels>
       
    <resultMaps>           
             
        <resultMap id="customer-result"  class="Customer" >
            <result property="Id"              column="CustomerID"/>
            <result property="CompanyName"     column="CompanyName"/>
            <result property="ContactName"     column="ContactName"/>
            <result property="ContactTitle"    column="ContactTitle"/>           
        </resultMap>   
       
    </resultMaps>
   
    <statements>   
        <select id="GetAAAAA" resultMap="customer-result" >
            select TOP 1 CustomerID, CompanyName, ContactName , ContactTitle from customers            
        </select>           
    </statements>   
   
</sqlMap>

here my DataBase.config file

<?xml version="1.0" encoding="utf-8" ?>
<settings>
     <add key="userid" value="sa" />
    <add key="password" value="XXXX" />
    <add key="database" value="Northwind" />
    <add key="datasource" value="(local)" />   
    <add key="useStatementNamespaces" value="false" />
</settings>


Here my Customer class

using System;

namespace iBatisWnApp.Domain

{

    public class Customer
    {
        private string m_Address;
        private string m_City;
        private string m_CompagnyName;
        private string m_ContactName;
        private string m_ContactTitle;
        private string m_Country;
        private string m_CustomerID;
        private string m_Fax;
        private string m_Phone;
        private string m_PostalCode;
        private string m_Region;

        public string ID
        {
            get
            {
                return this.m_CustomerID;
            }
            set
            {
                if (value != null)
                {
                    this.m_CustomerID = value;
                }
            }
        }

        public string CompagnyName
        {
            get
            {
                return this.m_CompagnyName;
            }
            set
            {
                if (value != null)
                {
                    this.m_CompagnyName = value;
                }
            }
        }

        public string ContactName
        {
            get
            {
                return this.m_ContactName;
            }
            set
            {
                if (value != null)
                {
                    this.m_ContactName = value;
                }
            }
        }

        public string ContactTitle
        {
            get
            {
                return this.m_ContactTitle;
            }
            set
            {
                if (value != null)
                {
                    this.m_ContactTitle = value;
                }
            }
        }

        public string Address
        {
            get
            {
                return this.m_Address;
            }
            set
            {
                if (value != null)
                {
                    this.m_Address = value;
                }
            }
        }

        public string City
        {
            get
            {
                return this.m_City;
            }
            set
            {
                if (value != null)
                {
                    this.m_City = value;
                }
            }
        }

        public string Region
        {
            get
            {
                return this.m_Region;
            }
            set
            {
                if (value != null)
                {
                    this.m_Region = value;
                }
            }
        }

        public string PostalCode
        {
            get
            {
                return this.m_PostalCode;
            }
            set
            {
                if (value != null)
                {
                    this.m_PostalCode = value;
                }
            }
        }

        public string Country
        {
            get
            {
                return this.m_Country;
            }
            set
            {
                if (value != null)
                {
                    this.m_Country = value;
                }
            }
        }

        public string Phone
        {
            get
            {
                return this.m_Phone;
            }
            set
            {
                if (value != null)
                {
                    this.m_Phone = value;
                }
            }
        }

        public string Fax
        {
            get
            {
                return this.m_Fax;
            }
            set
            {
                if (value != null)
                {
                    this.m_Fax = value;
                }
            }
        }

        public override string ToString()
        {
            return this.m_CustomerID + " ; " + this.m_CompagnyName;
        }

       
    }
}




Reply via email to