kumpfi wrote:
wolli wrote:
Quote:
109 [10] INFO NHibernate.Cfg.Environment (null) - hibernate-configuration section not found in application configuration file
Are you sure, that you're config is really used ? Check if it's flagged as "Embedded Resource". Do you use App.config/Web.config or a separate hibernate.cfg.xml file ?
How can I check what config file is really used?
In my code I use the App.config an it is flagged as "Embedded Resource".
Hello now if found in another example of nhibernate another App-config. I got this file and fit it to my project:
Code:
<configuration>
<configSections>
<section
name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"
/>
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
<property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property>
<property name="dialect">NHibernate.Dialect.Oracle9Dialect</property>
<property name="default_schema">XXXXXX</property>
<property name="connection.connection_string">Data source=XXXXXXXXX;User Id=XXXXXX;Password=XXXXXX;</property>
<property name="show_sql">true</property>
<mapping assembly="DBHibernate" />
</session-factory>
</hibernate-configuration>
</configuration>
Now the hibernate-config Section is not found info is no longer present.
But i got a lot of exception i shoult declare the methodes in my Storage.cs class as virtual. Why do i have to do this? I don't think, that this is right, but i have done ist to see what happens.
I got the following log output:
78 [10] INFO NHibernate.Cfg.Environment (null) - NHibernate 2.0.0.1001 (2.0.0.10
01)
109 [10] INFO NHibernate.Cfg.Environment (null) - Bytecode provider name : lcg
109 [10] INFO NHibernate.Cfg.Environment (null) - Using reflection optimizer
140 [10] INFO NHibernate.Cfg.Configuration (null) - Searching for mapped documen
ts in assembly: DBHibernate
140 [10] INFO NHibernate.Cfg.Configuration (null) - Mapping resource: DBHibernat
e.Storage.hbm.xml
187 [10] INFO NHibernate.Dialect.Dialect (null) - Using dialect: NHibernate.Dial
ect.Oracle9Dialect
1000 [10] INFO NHibernate.Cfg.XmlHbmBinding.Binder (null) - Mapping class: DBHib
ernate.Storage -> STORAGE
1015 [10] DEBUG NHibernate.Cfg.XmlHbmBinding.Binder (null) - Mapped property: Id
-> STORAGE_ID, type: Int32
1031 [10] DEBUG NHibernate.Cfg.XmlHbmBinding.Binder (null) - Mapped property: To
wer -> TOWER, type: Int32
1031 [10] DEBUG NHibernate.Cfg.XmlHbmBinding.Binder (null) - Mapped property: Si
de -> Side, type: String
1031 [10] DEBUG NHibernate.Cfg.XmlHbmBinding.Binder (null) - Mapped property: Ar
ea -> Area, type: Int32
1031 [10] DEBUG NHibernate.Cfg.XmlHbmBinding.Binder (null) - Mapped property: Tr
ay -> Tray, type: String
1031 [10] DEBUG NHibernate.Cfg.XmlHbmBinding.Binder (null) - Mapped property: Size -> Size, type: Int32
1046 [10] INFO NHibernate.Cfg.Configuration (null) - checking mappings queue
1046 [10] INFO NHibernate.Cfg.Configuration (null) - processing one-to-many asso
ciation mappings
1046 [10] INFO NHibernate.Cfg.Configuration (null) - processing one-to-one assoc
iation property references
1046 [10] INFO NHibernate.Cfg.Configuration (null) - processing foreign key cons
traints
1062 [10] INFO NHibernate.Dialect.Dialect (null) - Using dialect: NHibernate.Dialect.Oracle9Dialect
1062 [10] INFO NHibernate.Exceptions.SQLExceptionConverterFactory (null) - Using
dialect defined converter
1062 [10] INFO NHibernate.Connection.ConnectionProviderFactory (null) - Initializing connection provider:
NHibernate.Connection.DriverConnectionProvider
1062 [10] INFO NHibernate.Connection.ConnectionProvider (null) - Configuring Con
nectionProvider
1078 [10] ERROR NHibernate.Util.ReflectHelper (null) - Could not load type Oracle.DataAccess.Client.OracleConnection, Oracle.DataAccess.
System.IO.FileNotFoundException: Could not load file or assembly 'Oracle.DataAcc
ess' or one of its dependencies. The system cannot find the file specified.
File name: 'Oracle.DataAccess'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Bool
ean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence
assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence as
semblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName n
ame, Boolean throwOnError) in D:\Projekte\ExternalDLLs\hibernate\HibSrc\src\NHib
ernate\Util\ReflectHelper.cs:line 260
=== Pre-bind state information ===
LOG: User = XXXXXXXXXXXXXXXXXXX
LOG: DisplayName = Oracle.DataAccess
(Partial)
LOG: Appbase = file:///D:/Projekte/Scheibenlager/Projekt_VS/TestHibernate/TestHi
bernate/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : NHibernate, Version=2.0.0.1001, Culture=neutral, PublicKeyTok
en=aa95f207798dfdb4.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Projekte\Scheibenlager\Projekt_VS\
TestHibernate\TestHibernate\bin\Debug\DBHibernate.vshost.exe.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
1109 [10] ERROR NHibernate.Util.ReflectHelper (null) - Could not load type Oracle.DataAccess.Client.OracleCommand, Oracle.DataAccess.
System.IO.FileNotFoundException: Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. The system cannot find the file specified.
File name: 'Oracle.DataAccess'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence
assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence as
semblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName n
ame, Boolean throwOnError) in D:\Projekte\ExternalDLLs\hibernate\HibSrc\src\NHibernate\Util\ReflectHelper.cs:line 260
=== Pre-bind state information ===
LOG: User = XXXXXXXXXXXXXXXXXXXX
LOG: DisplayName = Oracle.DataAccess
(Partial)
LOG: Appbase = file:///D:/Projekte/Scheibenlager/Projekt_VS/TestHibernate/TestHibernate/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : NHibernate, Version=2.0.0.1001, Culture=neutral, PublicKeyTok
en=aa95f207798dfdb4.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Projekte\Scheibenlager\Projekt_VS\
TestHibernate\TestHibernate\bin\Debug\DBHibernate.vshost.exe.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2
.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partia
l, or location-based assembly bind).
LOG: The same bind was seen before, and was failed with hr = 0x80070002.