-->
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.  [ 6 posts ] 
Author Message
 Post subject: Could not interpret type: Nullables.NHibernate.NullableInt32
PostPosted: Tue Sep 20, 2005 11:03 pm 
Newbie

Joined: Tue Sep 06, 2005 11:41 pm
Posts: 7
Location: New York
Hi all,

I've just started using nullables in NHibernate (rc1) in an ASP.NET application. Here's my mapping file:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
   <class name="Server.Objects.Event,NHibernateServer" table="Events">

      <id name="Id" column="EventID" type="Int32" unsaved-value="0" access="nosetter.lowercase">
         <generator class="native"/>
      </id>
      <property name="Name" />
      <property name="Description" />
      <property name="Start" />
      <property name="ArticleId" column="ArticleID" type="Nullables.NHibernate.NullableInt32Type, Nullables.NHibernate" />
   </class>
</hibernate-mapping>


However, when I try to hit my page, this exception gets thrown:

Code:
could not interpret type: Nullables.NHibernate.NullableInt32Type, Nullables.NHibernate
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: NHibernate.MappingException: could not interpret type: Nullables.NHibernate.NullableInt32Type, Nullables.NHibernate


To me, it sounds like NHibernate doesn't know where to look for the Nullables libraries; but I've added a reference to all the relevant libraries in all the relevant places. I've also searched around to try to find some help on the topic, but the match I found was in dutch, which was a bit hard to translate!

I'm hoping it's just an "it's 11 PM and it's time for bed" bug, but hopefully someone has an answer (or speaks dutch :-D).

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 4:39 am 
Newbie

Joined: Thu Aug 11, 2005 4:21 am
Posts: 2
Had the same problem.
Seems that with the previous version you could get by with just a reference to Nullables. I've added Nullable.NHibernate to the projects where this was not yet the case, and the problem is fixed.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 8:21 am 
Regular
Regular

Joined: Fri Jun 11, 2004 6:27 am
Posts: 81
Location: Yaroslavl, Russia
No, this is not a bug. NHibernate by itself knows nothing about Nullables.NHibernate assembly. When you use nullables in your application by specifying type attribute, it creates dependence between your application and Nullables.NHibernate assembly, but not between NH and nullables. As soon as this is kind of "soft" dependence, not supported by compiler, you have to either manually copy necessary assemblies, or add a ordinal reference to your project.

_________________
Best,
Andrew Mayorov // BYTE-force


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 5:19 pm 
Newbie

Joined: Tue Sep 06, 2005 11:41 pm
Posts: 7
Location: New York
Thanks for the replies.

bmichu: Do you mean you just added a reference to your web project in Visual Studio, and the problem went away? My web project already has a reference to that library...

xor: Sorry, I meant it was probably a bug in MY code :oops:. I'd try copying the assemblies, but they're already in the BIN directory of both the web and server solutions.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 6:07 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
The last time I've seen this happen was when I built NHContrib 0.8.4 release, and forgot to copy NHibernate 0.8.4 before building it, so NHC 0.8.4 used NH 0.8.3. But this time it must be something else, and I would really like to know what it is.


Top
 Profile  
 
 Post subject: Working now...
PostPosted: Wed Sep 21, 2005 7:13 pm 
Newbie

Joined: Tue Sep 06, 2005 11:41 pm
Posts: 7
Location: New York
I've managed to get it working. Basically I deleted every copy of:
    NHibernate.dll
    Nullables.dll
    Nullables.NHibernate.dll
that I could find in windows explorer, and that resided under the solution directory. Then I fired up VS, and removed all the references to said libraries, and recompiled just to watch it fail. Finally, I re-added the references back into all the relevant places, and now it all seems to be working happily.

So at the end of the day, I'm not sure what the problem was; my guess is that an old library of something was hanging around, but of course I have no idea which one or where.

*Curses Visual Studio's horrible handling of DLLs and versions*

Thanks everyone for the help and suggestions.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.