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.  [ 3 posts ] 
Author Message
 Post subject: Error while executing testprogram "could not compile th
PostPosted: Wed Nov 19, 2008 12:15 pm 
Beginner
Beginner

Joined: Wed Nov 19, 2008 7:27 am
Posts: 26
Location: Germany
Hello Forum,
since two days I try to start with NHibernate.

My last try was this Tutorial (second try). http://www.hibernate.org/362.html

Since now I get this error from NHibernate:

"Could not compile the mapping document: SecondSolution.Datenbank.User.hbm.xml"

The Solution is named SecondSolution and the hbm.xml-file is located in a subfolder "Datenbank".
As scheme I used "nhibernate-mapping.xsd" from the distribution.
So it seems that NHibernate has found the file but what is wrong here?

This is my User.hbm.xml

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
    <class name="SecondSolution.User, SecondSolution" table="users">
    <id name="Id" column="LogonId" type="String" length="20">
      <generator class="assigned" />
    </id>
    <property name="UserName" column="UserName" type="String" length="40"/>
    <property name="Password" type="String" length="20"/>
    <property name="EmailAddress" type="String" length="40"/>
    <property name="LastLogon" type="DateTime"/>
  </class>
</hibernate-mapping>


please help, I'm near to a nervous breakdown...

thanks, Telefisch


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2008 6:53 am 
Beginner
Beginner

Joined: Wed Nov 19, 2008 7:27 am
Posts: 26
Location: Germany
So I have installed NHibernate once again and tried a new Test-Application.

Now the first Test goes without any Exception but...

In the output window I get the following message:

Eine Ausnahme (erste Chance) des Typs "System.Data.SqlServerCe.SqlCeException" ist in System.Data.SqlServerCe.dll aufgetreten.

...and the FirstSolution Database contains no table.

here is my mapping-file:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   assembly="Solution"
                   namespace="Solution.Domain">
  <class name="Product">
    <id name="Id">
      <generator class="guid" />
    </id>
    <property name="Name" />
    <property name="Category" />
    <property name="Discontinued" />
  </class>
</hibernate-mapping>


and my config-file:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  <session-factory>
    <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
    <property name="dialect">NHibernate.Dialect.MsSqlCeDialect</property>
    <property name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver</property>
    <property name="connection.connection_string">Data Source=FirstSample.sdf</property>
    <property name="show_sql">true</property>
  </session-factory>
</hibernate-configuration>


what could be wrong here?

pls help....


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2008 6:59 am 
Beginner
Beginner

Joined: Wed Nov 19, 2008 7:27 am
Posts: 26
Location: Germany
uups...
my fault.

obviously the database is in the debug-directory and ofcourse it has a table.
So even though ther was a message in the output-window, the generation of the table passed...

thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

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.