-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: undefined alias or unknown mapping
PostPosted: Wed Mar 15, 2006 4:16 pm 
Newbie

Joined: Tue Mar 14, 2006 5:32 am
Posts: 12
Location: South Africa
Hibernate version:NHibernate version 1.0.2

Mapping documents:Mapping Document (minus a few similarly defined property tags to lessen the noise):

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="KSA.Gl.DataMapper.GlAccountRegister, KSA.Gl.DataMapper" table="ksaGlAccountRegister">
<id name="codeID" type="Int64" unsaved-value="0">
<column name="CodeID" sql-type="bigint" not-null="true" unique="true" index="PK_ksaGlAccountRegister"/>
<generator class="assigned" />
</id>
<version name="updatedOn" column="UpdatedOn" type="DateTime"/>
<property name="code" type="String">
<column name="Code" length="50" sql-type="varchar" not-null="true" index="IX_ksaGlAccountRegister_Code"/>
</property>
<property name="description" type="String">
<column name="Description" length="100" sql-type="varchar" not-null="true"/>
</property>
<property name="rowStateTypeID" type="Int32">
<column name="RowStateTypeID" sql-type="int" not-null="true"/>
</property>
<property name="updatedByCodeID" type="Int64">
<column name="UpdatedByCodeID" sql-type="bigint" not-null="true"/>
</property>

<property name="systemCodeID" type="Int64">
<column name="SystemCodeID" sql-type="bigint" not-null="true" index="IX_ksaGlAccountRegister_Code"/>
</property>
</class>
</hibernate-mapping>


Full stack trace of any exception that occurs:When I execute the Query using CreateQuery(hql) I get the following exception


{"undefined alias or unknown mapping: KSA [from KSA.Gl.DataMapper.GlAccountRegister WHERE SystemCodeID = :systemCodeID AND RowStateTypeID = :rowStateTypeID ORDER BY Code]" }

What I find particularly strange is that another table that I treat in the same way works fine, but all subsequent tables I've tried give me the above exception. I have compared everything I can find to establish a difference to no avail.

I have also tried using <hibernate-mapping auto-import="false"> without success.


Name and version of the database you are using: SQL


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 16, 2006 12:57 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Your query looks incorrect. Try with an alias:
Code:
from GlAccountRegister reg where reg.SystemCodeID = :systemCodeID and reg.RowStateTypeID = :rowStateTypeID order by reg.Code


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 16, 2006 4:43 pm 
Newbie

Joined: Tue Mar 14, 2006 5:32 am
Posts: 12
Location: South Africa
Thanks Sergey.

I did try that and got exception:

{"in expected: reg [from GlAccountRegister reg WHERE reg.SystemCodeID = :systemCodeID AND reg.RowStateTypeID = :rowStateTypeID ORDER BY reg.Code]" }

I think that it may be related to the KSA.Gl.DataMapper.GlAccountRegister as per my original query, but don't know how to fix it. If I use the fuly qualified name with an alias, I still get the undefined alias exception.

Regards


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 16, 2006 6:12 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
It looks like the mapping of GlAccountRegister was not added into the NHibernate Configuration for some reason. Check that you have the mapping file build action set to embedded resource (if you use mappings as embedded resources).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 2:28 pm 
Newbie

Joined: Tue Mar 14, 2006 5:32 am
Posts: 12
Location: South Africa
Hi Sergey

All my mapping files are embedded resources and I've rebuilt my solution a number of times.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 7:14 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Ok, I'm out of guesses then. Please enable debug-level logging and paste the log output here.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 18, 2006 12:59 pm 
Newbie

Joined: Tue Mar 14, 2006 5:32 am
Posts: 12
Location: South Africa
Not sure I know how to do that but I'll try and find out.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 20, 2006 6:23 am 
Newbie

Joined: Tue Mar 14, 2006 5:32 am
Posts: 12
Location: South Africa
Hi Sergey

This is the debug info you requested. Hope it highlights the problem.

Thanks

'DefaultDomain': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded.
'KSA': Loaded 'C:\Projects\KSA\KSA\bin\Debug\KSA.exe', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.common.ui.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\janus.windows.ui.v2.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\janus.windows.common.v2.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.design\1.0.5000.0__b03f5f7f11d50a3a\system.design.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.vital.api.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.common.api.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.acc.api.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.gl.api.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.vital.dataaccess.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.common.dataaccess.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.common.countermanager.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.common.datamapper.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\nhibernate.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.common.helpers.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\log4net.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.vital.datamapper.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\nullables.dll', No symbols loaded.
'KSA.exe': Loaded 'kab9yakp', No symbols loaded.
'KSA.exe': Loaded 'iyw9lfpv', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\nullables.nhibernate.dll', No symbols loaded.
'KSA.exe': Loaded 'uljteb_o', No symbols loaded.
'KSA.exe': Loaded 'c0_jio-z', No symbols loaded.
'KSA.exe': Loaded 'ackkqvr2', No symbols loaded.
'KSA.exe': Loaded 'krjyebpf', No symbols loaded.
'KSA.exe': Loaded 'twrahezv', No symbols loaded.
'KSA.exe': Loaded 'khtq5i8y', No symbols loaded.
'KSA.exe': Loaded 'm4rzix64', No symbols loaded.
'KSA.exe': Loaded 'gava39ps', No symbols loaded.
'KSA.exe': Loaded 'qfz2nyqo', No symbols loaded.
'KSA.exe': Loaded 'ry39jep3', No symbols loaded.
'KSA.exe': Loaded '18m1clei', No symbols loaded.
'KSA.exe': Loaded 's_1x-ll2', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\iesi.collections.dll', No symbols loaded.
'KSA.exe': Loaded 'xqbtrcgr', No symbols loaded.
'KSA.exe': Loaded 'jb7bwiv5', No symbols loaded.
'KSA.exe': Loaded '3hmkfbyo', No symbols loaded.
'KSA.exe': Loaded 'txx6fgzo', No symbols loaded.
'KSA.exe': Loaded 'xr8imvwn', No symbols loaded.
'KSA.exe': Loaded 'hz54jf1f', No symbols loaded.
'KSA.exe': Loaded 'so_sr84k', No symbols loaded.
'KSA.exe': Loaded 'dqgs2yyj', No symbols loaded.
'KSA.exe': Loaded '691u5iz-', No symbols loaded.
'KSA.exe': Loaded 'gvl9wste', No symbols loaded.
'KSA.exe': Loaded 'af8e2x0j', No symbols loaded.
'KSA.exe': Loaded 'qhcoxroj', No symbols loaded.
'KSA.exe': Loaded 'tfgvlfvo', No symbols loaded.
'KSA.exe': Loaded 'ser55wh3', No symbols loaded.
'KSA.exe': Loaded 'ofvqy07v', No symbols loaded.
'KSA.exe': Loaded 'pvgwq8bf', No symbols loaded.
'KSA.exe': Loaded 'zthlbwao', No symbols loaded.
'KSA.exe': Loaded 'lwagkvnk', No symbols loaded.
'KSA.exe': Loaded 'fcx5_qma', No symbols loaded.
'KSA.exe': Loaded 'j-6ae1_r', No symbols loaded.
'KSA.exe': Loaded 'mymna36m', No symbols loaded.
'KSA.exe': Loaded 'si2ngmpd', No symbols loaded.
'KSA.exe': Loaded 'ig86aeoq', No symbols loaded.
'KSA.exe': Loaded 'eo0i-qbg', No symbols loaded.
'KSA.exe': Loaded 'uqagb1fo', No symbols loaded.
'KSA.exe': Loaded 'vp0xttn1', No symbols loaded.
'KSA.exe': Loaded 'mjqmsn8a', No symbols loaded.
'KSA.exe': Loaded '9ydohk2o', No symbols loaded.
'KSA.exe': Loaded 'iisvlebh', No symbols loaded.
'KSA.exe': Loaded 'rcfrf8cy', No symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.thunk.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.acc.dataaccess.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.gl.dataaccess.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\accessibility\1.0.5000.0__b03f5f7f11d50a3a\accessibility.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.gl.ui.dll', Symbols loaded.
An unhandled exception of type 'NHibernate.QueryException' occurred in ksa.gl.dataaccess.dll

Additional information: undefined alias or unknown mapping: KSA


Unhandled Exception: NHibernate.QueryException: undefined alias or unknown mapping: KSA [from KSA.Gl.DataMapper.GlAccountRegister reg WHERE reg.SystemCodeID = :systemCodeID AND reg.RowStateTypeID = :rowStateTypeID ORDER BY reg.Code]
at KSA.Gl.DataAccess.DaGlAccountRegister.GetSystemRowStatusList(Int64 systemCodeID, Boolean activeOnly) in c:\projects\ksa\ksa.gl.dataaccess\daglaccountregister.cs:line 34
at KSA.Gl.API.Ports.GlAccountRegisterPort.GetAccountRegisterList(Boolean activeOnly) in C:\Projects\KSA\KSA.Gl.API\Ports\GlAccountRegisterPort.cs:line 88
at KSA.Gl.UI.Management.Manage.ManageAccounts() in C:\Projects\KSA\KSA.Gl.UI\Management\Manage.cs:line 34
at KSA.FormMain.CmdManageGlAccounts() in C:\Projects\KSA\KSA\FormMain.cs:line 575
at KSA.FormMain.uiCommandManager_CommandClick(Object sender, CommandEventArgs e) in C:\Projects\KSA\KSA\FormMain.cs:line 562
at Janus.Windows.UI.CommandBars.UICommandManager.OnCommandClick(CommandEventArgs e)
at Janus.Windows.UI.CommandBars.UICommandManager.Janus.Windows.UI.CommandBars.ICommandOwner.OnCommandClicked(CommandEventArgs e)
at Janus.Windows.UI.CommandBars.UICommandCollection.c(Object , CommandEventArgs )
at Janus.Windows.UI.CommandBars.UICommand.OnClick(CommandEventArgs e)
at Janus.Windows.UI.CommandBars.UICommand.ac()
at Janus.Windows.UI.CommandBars.UICommandBar.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at KSA.FormMain.Main() in C:\Projects\KSA\KSA\FormMain.cs:line 551The program '[636] KSA.exe' has exited with code 0 (0x0).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 21, 2006 6:01 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
No, it's not what I had in mind. See this page: http://www.hibernate.org/364.html.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 21, 2006 11:00 am 
Newbie

Joined: Tue Mar 14, 2006 5:32 am
Posts: 12
Location: South Africa
Apologies Sergey, I don't think my log4net.XmlConfigurator.Configure was being called early enough. Hope the additional info sheds some light on the subject

Regards
Gary


'DefaultDomain': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded.
'KSA': Loaded 'C:\Projects\KSA\KSA\bin\Debug\KSA.exe', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.common.ui.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\janus.windows.ui.v2.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\janus.windows.common.v2.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.design\1.0.5000.0__b03f5f7f11d50a3a\system.design.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.vital.api.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.common.api.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.acc.api.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.gl.api.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.vital.dataaccess.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.common.dataaccess.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.common.countermanager.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.common.datamapper.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.common.logger.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.common.helpers.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\log4net.dll', No symbols loaded.
log4net: XmlHierarchyConfigurator: Configuration update mode [Merge].
log4net: XmlHierarchyConfigurator: Configuration update mode [Merge].
log4net: XmlHierarchyConfigurator: Logger [root] Level string is [ALL].
log4net: XmlHierarchyConfigurator: Logger [root] level set to [name="ALL",value=-2147483648].
log4net: XmlHierarchyConfigurator: Loading Appender [OutputDebugStringAppender] type: [log4net.Appender.OutputDebugStringAppender]
log4net: PatternParser: Converter [message] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [newline] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: XmlHierarchyConfigurator: Setting Property [ConversionPattern] to String value [%d [%t] %-5p %c [%x] - %m%n]
log4net: PatternParser: Converter [d] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [literal] Option [ [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [t] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [literal] Option [] ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: XmlHierarchyConfigurator: Logger [root] Level string is [ALL].
log4net: XmlHierarchyConfigurator: Logger [root] level set to [name="ALL",value=-2147483648].
log4net: XmlHierarchyConfigurator: Loading Appender [OutputDebugStringAppender] type: [log4net.Appender.OutputDebugStringAppender]
log4net: PatternParser: Converter [message] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [newline] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: XmlHierarchyConfigurator: Setting Property [ConversionPattern] to String value [%d [%t] %-5p %c [%x] - %m%n]
log4net: PatternParser: Converter [d] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [literal] Option [ [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [t] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [literal] Option [] ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [p] Option [] Format [min=5,max=2147483647,leftAlign=True]
log4net: PatternParser: Converter [literal] Option [ ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [c] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [literal] Option [ [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [x] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [literal] Option [] - ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [m] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [n] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: XmlHierarchyConfigurator: Setting Property [Layout] to object [log4net.Layout.PatternLayout]
log4net: XmlHierarchyConfigurator: Created Appender [OutputDebugStringAppender]

log4net: PatternParser: Converter [p] Option [] Format [min=5,max=2147483647,leftAlign=True]
log4net: PatternParser: Converter [literal] Option [ ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [c] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [literal] Option [ [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [x] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [literal] Option [] - ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [m] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: PatternParser: Converter [n] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: XmlHierarchyConfigurator: Setting Property [Layout] to object [log4net.Layout.PatternLayout]
log4net: XmlHierarchyConfigurator: Created Appender [OutputDebugStringAppender]
log4net: XmlHierarchyConfigurator: Adding appelog4net: XmlHierarchyConfigurator: Adding appender named [OutputDebugStringAppender] to logger [root].
log4net: XmlHierarchyConfigurator: Retrieving an instance of log4net.Repository.Logger for logger [KSA].
log4net: XmlHierarchyConfigurator: Setting [KSA] additivity to [True].
log4net: XmlHierarchyConfigurator: Logger [KSA] Level string is [DEBUG].
log4net: XmlHierarchyConfigurator: Logger [KSA] level set to [name="DEBUG",value=30000].
log4net: XmlHierarchyConfigurator: Adding appender named [OutputDebugStringAppender] to logger [KSA].
log4net: XmlHierarchyConfigurator: Retrieving an instance of log4net.Repository.Logger for logger [NHibernate.Cache].
log4net: XmlHierarchyConfigurator: Setting [NHibernate.Cache] additivity to [True].
log4net: XmlHierarchyConfigurator: Logger [NHibernate.Cache] Level string is [DEBUG].
log4net: XmlHierarchyConfigurator: Logger [NHibernate.Cache] level set to [name="DEBUG",value=30000].
log4net: XmlHierarchyConfigurator: Adding appender named [OutputDebugStringAppender] to logger [NHibernate.Cache].
nder named [OutputDebugStringAppender] to logger [root].
log4net: XmlHierarchyConfigurator: Retrieving an instance of log4net.Repository.Logger for logger [KSA].
log4net: XmlHierarchyConfigurator: Setting [KSA] additivity to [True].
log4net: XmlHierarchyConfigurator: Logger [KSA] Level string is [DEBUG].
log4net: XmlHierarchyConfigurator: Logger [KSA] level set to [name="DEBUG",value=30000].
log4net: XmlHierarchyConfigurator: Adding appender named [OutputDebugStringAppender] to logger [KSA].
log4net: XmlHierarchyConfigurator: Retrieving an instance of log4net.Repository.Logger for logger [NHibernate.Cache].
log4net: XmlHierarchyConfigurator: Setting [NHibernate.Cache] additivity to [True].
log4net: XmlHierarchyConfigurator: Logger [NHibernate.Cache] Level string is [DEBUG].
log4net: XmlHierarchyConfigurator: Logger [NHibernate.Cache] level set to [name="DEBUG",value=30000].
log4net: XmlHierarchyConfigurator: Adding appender named [OutputDebugStringAppender] to logger [NHibernate.Cache].
log4net: log4net: XmlHierarchyConfigurator: Retrieving an instance of log4net.Repository.Logger for logger [NHibernate.Impl.BatcherImpl].
log4net: XmlHierarchyConfigurator: Setting [NHibernate.Impl.BatcherImpl] additivity to [True].
log4net: XmlHierarchyConfigurator: Logger [NHibernate.Impl.BatcherImpl] Level string is [WARN].
log4net: XmlHierarchyConfigurator: Logger [NHibernate.Impl.BatcherImpl] level set to [name="WARN",value=60000].
log4net: XmlHierarchyConfigurator: Adding appender named [OutputDebugStringAppender] to logger [NHibernate.Impl.BatcherImpl].
log4net: XmlHierarchyConfigurator: Retrieving an instance of log4net.Repository.Logger for logger [NHibernate.SQL].
log4net: XmlHierarchyConfigurator: Setting [NHibernate.SQL] additivity to [True].
log4net: XmlHierarchyConfigurator: Logger [NHibernate.SQL] Level string is [ALL].
log4net: XmlHierarchyConfigurator: Logger [NHibernate.SQL] level set to [name="ALL",value=-2147483648].
XmlHierarchyConfigurator: Retrieving an instance of log4net.Repository.Logger for logger [NHibernate.Impl.BatcherImpl].
log4net: XmlHierarchyConfigurator: Setting [NHibernate.Impl.BatcherImpl] additivity to [True].
log4net: XmlHierarchyConfigurator: Logger [NHibernate.Impl.BatcherImpl] Level string is [WARN].
log4net: XmlHierarchyConfigurator: Logger [NHibernate.Impl.BatcherImpl] level set to [name="WARN",value=60000].
log4net: XmlHierarchyConfigurator: Adding appender named [OutputDebugStringAppender] to logger [NHibernate.Impl.BatcherImpl].
log4net: XmlHierarchyConfigurator: Retrieving an instance of log4net.Repository.Logger for logger [NHibernate.SQL].
log4net: XmlHierarchyConfigurator: Setting [NHibernate.SQL] additivity to [True].
log4net: XmlHierarchyConfigurator: Logger [NHibernate.SQL] Level string is [ALL].
log4net: XmlHierarchyConfigurator: Logger [NHibernate.SQL] level set to [name="ALL",value=-2147483648].
log4net: XmlHierarchyConfigurator: Adding appender named [OutputDebugStringAppenlog4net: XmlHierarchyConfigurator: Adding appender named [OutputDebugStringAppender] to logger [NHibernate.SQL].
log4net: XmlHierarchyConfigurator: Retrieving an instance of log4net.Repository.Logger for logger [NHibernate].
log4net: XmlHierarchyConfigurator: Setting [NHibernate] additivity to [True].
log4net: XmlHierarchyConfigurator: Logger [NHibernate] Level string is [DEBUG].
log4net: XmlHierarchyConfigurator: Logger [NHibernate] level set to [name="DEBUG",value=30000].
log4net: XmlHierarchyConfigurator: Adding appender named [OutputDebugStringAppender] to logger [NHibernate].
log4net: XmlHierarchyConfigurator: Hierarchy Threshold []
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\nhibernate.dll', No symbols loaded.
log4net: DefaultRepositorySelector: Creating repository for assembly [NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc]
log4net: DefaultRepositorySelector: Assembly [NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc] Loaded From [c:\projects\ksa\ksa\bin\debug\nhibernate.dll]
der] to logger [NHibernate.SQL].
log4net: XmlHierarchyConfigurator: Retrieving an instance of log4net.Repository.Logger for logger [NHibernate].
log4net: XmlHierarchyConfigurator: Setting [NHibernate] additivity to [True].
log4net: XmlHierarchyConfigurator: Logger [NHibernate] Level string is [DEBUG].
log4net: XmlHierarchyConfigurator: Logger [NHibernate] level set to [name="DEBUG",value=30000].
log4net: XmlHierarchyConfigurator: Adding appender named [OutputDebugStringAppender] to logger [NHibernate].
log4net: XmlHierarchyConfigurator: Hierarchy Threshold []
log4net: DefaultRepositorySelector: Creating repository for assembly [NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc]
log4net: DefaultRepositorySelector: Assembly [NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc] Loaded From [c:\projects\ksa\ksa\bin\debug\nhibernate.dll]
log4net: DefaultRepositorySelector: Assembly [NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcblog4net: DefaultRepositorySelector: Assembly [NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc] does not have a RepositoryAttribute specified.
log4net: DefaultRepositorySelector: Assembly [NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
log4net: DefaultRepositorySelector: repository [log4net-default-repository] already exists, using repository type [log4net.Repository.Hierarchy.Hierarchy]
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.vital.datamapper.dll', Symbols loaded.
44c4484fc] does not have a RepositoryAttribute specified.
log4net: DefaultRepositorySelector: Assembly [NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
log4net: DefaultRepositorySelector: repository [log4net-default-repository] already exists, using repository type [log4net.Repository.Hierarchy.Hierarchy]
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\nullables.dll', No symbols loaded.
'KSA.exe': Loaded 'bq__iinb', No symbols loaded.
'KSA.exe': Loaded '5xap4-9g', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\nullables.nhibernate.dll', No symbols loaded.
'KSA.exe': Loaded 'ettyyl-y', No symbols loaded.
'KSA.exe': Loaded 'gyjwrgxc', No symbols loaded.
'KSA.exe': Loaded 'wyjvtkrv', No symbols loaded.
'KSA.exe': Loaded '9lbh-kbq', No symbols loaded.
'KSA.exe': Loaded 'q3xoar-a', No symbols loaded.
'KSA.exe': Loaded 'lada51wr', No symbols loaded.
'KSA.exe': Loaded '9vom6fod', No symbols loaded.
'KSA.exe': Loaded 'ugejmrgf', No symbols loaded.
'KSA.exe': Loaded 'wrtk0nfs', No symbols loaded.
'KSA.exe': Loaded '3hijjr9q', No symbols loaded.
'KSA.exe': Loaded '8zod_aap', No symbols loaded.
'KSA.exe': Loaded 'sgjz2gr9', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\iesi.collections.dll', No symbols loaded.
'KSA.exe': Loaded 'ywarnzbb', No symbols loaded.
'KSA.exe': Loaded 'smofn5pz', No symbols loaded.
'KSA.exe': Loaded 'xyve3-ao', No symbols loaded.
'KSA.exe': Loaded 'yfmk99v8', No symbols loaded.
'KSA.exe': Loaded 'rnt0kmd9', No symbols loaded.
'KSA.exe': Loaded 'kntmzjbn', No symbols loaded.
'KSA.exe': Loaded '0vdkcmy7', No symbols loaded.
'KSA.exe': Loaded 'txnqjsse', No symbols loaded.
'KSA.exe': Loaded 'bu9qdgz2', No symbols loaded.
'KSA.exe': Loaded 'ici4kdik', No symbols loaded.
'KSA.exe': Loaded 'n_7t0wy9', No symbols loaded.
'KSA.exe': Loaded 'ew35rem6', No symbols loaded.
'KSA.exe': Loaded 'qs5gg8sr', No symbols loaded.
'KSA.exe': Loaded 'o-5xqyo5', No symbols loaded.
'KSA.exe': Loaded 'ip9wparw', No symbols loaded.
'KSA.exe': Loaded 'nqhaky7-', No symbols loaded.
'KSA.exe': Loaded '5queukjv', No symbols loaded.
'KSA.exe': Loaded 'c5rg-pvc', No symbols loaded.
'KSA.exe': Loaded 'o3wizla7', No symbols loaded.
'KSA.exe': Loaded 'ykf6qyrk', No symbols loaded.
'KSA.exe': Loaded 'a_xdsktq', No symbols loaded.
'KSA.exe': Loaded '9fhxcaxo', No symbols loaded.
'KSA.exe': Loaded 'renripjx', No symbols loaded.
'KSA.exe': Loaded 'ptv9tl4n', No symbols loaded.
'KSA.exe': Loaded 'shqwfjnb', No symbols loaded.
'KSA.exe': Loaded 'egjwbvhc', No symbols loaded.
'KSA.exe': Loaded 'ynkowga0', No symbols loaded.
'KSA.exe': Loaded 'aeyd5ir8', No symbols loaded.
'KSA.exe': Loaded 'zahu05us', No symbols loaded.
'KSA.exe': Loaded 'lvxbx1e0', No symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.thunk.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.acc.dataaccess.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.gl.dataaccess.dll', Symbols loaded.
'KSA.exe': Loaded 'c:\windows\assembly\gac\accessibility\1.0.5000.0__b03f5f7f11d50a3a\accessibility.dll', No symbols loaded.
'KSA.exe': Loaded 'c:\projects\ksa\ksa\bin\debug\ksa.gl.ui.dll', Symbols loaded.
An unhandled exception of type 'NHibernate.QueryException' occurred in ksa.gl.dataaccess.dll

Additional information: undefined alias or unknown mapping: KSA


Unhandled Exception: NHibernate.QueryException: undefined alias or unknown mapping: KSA [from KSA.Gl.DataMapper.GlAccountRegister reg WHERE reg.SystemCodeID = :systemCodeID AND reg.RowStateTypeID = :rowStateTypeID ORDER BY reg.Code]
at KSA.Gl.DataAccess.DaGlAccountRegister.GetSystemRowStatusList(Int64 systemCodeID, Boolean activeOnly) in c:\projects\ksa\ksa.gl.dataaccess\daglaccountregister.cs:line 34
at KSA.Gl.API.Ports.GlAccountRegisterPort.GetAccountRegisterList(Boolean activeOnly) in C:\Projects\KSA\KSA.Gl.API\Ports\GlAccountRegisterPort.cs:line 88
at KSA.Gl.UI.Management.Manage.ManageAccounts() in C:\Projects\KSA\KSA.Gl.UI\Management\Manage.cs:line 34
at KSA.FormMain.CmdManageGlAccounts() in c:\projects\ksa\ksa\formmain.cs:line 575
at KSA.FormMain.uiCommandManager_CommandClick(Object sender, CommandEventArgs e) in c:\projects\ksa\ksa\formmain.cs:line 562
at Janus.Windows.UI.CommandBars.UICommandManager.OnCommandClick(CommandEventArgs e)
at Janus.Windows.UI.CommandBars.UICommandManager.Janus.Windows.UI.CommandBars.ICommandOwner.OnCommandClicked(CommandEventArgs e)
at Janus.Windows.UI.CommandBars.UICommandCollection.c(Object , CommandEventArgs )
at Janus.Windows.UI.CommandBars.UICommand.OnClick(CommandEventArgs e)
at Janus.Windows.UI.CommandBars.UICommand.ac()
at Janus.Windows.UI.CommandBars.UICommandBar.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at KSA.FormMain.Main() in c:\projects\ksa\ksa\formmain.cs:line 551The program '[356] KSA.exe' has exited with code 0 (0x0).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 21, 2006 2:01 pm 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
I think you turned on log4net debugging, which isn't what Sergey was looking for. By "debug level logging" Sergey meant that you log with the root logger set to level='DEBUG' or level='ALL'. The debug attribute on the log4net element should be set to false (e.g., <log4net debug="false">...) (or not present; false is the default).

Check out the log4net site for more info. It's a very helpful tool and is worth knowing something about.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 22, 2006 7:34 am 
Newbie

Joined: Tue Mar 14, 2006 5:32 am
Posts: 12
Location: South Africa
You are correct that I had log4net debug="true", but my root level is also set to ALL. So maybe I provided more info than was required but the relevant stuff should also be there.

When log4net debug="false", I only get the stuff that I posted initially which Sergey was not wanting, even though my root level is set to ALL.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 22, 2006 9:41 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
If logging was configured correctly, it would have included lots of information about configuring and creating your session factory, opening a session and so on, and there's nothing like it in what you posted.

Can you show us how you enable logging? What does your config file look like? What does the call to initialize log4net look like?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 22, 2006 1:37 pm 
Newbie

Joined: Tue Mar 14, 2006 5:32 am
Posts: 12
Location: South Africa
I Initialise with in the startup FormLoad with XmlConfigurator.Configure(); I'm not aware of anything else to enable logging specifically (apologies, but this was setup by another developer who has since left)

Config File:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<nhibernate>
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect" />
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
<add key="hibernate.connection.connection_string" value="data source=LT_KNIGHT_Gary;initial catalog=ShiningArmour;integrated security=false;persist security info=True;User ID=sa;Password=" />
</nhibernate>
<log4net debug="false">
<appender name="OutputDebugStringAppender" type="log4net.Appender.OutputDebugStringAppender" >
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />
</layout>
</appender>

<appender name="FileAppender" type="log4net.Appender.FileAppender">
<file value="FileAppender log-file.txt" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>

<appender name="NHibernateAppender" type="KSA.Common.Logger.NHibernateAppender">
<param name="Threshold" value="DEBUG" />
</appender>

<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="KSA" />
<param name="AppendToFile" value="true" />
<param name="DatePattern" value="yyyy.MM.dd.LOG" />
<param name="MaxSizeRollBackups" value="10" />
<param name="MaximumFileSize" value="1024KB" />
<param name="RollingStyle" value="Composite" />
<param name="StaticLogFileName" value="false" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />
</layout>
</appender>

<appender name="SMTPAppender" type="log4net.Appender.SMTPAppender">
<param name="Threshold" value="OFF" />
<param name="To" value="to@domain.com" />
<param name="From" value="from@domain.com" />
<param name="Subject" value="test logging message" />
<param name="SMTPHost" value="localhost" />
<param name="LocationInfo" value="false" />
<param name="BufferSize" value="512" />
<param name="Lossy" value="false" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%n%d [%t] %-5p %c [%x] - %m%n%n%n" />
</layout>
</appender>

<root>
<!-- levels: DEBUG, INFO, WARN, ERROR, FATAL -->
<priority value="ALL" />
<level value="ALL" />
<appender-ref ref="OutputDebugStringAppender" />
<!--
<appender-ref ref="RollingLogFileAppender" />
<appender-ref ref="SMTPAppender" />
-->
</root>

<logger name="KSA">
<level value="DEBUG" />
<appender-ref ref="OutputDebugStringAppender" />
</logger>

<logger name="NHibernate.Cache">
<level value="DEBUG" />
<appender-ref ref="OutputDebugStringAppender" />
</logger>

<logger name="NHibernate.Impl.BatcherImpl">
<level value="WARN" />
<appender-ref ref="OutputDebugStringAppender" />
</logger>

<logger name="NHibernate.SQL">
<level value="ALL" />
<appender-ref ref="OutputDebugStringAppender" />
</logger>

<logger name="NHibernate">
<level value="DEBUG" />
<appender-ref ref="OutputDebugStringAppender" />
</logger>
</log4net>
</configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 22, 2006 4:59 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Ok, this all looks correct, so maybe the log is actually being produced (by OutputDebugString) but you can't see it. Can you temporarily change the appender type to ConsoleAppender or TraceAppender (see examples on the Wiki page I linked to earlier) and see if anything different happens?

What I'm trying to check for is whether NHibernate actually loads all the mapping files you want it to use, so I need logging to be enabled before the NHibernate Configuration object is created. Check that XmlConfigurator.Configure call happens early enough in your case (I don't know if calling it in FormLoad is early enough).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.