Deleted part column still necessary in Record and part

Topics: Writing modules
Jul 24, 2011 at 5:31 PM

I've deleted an part column with the migrations method but when i remove the matching property in the part and record classes i get the error:

Could not find a getter for property '.....' in class '....Records.....'

How can i really remove the column or how can i fix this problem?


 

Coordinator
Jul 25, 2011 at 9:07 PM

Do you have a stack trace?

Nov 23, 2011 at 1:24 PM

I am getting the same error now that i've deleted a column in a migration.

Unfortunately the call stack doesn't seem to be very helpful as to where is coming from as the error happens during WarmupStarter:

 

>    Orchard.WarmupStarter.DLL!Orchard.WarmupStarter.Starter<Orchard.Environment.IOrchardHost>.OnBeginRequest(System.Web.HttpApplication application) Line 63    C#
     Orchard.Web.DLL!Orchard.Web.MvcApplication.Application_BeginRequest() Line 29 + 0x10 bytes    C#
     [External Code]   
     Orchard.WarmupStarter.DLL!Orchard.WarmupStarter.WarmupHttpModule.WarmupAsyncResult.Completed() Line 111 + 0x11 bytes    C#
     Orchard.WarmupStarter.DLL!Orchard.WarmupStarter.WarmupHttpModule.SignalWarmupDone() Line 52 + 0xb bytes    C#
     Orchard.WarmupStarter.DLL!Orchard.WarmupStarter.Starter<Orchard.Environment.IOrchardHost>.LaunchStartupThread.AnonymousMethod__2(object state) Line 100 + 0x5 bytes    C#

 

The error source is NHibenate:

[NHibernate.PropertyNotFoundException] = {"Could not find a getter for property 'DeletedProperty' in class '...PartRecord'"}

Being thrown in Orchard.WarmupStarter\Starter.cs Line 63, with the error populating the _previousError value

throw new ApplicationException("Error during application initialization", _previousError);

Developer
Nov 23, 2011 at 4:10 PM

If the property is properly deleted from the DB table (Have you checked that? Migrations could have somehow failed.) than my best guess would be that the O-R mappings were not updated. Try to delete mappings.bin in the App_Data folder under the tenant's directory. I've seen similar issues getting resolved with that.

Dec 1, 2011 at 11:16 AM

Yup it deleted the column from the database, only way I could get it working was to either add the column back or delete the database and start again, which will not really be an option once this is deployed.

Will the mappings.bin get regenerated if I delete just that?

Developer
Dec 1, 2011 at 11:43 AM

Yes, it's just a cache file.

Jan 15, 2012 at 11:19 AM

I had the same issue and after deleting mappings.bin everything worked fine.