ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: sqlMap Configuration Issue
Date Mon, 21 May 2007 03:54:55 GMT
I was under the impression that most everyone uses the Web Application Project that's now the
default way to create a website in VS2005 SP1.

----- Original Message ----
From: "Nguyen, Tom" <Tom.Nguyen@rels.info>
To: user-cs@ibatis.apache.org
Sent: Sunday, May 20, 2007 1:30:36 AM
Subject: RE: sqlMap Configuration Issue




 
 

 


<!--a:link
	{}
span.MSOHYPERLINK
	{}
a:visited
	{}
span.MSOHYPERLINKFOLLOWED
	{}
p
	{}
p.MSOACETATE
	{}
li.MSOACETATE
	{}
div.MSOACETATE
	{}
span.BALLOONTEXTCHAR
	{}

 _filtered {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
 _filtered {font-family:Calibri;}
/* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:Calibri;}
a:link, span.MsoHyperlink
	{color:blue;text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;text-decoration:underline;}
p
	{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:"Times New Roman";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{margin:0in;margin-bottom:.0001pt;font-size:8.0pt;font-family:Tahoma;}
span.BalloonTextChar
	{font-family:Tahoma;}
span.EmailStyle20
	{font-family:Calibri;color:windowtext;}
span.EmailStyle21
	{font-family:Calibri;color:windowtext;}
span.EmailStyle22
	{font-family:Calibri;color:windowtext;}
span.EmailStyle23
	{font-family:Arial;color:navy;}
 _filtered {margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
	{}
-->










Ok, unless someone knows another way, the
only way I know is to use assembly (.dll) references.  Even .net references
assembly this way, unless you GAC it which will require you to put in into a
dll anyway.  IE.  .net 2.0 automatically add the assembly reference to web.config
file.
 

  
 

In ASP.NET 2.0, compilation generates random assembly.  This
is really annoying during deployment that is why there is an option in right-click
web project menu -> “Publish Web Site” called “use fixed naming
and single paged assembly.  Using this option, all cs files under “App_Code”
will compile into App_Code.dll
 

  
 

Another option is to use the new Web Project.  Asp.NET 2.0
web project is an additional download that includes ilmerge.  It will merge all
compiled dll into an assembly name of your choice eg: company.web.dll etc…
 

  
 

This is what you will use in your ibatisnet typeAlias
defintion.
 

  
 






Regards,
 






Tom Nguyen 

Sr. Developer

tom.nguyen@rels.info




 













From: Ryan MacDonald
[mailto:ryan@ryanmacdonald.net] 

Sent: Friday, May 18, 2007 2:11 PM

To: user-cs@ibatis.apache.org

Subject: RE: sqlMap Configuration
Issue
 




  
 

That’s
alright. I appreciate it.
 

  
 



~Ryan
 




  
 





From: Clough, Samuel
(USPC.PRG.Atlanta) [mailto:Samuel_Clough@princetonrg.com] 

Sent: Friday, May 18, 2007 3:08 PM

To: user-cs@ibatis.apache.org

Subject: RE: sqlMap Configuration
Issue
 







  
 

Sorry, I missed that.  I'll have to
let some other experts answer that.  We've only used iBatis with business
layers that were in their own assemblies.
 

  
 








From: Ryan
MacDonald [mailto:ryan@ryanmacdonald.net] 

Sent: Friday, May 18, 2007 3:06 PM

To: user-cs@ibatis.apache.org

Subject: RE: sqlMap Configuration
Issue
 

Ok,
do I have to use a precompiled assembly (.dll)? Right now I’m just trying
to use a .cs file in my app_code folder and it gets compiled at runtime. Can I
do it that way or do I need to compile it first?
 

  
 



~Ryan
 




  
 





From: Clough, Samuel
(USPC.PRG.Atlanta) [mailto:Samuel_Clough@princetonrg.com] 

Sent: Friday, May 18, 2007 3:03 PM

To: user-cs@ibatis.apache.org

Subject: RE: sqlMap Configuration
Issue
 







  
 



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(String
  typeName) +135
 
    
  IBatisNet.Common.Utilities.TypeUtils.ResolveType(String typeName) +28
 
    
  IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.Initialize(ConfigurationScope
  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(ConfigurationScope
  configScope) +292
 
    
  IBatisNet.DataMapper.Configuration.Serializers.ResultMapDeSerializer.Deserialize(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(String
  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.IPostBackEventHandler.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. 
 


























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. 













Mime
View raw message