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: DataAccess problems
Date Thu, 30 Mar 2006 03:18:21 GMT
Could you post your dao.config file? Since you're running in Debug
mode, can you provide the exact line number that is causing the
exception. Or re-paste your stack trace when ran in Debug mode. It
should contain line numbers.

--- "Svancara, Randall - CO 7th" <SvancarR@idhw.state.id.us> wrote:

> I rebuilt the source from the website http://ibatis.apache.org.  I am
> using Source Revision 356824.  I have loaded all the debugging
> symbols.
> Now when I run my test, the following code throws an exception in the
> DomDaoManagerBuilder class:
> 
> 		/// <summary>
> 		/// Build DaoManagers from config document.
> 		/// </summary>
> //		[MethodImpl(MethodImplOptions.Synchronized)]
> 		public void BuildDaoManagers(XmlDocument document, bool
> useConfigFileWatcher)
> 		{
> 			ConfigurationScope configurationScope = new
> ConfigurationScope();
> 
> 			configurationScope.UseConfigFileWatcher =
> useConfigFileWatcher;
> 			configurationScope.DaoConfigDocument = document;
> 
> 			configurationScope.XmlNamespaceManager = new
> XmlNamespaceManager(configurationScope.DaoConfigDocument.NameTable);
> 	
>
configurationScope.XmlNamespaceManager.AddNamespace(DAO_NAMESPACE_PREFIX
> , DAO_XML_NAMESPACE);
> 	
>
configurationScope.XmlNamespaceManager.AddNamespace(PROVIDERS_NAMESPACE_
> PREFIX, PROVIDER_XML_NAMESPACE);
> 
> 			try
> 			{
> 				GetConfig( configurationScope );
> 			}
> 			catch(Exception ex)
> 			{
> 				throw new ConfigurationException(
> configurationScope.ErrorContext.ToString(), ex);
> 			}
> 		}
> 
> Randall Svancara
> Web Developer
> OFFICE (208) 334-6992
> OFFICE CELL (208) 867-0715
> 
> 
> -----Original Message-----
> From: Svancara, Randall - CO 7th [mailto:SvancarR@idhw.state.id.us] 
> Sent: Wednesday, March 29, 2006 12:10 PM
> To: user-cs@ibatis.apache.org
> Subject: RE: DataAccess problems
> 
> HERE IS THE CONSTRUCTOR IN MY DAO object that is blowing up on me:
> 
>         public AccountService()
>         {
> 
>             try
>             {
>                 //_daoManager =
> ServiceConfig.GetInstance().DaoManager;
>                 DomDaoManagerBuilder builder = new
> DomDaoManagerBuilder();
>                 builder.Configure("dao.config");
>                 _daoManager = DaoManager.GetInstance("SqlMapDao");
>                 if (_daoManager == null)
>                 {
>                     Log.Info("daoManager is null you fool");
> 
>                 }
>                 //_accountDao =
> _daoManager.GetDao(typeof(IAccountDao))
> as IAccountDao;
>                 _accountDao =
> (IAccountDao)_daoManager[typeof(IAccountDao)];
>             }catch(Exception E)
>             {
>                 Log.Error("** Error: " + E.Message + "--" +
> E.InnerException);
>                 throw new DataAccessException("Error executing
> AccountService. Cause :" + E.Message, E);
> 
>             }
>         }
> 
> Randall Svancara
> Web Developer
> 
> 
> -----Original Message-----
> From: Svancara, Randall - CO 7th [mailto:SvancarR@idhw.state.id.us] 
> Sent: Wednesday, March 29, 2006 12:01 PM
> To: user-cs@ibatis.apache.org
> Subject: RE: DataAccess problems
> 
> STACK TRACE
> 
> See the end of this message for details on invoking 
> just-in-time (JIT) debugging instead of this dialog box.
> 
> ************** Exception Text **************
> IBatisNet.DataAccess.Exceptions.DataAccessException: Error executing
> AccountService. Cause :
> - The error occurred while configure DaoSessionHandler.
> - The error occurred in <property name="resource"
> value="SqlMap.config"
> xmlns="http://ibatis.apache.org/dataAccess" />.  
> - Check the
> IBatisNet.DataAccess.DaoSessionHandlers.SqlMapDaoSessionHandler. --->
> IBatisNet.Common.Exceptions.ConfigurationException: 
> - The error occurred while configure DaoSessionHandler.
> - The error occurred in <property name="resource"
> value="SqlMap.config"
> xmlns="http://ibatis.apache.org/dataAccess" />.  
> - Check the
> IBatisNet.DataAccess.DaoSessionHandlers.SqlMapDaoSessionHandler. --->
> IBatisNet.Common.Exceptions.ConfigurationException: DaoManager could
> not
> configure SqlMapDaoSessionHandler.Cause:  --->
> IBatisNet.Common.Exceptions.ConfigurationException --->
> System.NullReferenceException: Object reference not set to an
> instance
> of an object.
>    at
> IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Initialize()
>    at
> IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
> document, DataSource dataSource, Boolean useConfigFileWatcher,
> Boolean
> isCallFromDao)
>    --- End of inner exception stack trace ---
>    at
> IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
> document, DataSource dataSource, Boolean useConfigFileWatcher,
> Boolean
> isCallFromDao)
>    at
> IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
> document, DataSource dataSource, Boolean useConfigFileWatcher,
> NameValueCollection properties)
>    at
>
IBatisNet.DataAccess.DaoSessionHandlers.SqlMapDaoSessionHandler.Configur
> e(NameValueCollection properties, IDictionary resources)
>    --- End of inner exception stack trace ---
>    at
>
IBatisNet.DataAccess.DaoSessionHandlers.SqlMapDaoSessionHandler.Configur
> e(NameValueCollection properties, IDictionary resources)
>    at
>
IBatisNet.DataAccess.Configuration.DomDaoManagerBuilder.GetContexts(Conf
> igurationScope configurationScope)
>    at
>
IBatisNet.DataAccess.Configuration.DomDaoManagerBuilder.BuildDaoManagers
> (XmlDocument document, Boolean useConfigFileWatcher)
>    --- End of inner exception stack trace ---
>    at
>
IBatisNet.DataAccess.Configuration.DomDaoManagerBuilder.BuildDaoManagers
> (XmlDocument document, Boolean useConfigFileWatcher)
>    at
>
IBatisNet.DataAccess.Configuration.DomDaoManagerBuilder.Configure(String
> resource)
>    at Test.Service.AccountService..ctor() in D:\Data\Visual Studio
> 2005\Projects\IBATIS_TEST\Test.Service\AccountService.cs:line 40
>    --- End of inner exception stack trace ---
>    at Test.Service.AccountService..ctor() in D:\Data\Visual Studio
> 2005\Projects\IBATIS_TEST\Test.Service\AccountService.cs:line 52
>    at Test.Client.Form1.button1_Click(Object sender, EventArgs e) in
> D:\Data\Visual Studio
> 2005\Projects\IBATIS_TEST\Test.Client\Form1.cs:line 30
>    at System.Windows.Forms.Control.OnClick(EventArgs e)
>    at System.Windows.Forms.Button.OnClick(EventArgs e)
>    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
>    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
> button, Int32 clicks)
>    at System.Windows.Forms.Control.WndProc(Message& m)
>    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
>    at System.Windows.Forms.Button.WndProc(Message& m)
>    at
> System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&
> m)
>    at
> System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
> m)
>    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
> msg,
> IntPtr wparam, IntPtr lparam)
> 
> 
> ************** Loaded Assemblies **************
> mscorlib
>     Assembly Version: 2.0.0.0
>     Win32 Version: 2.0.50727.42 (RTM.050727-4200)
>     CodeBase:
> file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
> ----------------------------------------
> Test.Client
>     Assembly Version: 1.0.0.0
>     Win32 Version: 1.0.0.0
>     CodeBase:
>
file:///D:/Data/Visual%20Studio%202005/Projects/IBATIS_TEST/Test.Client/
> bin/Debug/Test.Client.exe
> ----------------------------------------
> 
=== message truncated ===

Mime
View raw message