Error after 7.07. upgrade to Gold R7

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Error after 7.07. upgrade to Gold R7

Post by AbleMods » Wed May 14, 2014 8:11 am

This is the first time I have seen this happen with a Gold upgrade.

Able 7.0.7 site upgraded to Able Gold R7. No errors during upgrade. Login page renders fine. But any attempt to reach the dashboard throws the exception below. Gold site completely unmodified, brand new install.

I can hit other pages in the admin directly without a problem. Edit Users, View a specific Order, Store Settings etc. They all work fine. But soon as I try to reach dashboard (or Order Manager), the exception is thrown.

Any thoughts of what sort of data issue could be causing this?
Server Error in '/' Application.

Object reference not set to an instance of an object.

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: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
CommerceBuilder.Payments.PaymentRepository.BeforeSave(Object entity) +1094
CommerceBuilder.DomainModel.SaveOrUpdateEventListener.PerformSaveOrUpdate(SaveOrUpdateEvent event) +234
NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event) +381
NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event) +390
NHibernate.Impl.SessionImpl.SaveOrUpdate(String entityName, Object obj) +389
NHibernate.Engine.Cascade.CascadeToOne(Object parent, Object child, IType type, CascadeStyle style, Object anything, Boolean isCascadeDeleteEnabled) +226
NHibernate.Engine.Cascade.CascadeCollectionElements(Object parent, Object child, CollectionType collectionType, CascadeStyle style, IType elemType, Object anything, Boolean isCascadeDeleteEnabled) +566
NHibernate.Engine.Cascade.CascadeCollection(Object parent, Object child, CascadeStyle style, Object anything, CollectionType type) +274
NHibernate.Engine.Cascade.CascadeOn(IEntityPersister persister, Object parent, Object anything) +600
NHibernate.Event.Default.AbstractFlushingEventListener.CascadeOnFlush(IEventSource session, IEntityPersister persister, Object key, Object anything) +156
NHibernate.Event.Default.AbstractFlushingEventListener.PrepareEntityFlushes(IEventSource session) +372
NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event) +249
NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event) +160
NHibernate.Impl.SessionImpl.Flush() +499
CommerceBuilder.Common.DatabaseSessionManager.BeginTransaction(IsolationLevel isolationLevel) +93
CommerceBuilder.Services.HttpModule.a(Object A_0, EventArgs A_1) +1170
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +79
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +164

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18446
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Error after 7.07. upgrade to Gold R7

Post by Katie » Wed May 14, 2014 11:58 am

Hi Joe,

I've asked the dev team to take a look at the error and see if they can figure out what happened.

Thanks
Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Error after 7.07. upgrade to Gold R7

Post by AbleMods » Wed May 14, 2014 12:18 pm

Thanks so much Katie, you are always appreciated.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Error after 7.07. upgrade to Gold R7

Post by Naveed » Thu May 15, 2014 3:37 am

Thanks for reporting the issue.

There are few helpful hints about the issue, but not clear enough to identify the problem exactly.
[NullReferenceException: Object reference not set to an instance of an object.]
CommerceBuilder.Payments.PaymentRepository.BeforeSave(Object entity) +1094
CommerceBuilder.DomainModel.SaveOrUpdateEventListener.PerformSaveOrUpdate(SaveOrUpdateEvent event) +234
From this part we can see that the issue occurs when it try to save some payments (or order). And null reference exception is thrown in PaymentRepository.BeforeSave() function.
NHibernate.Impl.SessionImpl.Flush() +499
CommerceBuilder.Common.DatabaseSessionManager.BeginTransaction(IsolationLevel isolationLevel) +93
CommerceBuilder.Services.HttpModule.a(Object A_0, EventArgs A_1) +1170
From this part of stack trace, we can see that the code call is initiated from HttpModule when a transaction is started and automatic flush occurs as a result of starting transaction. We only start transaction in the HttpModule.EndRequest() event function. So, some data change about your order or payment occurs before this stage when you load the admin dashboard page.

I have reviewed the related code but yet unable to identify the cause of the issue. Please check the recent orders/payments and see if some part of data is not upgraded/imported properly.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Error after 7.07. upgrade to Gold R7

Post by AbleMods » Thu May 15, 2014 5:08 am

Thanks for the response.

I found the cause. I had to load full source into the solution so I could expose the underlying issue.

The problem is the client has a custom payment provider gateway. The custom gateway DLLs were not copied to the new Gold install folder after the data was converted. So the first reference to a payment tries to initialize and cache a provider instance for a class ID that wasn't found in the /bin/ folder.

Not my idea of great error handling though. The system should be able to gracefully handle when a class ID is specified in ac_PaymentGateways but the corresponding class itself is not found in /bin/. As it is right now, it just throws a null exception when it calls the Activator here in PaymentGateway.cs:

Code: Select all

            // see if we found a cached instance
            if (instance == null)
            {
                // provider instance was not in cache so create it
                try
                {
                    instance = Activator.CreateInstance(Type.GetType(this.ClassId)) as IPaymentProvider;
                }
                catch (Exception ex)
                {
                    instance = null;
                    Logger.Error("Could not create provider instance: " + this.ClassId, ex);
                }

                // if we were able to create the instance it needs to be configured
                if (instance != null)
                {
                    instance.Initialize(this.Id, this.ParseConfigData());

                    // and also cache our result
                    if (cache != null)
                    {
                        cache.Add(cacheKey, instance, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, 20, 0), CacheItemPriority.Normal, null);
                    }
                }
            }
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Error after 7.07. upgrade to Gold R7

Post by jmestep » Fri May 16, 2014 4:30 am

There is something similar with the non-Able FedEx gateway. There is a reference in the table and it keeps throwing errors until the files are added to the bin folder.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Post Reply