I've have the following error in Visual Studio 2005 when trying to select a
user from a MSSQL DB.

- The error occurred while Validate SqlMap config.
- initialize ResultMap
- The error occurred in <sqlMap resource="participants.xml"
xmlns="http://ibatis.apache.org/dataMapper"; />.  
- Check the pa.SelectResult.

Inner exception:

Message "Could not configure ResultMap. ResultMap named \"pa.SelectResult\"
not found, failed. \r\n Cause: Could not load type from string value
'participant'."


My participants.xml:

<?xml version="1.0" encoding="utf-8" ?>

<sqlMap namespace="pa" xmlns="http://ibatis.apache.org/mapping";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>

        <resultMaps>
                <resultMap id="pa.SelectResult" class="participant">
      <result property="barcodeID" column="BarcodeID" />      
                        <result property="name" column="Name" />
                        <result property="surname" column="Surname" />
                        <result property="adress" column="Adress" />
                        <result property="zipcode" column="Zipcode" />
                        <result property="city" column="City" />
                        <result property="country" column="LandOfOrigin" />
                        <result property="participations" 
column="Participations" />
                        <result property="paid" column="Paid" />
                </resultMap>
        </resultMaps>

  <statements>

    <select id="Select" parameterClass="int" resultMap="pa.SelectResult">
      SELECT
      BarcodeID,
      Name,
      Surname,
      Adress,
      Zipcode,
      City,
      LandOfOrigin,
      Participations,
      Paid
      FROM Participants
      <dynamic prepend="WHERE">
        <isParameterPresent>
          BarcodeID = #value#
        </isParameterPresent>
      </dynamic>
    </select>

    <insert id="Insert" parameterClass="participant" resultClass="int">
      INSERT INTO Participants
      (BarcodeID, Name, Surname, Adress, Zipcode, City, LandOfOrigin,
Participations, Paid)
      VALUES
      (#barcodeID#, #name#, #surname#, #adress#, #zipcode#, #city#,
#country#, #participations#, #paid#)
    </insert>

  </statements>

</sqlMap>

Sqlmap.config:

<?xml version="1.0" encoding="UTF-8" ?>
<sqlMapConfig xmlns="http://ibatis.apache.org/dataMapper";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <settings>
    <setting cacheModelsEnabled="true"/>
    <setting useStatementNamespaces="true"/>
    <setting validateSqlMap="true"/>
    <setting useReflectionOptimizer="true"/>
  </settings>
  <database>
    <provider name="sqlServer2.0"/>
    <dataSource name="KennedyMarsConnection" connectionString="Data
Source=****;Initial Catalog=****;Persist Security Info=True;User
ID=***;Password=*****;" />
  </database>

  <sqlMaps>
    <sqlMap resource="participants.xml"/>
  </sqlMaps>
</sqlMapConfig>

Selection code:

            participant.name = name;
            participant.surname = surname;
            participant.adress = adress;
            participant.zipcode = zipcode;
            participant.city = city;
            participant.country = land;
            //Mapper.Instance().Insert("Insert", participant);
            //int count = Mapper.Instance().Delete("Delete", 1);
            participant.barcodeID = 1;
            participant =
(participant)Mapper.Instance().QueryForObject("pa.Select",
participant.barcodeID);

Does anyone have an idea about this error? ASP.NET final error:

Server Error in '/WEBTV_Website' Application.
Could not load type from string value 'participant'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.TypeLoadException: Could not load type from string
value 'participant'.

Source Error:

Line 29:             //int count = Mapper.Instance().Delete("Delete", 1);
Line 30:             participant.barcodeID = 1;
Line 31:             participant =
(participant)Mapper.Instance().QueryForObject("pa.Select",
participant.barcodeID);
Line 32:         }
Line 33:     }


Source File: e:\_School\WEBTV\WEBTV_Website\App_Code\DataAccess.cs    Line:
31

Stack Trace:

[TypeLoadException: Could not load type from string value 'participant'.]
   IBatisNet.Common.Utilities.TypesResolver.TypeResolver.ResolveType(String
typeName) +220
   IBatisNet.Common.Utilities.TypesResolver.TypeResolver.Resolve(String
typeName) +51
  
IBatisNet.Common.Utilities.TypesResolver.CachedTypeResolver.Resolve(String
typeName) +256
   IBatisNet.Common.Utilities.TypeUtils.ResolveType(String typeName) +50
   IBatisNet.DataMapper.TypeHandlers.TypeHandlerFactory.GetType(String
className) +73
  
IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.Initialize(ConfigurationScope
configScope) +113

[ConfigurationException: Could not configure ResultMap. ResultMap named
"pa.SelectResult" not found, failed. 
 Cause: Could not load type from string value 'participant'.]
  
IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.Initialize(ConfigurationScope
configScope) +267
  
IBatisNet.DataMapper.Configuration.Serializers.ResultMapDeSerializer.Deserialize(XmlNode
node, ConfigurationScope configScope) +220
   IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.BuildResultMap() +342
   IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureSqlMap()
+1648
   IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Initialize() +5093
   IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
document, DataSource dataSource, Boolean useConfigFileWatcher, Boolean
isCallFromDao) +345

[ConfigurationException: 
- The error occurred while Validate SqlMap config.
- initialize ResultMap
- The error occurred in <sqlMap resource="participants.xml"
xmlns="http://ibatis.apache.org/dataMapper"; />.  
- Check the pa.SelectResult.]
   IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
document, DataSource dataSource, Boolean useConfigFileWatcher, Boolean
isCallFromDao) +429
   IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
document, Boolean useConfigFileWatcher) +40
  
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureAndWatch(String
resource, ConfigureHandler configureDelegate) +203
  
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureAndWatch(ConfigureHandler
configureDelegate) +35
   IBatisNet.DataMapper.Mapper.InitMapper() +89
   IBatisNet.DataMapper.Mapper.Instance() +84
   KennedyMars.DataAccess.setRegisterUser(String name, String surname,
String adress, String zipcode, String city, String land) in
e:\_School\WEBTV\WEBTV_Website\App_Code\DataAccess.cs:31
   KennedyMars.BusinessLogic.validateRegister(String name, String surname,
String adress, String zipcode, String city, String land) in
e:\_School\WEBTV\WEBTV_Website\App_Code\BusinessLogic.cs:30
   KennedyMars.Facade.checkRegister(String name, String surname, String
adress, String zipcode, String city, String land) in
e:\_School\WEBTV\WEBTV_Website\App_Code\Facade.cs:53
   Default7.btRegister_Click(Object sender, EventArgs e) in
e:\_School\WEBTV\WEBTV_Website\register.aspx.cs:21
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +96
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
+116
  
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +31
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +32
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +72
   System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3839


Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET
Version:2.0.50727.832
-- 
View this message in context: 
http://www.nabble.com/Could-not-configure-ResultMap.-ResultMap-named-pa.SelectResult-not-found%2C-failed.-tf4555353.html#a13000516
Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.

Reply via email to