Trying to make fluent NHibernate work, what's FluentConfiguration.cs? - fluent-nhibernate

I'm trying to follow this tutorial, but VS debugger keep asking me for a file named
FluentConfiguration.cs when it gets to this line:
return Fluently.Configure()
.Database(MySQLConfiguration.Standard
.ConnectionString(c => c
.Server("localhost")
.Database("test")
.Username("root")
.Password("w1e2a3r4")))
.Mappings(m => m
.AutoMappings.Add(model))
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory();
All my code is completely identical to the tutorial's except for this line (I'm using MySql). I triple checked the parameters and it should be ok..
What I get is a dialog box asking me to locate FluentConfiguration.cs, and when it fails to find it it gives:
An invalid or incomplete configuration was used while creating a SessionFactory.
Check PotentialReasons collection, and InnerException for more detail.
I tried copying this file from here, but this didn't work as well.
What am I missing out on here?
Technical info- I'm using VS 2010 express, ASP.NET MVC3, MySQL server 5.5 and connector: 6.3.6
Edit:
This is the inner exception's message:
Could not create the driver from NHibernate.Driver.MySqlDataDriver, NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4.
Edit 2:
Now I'm getting "checksum doesn't match:
Locating source for 'd:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs'. Checksum: MD5 {94 f4 4c 43 49 bd 48 fb 9a d7 b2 fc 5 e1 4e d8}
Determining whether the checksum matches for the following locations:
1: C:\Users\Oren\Desktop\FluentConfiguration.cs Checksum: MD5 {84 33 30 45 11 da 3d 40 8e 2d 3c a9 e 7c cc 14} Checksum doesn't match.
The file 'd:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs' does not exist.
Looking in script documents for 'd:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs'...
Looking in the projects for 'd:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs'.
The file was found in a project: 'C:\Users\Oren\Desktop\FluentConfiguration.cs'.
Determining whether the checksum matches for the following locations:
1: C:\Users\Oren\Desktop\FluentConfiguration.cs Checksum: MD5 {84 33 30 45 11 da 3d 40 8e 2d 3c a9 e 7c cc 14} Checksum doesn't match.
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\vc7\atlmfc'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\vc7\crt'...
Looking in directory 'C:\Users\Oren\Desktop\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs.
The debugger could not locate the source file 'd:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs'.

Copy-pasted the fluent hibernate dlls and pdbs again, and problem was solved.

to resolve this issue. I had to add a reference to NHibernate.ByteCode.Castle.dll

The debugger is asking for one of the source files for Fluent nHibernate. You could download this because it is open source and debug it in detail, though the answer is in the InnerException.
This is probably due to a class that has not been mapped or possibly properties not being marked as virtual, or simply a database table that does not follow the standard FNH conventions. You need to get to the InnerException and read what it says as nHibernate exceptions are generally very helpful. I had plenty of trouble getting to the inner exception when I was trying to run unit tests running MSTest. I switched back to nUnit and had no trouble.
Another very useful thing to do is to output your .hbm files during the config process (FNH generates these for you behind the scenes). See Generate XML mappings from fluent Nhibernate for details. Note: I usually add a compiler directive to ensure that I only output the .hbm files in debug builds.

Related

Extract Text from Response Body in Coded Webtest using vb

I have a Web performance Script in Visual Studio. I have turned this into Coded Webtest in VB by clicking on the Generate Code button.
In my web test there are a 5 functions. Apart from the 1st the others are for SQL Procedures.
Among a few things, I need a web request that does a certain action. Based on that action, In the response body - it generates a Unique Id.
I need this Id to make it accessible across all the functions.
The Response body is something like this :
0x00000000 7B 22 69 64 22 3A 36 35 33 30 36 36 33 7D {"id":2133221}
Now I wanted to know, how do I do it. I just need 2133221.
I tried
using the Context Parameter name and appending it to a .to string...it did not work. I tried doing by looking over the net and trying out a few options. I'm lost now. Can anyone help.
The simplest solution is the below one.
str = "0x00000000 7B 22 69 64 22 3A 36 35 33 30 36 36 33 7D {""id"":2133221}"
arr = Split(str, ":")
strID = Left(arr(1), len(arr(1)) - 1)
msgbox strId
However, If you still need a more robust one, try regex
See access the response from a web coded performance test for how to access the response ina coded test. While it is in C# the VB style is similar.
For your case the displayed string shows a hex dump of the actual body. Th ebody does not include the 0x00000000 7B 22 69 64 22 3A 36 35 33 30 36 36 33 7D part.
A simple approach to getting the wanted Id string is to use a Extract text extraction rule with a Start with of "id": and an Ends with of ". This will need to be done on the ".webtest" file.
I strongly recommend against converting web tests to coded tests. It loses all the high level structure of the ".webtest" format. The Web Test Editor has many facilities for easily enhancing and changing tests, all of them are lost when changing to a coded test. A little learning about extraction and validation rules gives you many facilities. If you are happy working with the VB of a coded test then you should also be happy to write plugins so look at web test request plugins and web test plugins.

Load Testing Composite C1 CMS Console

We have a weird request from one of our client to provide them with load test statistics for the Composite C1 Console. I attempted doing this by using JMeter.
The Problem: Everything on the C1 UI is dynamic content. How can one write a generic test suite which targets specific fields on the page. I know Composite C1 is pretty new but any rough guide and ideas would be appreciated.
Did you tried C1 Log Viewer? You can add primitive "marks" like:
Log.LogInformation("my test","test point 1");
To check speed of console you can inspect logs with "Verbose" title "ConsoleFacade".. start here:
2014 09 01 16:49:37.92 50 342 Verbose ConsoleFacade Console unregistred by 'admin' id = 'key20218859356246321'
finish:
2014 09 01 16:49:51.02 50 350 Verbose ConsoleFacade New console registred by 'admin' id = 'key12416624995518122'

Debugging a CLR20r3 System.InvalidOperationException in production

We have a production VS2008 VB.Net application that's installed on many (hundreds) of client computers. A customer recently installed the application on his Win 7 desktop. The installation completed without errors. However, when he tries to run the application, he receives the following error "Application Name has stopped working". I've included the contents of the event log file below. In my research, it seems this type of error can be caused by a number of things - bad or missing dependency, missing .net framework, permissions, a faulty icon, missing font.
My question is this: Is there a way we can effectively troubleshoot this problem in a production environment? I know the application installation is good; even this customer can run the application on another computer. The appropriate .net framework shows as being installed. I could have him reinstall the .net framework but would like to get a better handle on what's going on.
Here is the contents of the event log file:
Version=1
EventType=CLR20r3
EventTime=130163188478462012
ReportType=2
Consent=1
ReportIdentifier=31c14aab-daae-11e2-b34f-d48564179a03
WOW64=1
Response.type=4
Sig[0].Name=Problem Signature 01
Sig[0].Value=planguru2013.exe
Sig[1].Name=Problem Signature 02
Sig[1].Value=3.0.0.2
Sig[2].Name=Problem Signature 03
Sig[2].Value=51b6342b
Sig[3].Name=Problem Signature 04
Sig[3].Value=PlanGuru2013
Sig[4].Name=Problem Signature 05
Sig[4].Value=3.0.0.2
Sig[5].Name=Problem Signature 06
Sig[5].Value=51b6342b
Sig[6].Name=Problem Signature 07
Sig[6].Value=a0
Sig[7].Name=Problem Signature 08
Sig[7].Value=c6
Sig[8].Name=Problem Signature 09
Sig[8].Value=System.InvalidOperationException
DynamicSig[1].Name=OS Version
DynamicSig[1].Value=6.1.7601.2.1.0.768.3
DynamicSig[2].Name=Locale ID
DynamicSig[2].Value=1033
UI[2]=C:\Program Files (x86)\New Horizon\PlanGuru 2013\PlanGuru2013.exe
UI[3]=PlanGuru 2013 has stopped working
UI[4]=Windows can check online for a solution to the problem.
UI[5]=Check online for a solution and close the program
UI[6]=Check online for a solution later and close the program
UI[7]=Close the program
LoadedModule[0]=C:\Program Files (x86)\New Horizon\PlanGuru 2013\PlanGuru2013.exe
LoadedModule[1]=C:\Windows\SysWOW64\ntdll.dll
LoadedModule[2]=C:\Windows\SYSTEM32\MSCOREE.DLL
LoadedModule[3]=C:\Windows\syswow64\KERNEL32.dll
LoadedModule[4]=C:\Windows\syswow64\KERNELBASE.dll
LoadedModule[5]=C:\Windows\system32\apphelp.dll
LoadedModule[6]=C:\Windows\AppPatch\AcGenral.DLL
LoadedModule[7]=C:\Windows\SysWOW64\sechost.dll
LoadedModule[8]=C:\Windows\syswow64\msvcrt.dll
LoadedModule[9]=C:\Windows\syswow64\RPCRT4.dll
LoadedModule[10]=C:\Windows\syswow64\SspiCli.dll
LoadedModule[11]=C:\Windows\syswow64\CRYPTBASE.dll
LoadedModule[12]=C:\Windows\syswow64\SHLWAPI.dll
LoadedModule[13]=C:\Windows\syswow64\GDI32.dll
LoadedModule[14]=C:\Windows\syswow64\USER32.dll
LoadedModule[15]=C:\Windows\syswow64\ADVAPI32.dll
LoadedModule[16]=C:\Windows\syswow64\LPK.dll
LoadedModule[17]=C:\Windows\syswow64\USP10.dll
LoadedModule[18]=C:\Windows\system32\UxTheme.dll
LoadedModule[19]=C:\Windows\system32\WINMM.dll
LoadedModule[20]=C:\Windows\system32\samcli.dll
LoadedModule[21]=C:\Windows\syswow64\ole32.dll
LoadedModule[22]=C:\Windows\syswow64\OLEAUT32.dll
LoadedModule[23]=C:\Windows\system32\MSACM32.dll
LoadedModule[24]=C:\Windows\system32\VERSION.dll
LoadedModule[25]=C:\Windows\syswow64\SHELL32.dll
LoadedModule[26]=C:\Windows\system32\sfc.dll
LoadedModule[27]=C:\Windows\system32\sfc_os.DLL
LoadedModule[28]=C:\Windows\system32\USERENV.dll
LoadedModule[29]=C:\Windows\system32\profapi.dll
LoadedModule[30]=C:\Windows\system32\dwmapi.dll
LoadedModule[31]=C:\Windows\syswow64\SETUPAPI.dll
LoadedModule[32]=C:\Windows\syswow64\CFGMGR32.dll
LoadedModule[33]=C:\Windows\syswow64\DEVOBJ.dll
LoadedModule[34]=C:\Windows\syswow64\urlmon.dll
LoadedModule[35]=C:\Windows\syswow64\WININET.dll
LoadedModule[36]=C:\Windows\syswow64\iertutil.dll
LoadedModule[37]=C:\Windows\syswow64\CRYPT32.dll
LoadedModule[38]=C:\Windows\syswow64\MSASN1.dll
LoadedModule[39]=C:\Windows\system32\MPR.dll
LoadedModule[40]=C:\Windows\system32\IMM32.DLL
LoadedModule[41]=C:\Windows\syswow64\MSCTF.dll
LoadedModule[42]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll
LoadedModule[43]=C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
LoadedModule[44]=C:\Windows\WinSxS \x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_d09154e044272b9a\MSVCR80.dll
LoadedModule[45]=C:\Windows\assembly\NativeImages_v2.0.50727_32\mscorlib\7150b9136fad5b79e88f6c7f9d3d2c39\mscorlib.ni.dll
LoadedModule[46]=C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorsec.dll
LoadedModule[47]=C:\Windows\syswow64\WINTRUST.dll
LoadedModule[48]=C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\COMCTL32.dll
LoadedModule[49]=C:\Windows\system32\CRYPTSP.dll
LoadedModule[50]=C:\Windows\system32\rsaenh.dll
LoadedModule[51]=C:\Windows\syswow64\imagehlp.dll
LoadedModule[52]=C:\Windows\system32\ncrypt.dll
LoadedModule[53]=C:\Windows\system32\bcrypt.dll
LoadedModule[54]=C:\Windows\SysWOW64\bcryptprimitives.dll
LoadedModule[55]=C:\Windows\system32\GPAPI.dll
LoadedModule[56]=C:\Windows\system32\cryptnet.dll
LoadedModule[57]=C:\Windows\syswow64\WLDAP32.dll
LoadedModule[58]=C:\Windows\system32\SensApi.dll
LoadedModule[59]=C:\Windows\assembly\NativeImages_v2.0.50727_32\System \369f8bdca364e2b4936d18dea582912c\System.ni.dll
LoadedModule[60]=C:\Windows\assembly\NativeImages_v2.0.50727_32\Microsoft.VisualBas#\7366a39c36523a084bc11c230929ff92\Microsoft.VisualBasic.ni.dll
LoadedModule[61]=C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorjit.dll
LoadedModule[62]=C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Drawing\eead6629e384a5b69f9ae35284b7eeed\System.Drawing.ni.dll
LoadedModule[63]=C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Windows.Forms\30e3a21202000677d0a9270572251477\System.Windows.Forms.ni.dll
LoadedModule[64]=C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Runtime.Remo#\90b89f6e8032310e9ac72a309fd49e83\System.Runtime.Remoting.ni.dll
LoadedModule[65]=C:\Windows\syswow64\ws2_32.dll
LoadedModule[66]=C:\Windows\syswow64\NSI.dll
LoadedModule[67]=C:\Windows\system32\mswsock.dll
LoadedModule[68]=C:\Windows\System32\wshtcpip.dll
LoadedModule[69]=C:\Windows\System32\wship6.dll
LoadedModule[70]=C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Configuration\764f15e86c82662e977bd418bd6318c1\System.Configuration.ni.dll
LoadedModule[71]=C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Xml\f687c43e9fdec031988b33ae722c4613\System.Xml.ni.dll
LoadedModule[72]=C:\Windows\system32\RpcRtRemote.dll
LoadedModule[73]=C:\Program Files (x86)\New Horizon\PlanGuru 2013\FarPoint.Win.Spread.dll
LoadedModule[74]=C:\Program Files (x86)\New Horizon\PlanGuru 2013\FarPoint.Win.dll
LoadedModule[75]=C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Data\dd20416f723ee13ffb4173ec1afc4ec4\System.Data.ni.dll
LoadedModule[76]=C:\Windows\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll
LoadedModule[77]=C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.17825_none_72d273598668a06b\gdiplus.dll
LoadedModule[78]=C:\Windows\system32\WindowsCodecs.dll
LoadedModule[79]=C:\Program Files (x86)\New Horizon\PlanGuru 2013\FarPoint.Win.TextRenderer.dll
LoadedModule[80]=C:\Program Files (x86)\New Horizon\PlanGuru 2013\FarPoint.CalcEngine.dll
FriendlyEventName=Stopped working
ConsentKey=CLR20r3
AppName=PlanGuru 2013
AppPath=C:\Program Files (x86)\New Horizon\PlanGuru 2013\PlanGuru2013.exe
ReportDescription=Stopped working
To get the memory crash dump of the exception you can set the following registry keys to tell windows error reporting to keep the crash dump on the pc.
HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\ForceQueue = 0x1
HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\Consent\DefaultConsent = 0x1
Now, look in:
C:\ProgramData\Microsoft\Windows\WER\ReportQueue
Your crash should be there with a managed dump. Visual Studio should be able to open the crash dump. If not use WinDbg + SOS.dll (which is located in the .net framework installation folder). This will give you the callstack of the exception.
Sig[6].Name=Problem Signature 07
Sig[6].Value=a0
ildasm /tokens "PlanGuru2013.exe" /out=libcode.il
lookup failing method in IL 060000+ val above
.method /060000a0/ private hidebysig

NullPointer with playOrm 1.4.1 when persisting entity

I have mapped entities in playORM and my project was running fine with my entities mapped the way they were. However, after installing playORM 1.4.1, the lastest version released in maven, I got the null pointer bellow.
I want to find the error, but have no clue of where to start looking.
Any hint?
INFO: found meta=User locally
2012-11-09 17:32:22,918 com.alvazan.orm.layer9z.spi.db.cassandra.ColumnFamilyHelper waitForNodesToBeUpToDate
INFO: LOOP until all nodes have same schema version OR timeout in 300000 milliseconds
2012-11-09 17:32:22,939 com.alvazan.orm.layer9z.spi.db.cassandra.ColumnFamilyHelper tryToLoadColumnFamilyImpl
INFO: Well, we did NOT find any column family=User to load in cassandra(from virt=User)
2012-11-09 17:32:22,939 com.alvazan.orm.layer9z.spi.db.cassandra.ColumnFamilyHelper tryToLoadColumnFamilyVirt
INFO: Total time to LOAD column family meta from cassandra=21
java.lang.NullPointerException
at com.alvazan.orm.impl.meta.data.MetaEmbeddedSimple.translateToColumnImpl(MetaEmbeddedSimple.java:105)
at com.alvazan.orm.impl.meta.data.MetaEmbeddedSimple.translateToColumn(MetaEmbeddedSimple.java:93)
at com.alvazan.orm.impl.meta.data.MetaClassSingle.translateToRow(MetaClassSingle.java:82)
at com.alvazan.orm.layer0.base.BaseEntityManagerImpl.putImpl(BaseEntityManagerImpl.java:102)
at com.alvazan.orm.layer0.base.BaseEntityManagerImpl.put(BaseEntityManagerImpl.java:68)
at com.s1mbi0se.dmp.da.dao.UserDao.insertOrUpdateUser(UserDao.java:23)
at com.s1mbi0se.dmp.module.UserModule.persistData(UserModule.java:116)
at com.s1mbi0se.dmp.processor.mapred.SelectorReducer.reduce(SelectorReducer.java:60)
at com.s1mbi0se.dmp.processor.mapred.SelectorReducer.reduce(SelectorReducer.java:1)
at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:176)
at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:649)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:417)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:260)
17:32:22,946 WARN Thread-3 mapred.LocalJobRunner:298 - job_local_0001
java.lang.InterruptedException
at com.s1mbi0se.dmp.processor.mapred.SelectorReducer.reduce(SelectorReducer.java:63)
at com.s1mbi0se.dmp.processor.mapred.SelectorReducer.reduce(SelectorReducer.java:1)
at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:176)
at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:649)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:417)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:260)
2012-11-09 17:32:27,237 com.s1mbi0se.dmp.processor.main.DmpProcessorRunner run
EDIT: This is fixed in master branch and soon to be released. 11/27/12
The log formatting seems a bit off but this is the important part
java.lang.NullPointerException at com.alvazan.orm.impl.meta.data.MetaEmbeddedSimple.translateToColumnImpl(MetaEmbeddedSimple.java:105)
line 105 finds this code...
for(T val : toBeAdded) {
byte[] name = formTheName(val);
Column c = new Column();
c.setName(name);
row.getColumns().add(c);
}
specifically line 105 is the first line so toBeAdded is null for some reason....looking at who called this method.
hmmm, it turns out ONE of your entities has a null list of something. We need to add code in here so if your entity has a null list we create an empty one instead. Can you file a ticket and link to this URL. We can fix this one easily.
NOTE: I have a habit of every entity with a field like so
private List something;
I 100% always define it like this
private List something = new ArrayList();
That avoids Nullpointers all over the place which is why I missed this one :( :(.....anyways, we will fix to allow this null lists.
thanks,
Dean
This is fixed in release 1.4.2 which is available in Maven repo

Obscure NHibernate/Fluent NHibernate error

I've been encountering the following error when trying to build a
session factory:
PersistenceTests.Can_Map_Orders_To_Database : Failed
System.IndexOutOfRangeException: Index was outside the bounds of the
array.
at NHibernate.Mapping.Column.set_Name(String value)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindColumns(XmlNode node,
SimpleValue model, Boolean isNullable, Boolean autoColumn, String
propertyPath)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindColumnsOrFormula
(XmlNode node, SimpleValue simpleValue, String path, Boolean
isNullable)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindSimpleValue(XmlNode
node, SimpleValue model, Boolean isNullable, String path)
at
NHibernate.Cfg.XmlHbmBinding.CollectionBinder.BindCollectionSecondPass
(XmlNode node, Collection model, IDictionary`2 persistentClasses)
at
NHibernate.Cfg.XmlHbmBinding.CollectionBinder.<>c__DisplayClassd.<AddCollec tionSecondPass>b__c
(IDictionary`2 persistentClasses)
at NHibernate.Cfg.Configuration.SecondPassCompile()
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:
\Code Samples\NHibernate\Fluent Nhibernate - Trunk\src\FluentNHibernate
\Cfg\FluentConfiguration.cs: line 94
FluentNHibernate.Cfg.FluentConfigurationException: An invalid or
incomplete configuration was used while creating a SessionFactory.
Check PotentialReasons collection, and InnerException for more detail.
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:
\Code Samples\NHibernate\Fluent Nhibernate - Trunk\src\FluentNHibernate
\Cfg\FluentConfiguration.cs: line 99
at FluentNHibernate.SessionSource..ctor(FluentConfiguration config) in
c:\Code Samples\NHibernate\Fluent Nhibernate - Trunk\src
\FluentNHibernate\SessionSource.cs: line 38
at
FluentNHibernate.Testing.SingleConnectionSessionSourceForSQLiteInMemoryTest ing..ctor
(FluentConfiguration config) in c:\Code Samples\NHibernate\Fluent
Nhibernate - Trunk\src\FluentNHibernate\Testing
\SingleConnectionSessionSourceForSQLiteInMemoryTesting.cs: line 15
at Core.Infrastructure.Data.NHibernate.Tests.PersistenceTests.SetUp()
in PersistenceTests.cs: line 26
I'm working against the FNH trunk and NH 2.0.1. Funny thing is I am
able to compile my mappings (via AutoPersistenceModel.CompileMappings)
and write them to the file system successfully - FNH doesn't complain.
It is only when attempting to build the session factory that
everything goes kaboom with the not very helpful error message above.
Anyone got any ideas?
I found that the inner exception gave more details. In my case I had to add the NHibernate.ByteCode.Castle.dll file to the references.
Fluent NHibernate itself rarely complains at you directly. Internally it's just building up your HBM files for you so if you told it to build something wrong then NHibernate proper will get grumpy.
If you're not already, you might want to start with exporting your mapping files like so:
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<MyClass>()
.ExportTo("path")
Then you can dig around in there to see if something is wrong. I do recall getting this error once before and I think it relates to a mismatch in the number of columns mapped. It was one of those easy-to-miss errors in my mapping, so unfortunately all I can suggest is to really scour the output of ExportTo for anything that doesn't make sense.
We'll need to see your Configuration to help much. But this part of the stack trace should give you an idea of where to start.
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:
\Code Samples\NHibernate\Fluent Nhibernate - Trunk\src\FluentNHibernate
\Cfg\FluentConfiguration.cs: line 94
FluentNHibernate.Cfg.FluentConfigurationException: An invalid or
incomplete configuration was used while creating a SessionFactory.
Check PotentialReasons collection, and InnerException for more detail.