Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# Dumpman 6/30/2006 11:23 AM
Hi,

An exception is being thrown when I rebuild the index on the site.

The exception is thrown in Cuyahoga.Core.Domain.Section.CreateModule() on the following line:
ModuleBase concreteModule = (ModuleBase)Activator.CreateInstance(moduleType, new object[] {this});

The exception being thrown is:

{System.MissingMethodException: Constructor on type 'Cuyahoga.Modules.User.UserModule' not found.
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at Cuyahoga.Core.Domain.Section.CreateModule(String sectionUrl) in C:\projects\Project Orange\cuyahoga\Core\Domain\Section.cs:line 233
at Cuyahoga.Web.Admin.RebuildIndex.BuildIndexByNode(Node node, IndexBuilder ib) in C:\projects\Project Orange\cuyahoga\Web\Admin\RebuildIndex.aspx.cs:line 76}

I suspect this has something to do with the fact we are using dependency injection and there is no default constructor for the objects.

Has anyone else encountered this problem? I don't want to ditch lucene if I don't have to.

Thanks,

Tim
# martijnb 7/1/2006 5:11 AM
Ah, we forgot to change the module instantiation in RebuildIndex to the new method.

The following block in RebuildIndex.aspx.cs:
section.SessionFactoryRebuilt += new EventHandler(section_SessionFactoryRebuilt);
string sectionUrl = UrlHelper.GetUrlFromSection(section);
ModuleBase module = null;
try
{
	module = section.CreateModule(sectionUrl);
}
catch (Exception ex)
{
	log.Error(String.Format("Unable to create Module for Section {0} - {1}.", section.Id, section.Title), ex);
}

has to be replaced with:
ModuleBase module = null;
try
{
	module = base.ModuleLoader.GetModuleFromSection(section);

}
catch (Exception ex)
{
	log.Error(String.Format("Unable to create Module for Section {0} - {1}.", section.Id, section.Title), ex);
}

Haven't tested it, but it should more or less work.
# Dumpman 7/3/2006 5:16 AM
Thanks for the quick response, unfortunately I'm getting a compile error when I make that change.

Cuyahoga.Web.Admin.UI.AdminBasePage doesn't contain a definition for ModuleLoader.

Is there something else that I need to update?

Thanks
# martijnb 7/3/2006 11:07 AM
Which version exactly are you using? The current AdminBasePage from SVN does have a ModuleLoader property (added 2006-05-07).

Btw, don't expect the SVN version to be stable. Still a lot has to be done.