Today's errors running on the trunk

I did some work today with MonoRail and some of the tools from Ayende's repository (which contains a lot of tools/code snippets/extensions etc he calls Rhino Tools). I build both things from trunk as well as nHibernate from trunk because I tried to figure out a lot of internal stuff, however this can give some problems from time to time so i thought i post the errors i encountered so someone in the same problems as me could google them.

Problem 1

The first problem was when starting a MonoRail site and it tried to render a View, it gave me an MonoRailException with the following text:

"Error processing MonoRail request. Action Index on controller Home"

And the inner exception gave me "Error compiling Brail code" and "Internal compiler error: Value cannot be null. Parameter name: ns."

I realized that I had used assemblies from two different sources the Castle trunk and the Rhino-Tools trunk. Apparently the Brail view engine wasn't to happy with the version of Boo.Lang.Interpreter.dll from the rhino tools trunk, i haven't dug any deeper into why, but it seems a bit strange.

Problem 2

This time using ActiveRecord i got this ActiveRecordException:

"Error adding information from class My.NamespaceName.ClassName to NHibernate."

Again a look at the Inner exceptions gave some more information from nHibernate itself: "Could not compile the mapping document: (string)" (MappingException) and  last but not least i got:

"The given key was not present in the dictionary."

Which i guess we all have seen at some times, but this time from the core of nHibernate. It happened in NHibernate.Dialect.Dialect.GetDialect() method, its pretty short so lets take a look:

public static Dialect GetDialect(IDictionary<string  , string> props)
{
	if (props == null)
		throw new ArgumentNullException("props");
	string dialectName = props[Environment.Dialect];
	if (dialectName == null)
	{
		return GetDialect();
	}

	return InstantiateDialect(dialectName);
}

It gets the properties from the configuration of nHibernate as an argument, and then tries to look up the dialect in these values but somehow it couldn't find my configuration of my Dialect, i checked it for misspellings but no luck, then I realized my properties was on the format "hibernate.dialect" but the Environment.Dialect constant was only "dialect". Apparently this was changed a few weeks back, but had not cought my attention. Take a look at this diff if you wont take my word for it.


Comments

May 14. 2008 01:01 AM

Taras

#3 helped a lot, thank you Jakob

Taras

Comments are closed