This indeed fixes the error but after that i recieve the following error:
- The error occurred while Validate SqlMap config.
- initialize type alias
- The error occurred in <sqlMap resource="participants.xml"
xmlns="http://ibatis.apache.org/dataMapper" />.
- Check the KennedyMars.participant,KennedyMars.
The inner exception says:
{"Could not load type from string value
'KennedyMars.participant,KennedyMars'.":""}
But the participant is in de namespace KennedyMars so i suppose this isn't
the error?
My alias:
<alias>
<typeAlias alias="participant"
type="KennedyMars.participant,KennedyMars" />
</alias>
Nguyen, Tom wrote:
>
>
> Base on this line:
>> Cause: Could not load type from string value 'participant'.]
> And the XML you provided.
>
> I do not see a definition of type alias for 'participant' which could be
> the cause of error.
>
> <alias>
> <typeAlias alias="participant" type="YourAssembly.participant,
> YourAssembly" />
> </alias>
>
> Regards,
>
>
> Tom Nguyen
> Sr. Developer
> [EMAIL PROTECTED]
>
> -----Original Message-----
> From: Schuminl [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 02, 2007 10:01 AM
> To: [email protected]
> Subject: Could not configure ResultMap. ResultMap named pa.SelectResult
> not found, failed.
>
>
> 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(Stri
> ng
> typeName) +256
> IBatisNet.Common.Utilities.TypeUtils.ResolveType(String typeName) +50
> IBatisNet.DataMapper.TypeHandlers.TypeHandlerFactory.GetType(String
> className) +73
>
> IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.Initialize(Co
> nfigurationScope
> 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(Co
> nfigurationScope
> configScope) +267
>
> IBatisNet.DataMapper.Configuration.Serializers.ResultMapDeSerializer.Des
> erialize(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(St
> ring
> resource, ConfigureHandler configureDelegate) +203
>
> IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureAndWatch(Co
> nfigureHandler
> 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.Rai
> sePostBackEvent(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.
>
> ************************************************************************************
> This e-mail message and any files transmitted herewith, are intended
> solely for the
> use of the individual(s) addressed and may contain confidential,
> proprietary or
> privileged information. If you are not the addressee indicated in this
> message
> (or responsible for delivery of this message to such person) you may not
> review,
> use, disclose or distribute this message or any files transmitted
> herewith. If you
> receive this message in error, please contact the sender by reply e-mail
> and delete
> this message and all copies of it from your system.
> ************************************************************************************
>
>
--
View this message in context:
http://www.nabble.com/Could-not-configure-ResultMap.-ResultMap-named-pa.SelectResult-not-found%2C-failed.-tf4555353.html#a13001909
Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.