ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clough, Samuel \(USPC.PRG.Atlanta\)" <Samuel_Clo...@princetonrg.com>
Subject RE: sqlMap Configuration Issue
Date Fri, 18 May 2007 19:02:38 GMT
Where you specify your class, put a comma after the name of the class
and then the name of your assembly minus the .dll extension.  Also, to
make your life easier you could use an alias at the top of your mapping
file so that you can give the type a name and then only have one place
that lists the full name and the assembly name.

  _____  

From: Ryan MacDonald [mailto:ryan@ryanmacdonald.net] 
Sent: Friday, May 18, 2007 2:57 PM
To: user-cs@ibatis.apache.org
Subject: sqlMap Configuration Issue



I'm new to Ibatis.net and am still trying to get my first app working
with it. I'm running into the problem when my sqlMap is configured at
runtime. It can't seem to find my assembly with my class definitions.
The assembly is in my App_Code folder and is called "Newbydev.User"
which contains the class definition for a UserBasic. Any help is greatly
appreciated. Here's the error I'm getting:

 

Could not load type from string value 'User.UserBasic'. 

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 'User.UserBasic'.

Source Error: 

 

Line 52:     private void cmdLogin_Click(Object sender, EventArgs e)

Line 53:     {

Line 54:         User.UserServices.Authenticate(txtUser.Text,
txtPass.Text);

Line 55:     }

Line 56: }


Source File:
d:\webspace\newbydevcom\newbydev.com\www\MasterPage.master.cs    Line:
54 

Stack Trace: 

 

[TypeLoadException: Could not load type from string value
'User.UserBasic'.]

 
IBatisNet.Common.Utilities.TypesResolver.TypeResolver.ResolveType(String
typeName) +242

   IBatisNet.Common.Utilities.TypesResolver.TypeResolver.Resolve(String
typeName) +29

 
IBatisNet.Common.Utilities.TypesResolver.CachedTypeResolver.Resolve(Stri
ng typeName) +135

   IBatisNet.Common.Utilities.TypeUtils.ResolveType(String typeName) +28

 
IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.Initialize(Co
nfigurationScope configScope) +62

 

[ConfigurationException: Could not configure ResultMap named
"User.userBasicResult", Cause: Could not load type from string value
'User.UserBasic'.]

 
IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.Initialize(Co
nfigurationScope configScope) +292

 
IBatisNet.DataMapper.Configuration.Serializers.ResultMapDeSerializer.Des
erialize(XmlNode node, ConfigurationScope configScope) +129

   IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.BuildResultMap()
+134

   IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureSqlMap()
+1283

   IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Initialize()
+5041

   IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
document, DataSource dataSource, Boolean useConfigFileWatcher, Boolean
isCallFromDao) +239

 

[ConfigurationException: 

- The error occurred while Validate SqlMap config.

- initialize ResultMap

- The error occurred in <sqlMap resource="${datamaps}/User.xml"
xmlns="http://ibatis.apache.org/dataMapper" />.  

- Check the User.userBasicResult.]

   IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
document, DataSource dataSource, Boolean useConfigFileWatcher, Boolean
isCallFromDao) +293

 
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureAndWatch(St
ring resource, ConfigureHandler configureDelegate) +181

   IBatisNet.DataMapper.Mapper.InitMapper() +71

   IBatisNet.DataMapper.Mapper.Instance() +62

   Newbydev.UserServices.GetUserBasicByLogin(String Login) +29

   Newbydev.UserServices.Authenticate(String username, String password)
+56

   MasterPage.cmdLogin_Click(Object sender, EventArgs e) in
d:\webspace\newbydevcom\newbydev.com\www\MasterPage.master.cs:54

   System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
+105

   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String
eventArgument) +115

 
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandle
r.RaisePostBackEvent(String eventArgument) +7

   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +11

   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33

   System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+5102

 

And this is part of my my sqlMap.xml file

 

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

 

<sqlMap namespace="User"

xmlns="http://ibatis.apache.org/mapping"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >

 

  <resultMaps>

    <resultMap id="userBasicResult" class="Newbydev.User.UserBasic" >

      <result property="ID"            column="user_ID" />

      <result property="FirstName"     column="user_FName" />

      <result property="LastName"      column="user_Lname" />

      <result property="Login"         column="user_Login" />

      <result property="Password"      column="user_Password" />

      <result property="IsAdmin"       column="user_IsAdmin" />

      <result property="TryCount"      column="user_TryCount" />

      <result property="LastAttempt"   column="user_LastAttempt" />

    </resultMap>

  </resultMaps>

 

  <statements>

    <select id="selectUserBasic"
parameterClass="Newbydev.User.UserBasic" resultMap="userBasicResult"
cacheModel="userCache">

      SELECT

      U.user_ID,

      U.user_FName,

      U.user_Lname,

      U.user_Login,

      U.user_Password,

      U.user_IsAdmin,

      U.user_TryCount,

      U.user_LastAttempt

      FROM

      tbl_User U

      <dynamic prepend="WHERE">

        <isNotNull property="ID">

          U.user_ID = #ID#

        </isNotNull>

        <isNotEmpty property="Login">

          U.user_Login = #Login#

        </isNotEmpty>

      </dynamic>

    </select>

  </statements>

 

</sqlMap> 
--------------------------------------------------------

Princeton Retirement Group, Inc - Important Terms 
This E-mail is not intended for distribution to, or use by, any person or entity in any location
where such distribution or use would be contrary to law or regulation, or which would subject
Princeton Retirement Group, Inc. or any affiliate to any registration requirement within such
location. 
This E-mail may contain privileged or confidential information or may otherwise be protected
by work product immunity or other legal rules. No confidentiality or privilege is waived or
lost by any mistransmission. Access, copying or re-use of information by non-intended or non-authorized
recipients is prohibited. If you are not an intended recipient of this E-mail, please notify
the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute
any portion of this E-mail. 
The transmission and content of this E-mail cannot be guaranteed to be secure or error-free.
Therefore, we cannot represent that the information in this E-mail is complete, accurate,
uncorrupted, timely or free of viruses, and Princeton Retirement Group, Inc. cannot accept
any liability for E-mails that have been altered in the course of delivery. Princeton Retirement
Group, Inc. reserves the right to monitor, review and retain all electronic communications,
including E-mail, traveling through its networks and systems (subject to and in accordance
with local laws). If any of your details are incorrect or if you no longer wish to receive
mailings such as this by E-mail please contact the sender by reply E-mail. 

--------------------------------------------------------

Mime
View raw message