error of NullReferenceException while running application.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
any suggestion on below error message ?
already spent so much time, but still not able to figure it out.
can you please help me out in this ?

if i use the same database with local version, it works fine. but on online hosted version, it is throwing below exception.

Thanks


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.]
   Nop.Services.Tax.TaxService.GetTaxRate(ProductVariant productVariant, Int32 taxCategoryId, Customer customer) in d:\Website\Libraries\Nop.Services\Tax\TaxService.cs:239
   Nop.Services.Tax.TaxService.GetProductPrice(ProductVariant productVariant, Int32 taxCategoryId, Decimal price, Boolean includingTax, Customer customer, Boolean priceIncludesTax, Decimal& taxRate) in d:\Website\Libraries\Nop.Services\Tax\TaxService.cs:324
   Nop.Services.Tax.TaxService.GetProductPrice(ProductVariant productVariant, Decimal price, Boolean includingTax, Customer customer, Decimal& taxRate) in d:\Website\Libraries\Nop.Services\Tax\TaxService.cs:305
   Nop.Services.Tax.TaxService.GetProductPrice(ProductVariant productVariant, Decimal price, Customer customer, Decimal& taxRate) in d:\Website\Libraries\Nop.Services\Tax\TaxService.cs:288
   Nop.Services.Tax.TaxService.GetProductPrice(ProductVariant productVariant, Decimal price, Decimal& taxRate) in d:\Website\Libraries\Nop.Services\Tax\TaxService.cs:264
   Nop.Web.Controllers.CatalogController.PrepareProductPriceModel(Product product) in d:\Website\Presentation\Nop.Web\Controllers\CatalogController.cs:212
   Nop.Web.Controllers.CatalogController.PrepareProductOverviewModel(Product product, Boolean preparePriceModel, Boolean preparePictureModel, Nullable`1 productThumbPictureSize) in d:\Website\Presentation\Nop.Web\Controllers\CatalogController.cs:316
   Nop.Web.Controllers.CatalogController.<Category>b__18(Product x) in d:\Website\Presentation\Nop.Web\Controllers\CatalogController.cs:892
   System.Linq.WhereSelectListIterator`2.MoveNext() +110
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +327
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
   Nop.Web.Controllers.CatalogController.Category(Int32 categoryId, CatalogPagingFilteringModel command) in d:\Website\Presentation\Nop.Web\Controllers\CatalogController.cs:892
   lambda_method(Closure , ControllerBase , Object[] ) +150
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +208
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8841105
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

________________________________________
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1



Thanks
12 years ago
can anybody help me in this case ?
12 years ago
Do you have all of the Tax plugins disabled?
12 years ago
check my TAX table values as below screen

http://www.freeimagehosting.net/aurkw

I am not sure what i am missing, i know it's minor mistake, but not able to figured it out.

anybody please help me out in this.

Thanks
12 years ago
also in local it's running fine. and the same data i have uploaded on my server database, but on server it's not working whereas local it's working fine.

any guesses ?
12 years ago
No, I mean go to your list of plugins.  /Admin/Plugin/List

Are any of the Tax Providers installed?
12 years ago
yes, installed...


http://www.freeimagehosting.net/nrcrl
http://www.freeimagehosting.net/9qu4r


This shows that it's installed.
I don't understand one thing, that why it's working on local, and not working on the webspace.

this error generates while i click on any image of the product either on home page or any other category page.

Thanks
12 years ago
Hi, AndyMcKenna

you are right, there was issue related to Tax Provider Plugin in Admin Side.
all looks like False and Install

the one screen i have sent you is from the local admin.

actually b'coz of this error i even not able to log in from the hosted environment,
then i have change isFreeshipping option to 1 for all the products, so everything works fine right now.

now, i'll install the required plugins.

Thanks for your support.

-:)
12 years ago
Cause of this error :

You do not have any Tax Method enabled from your Plugin.

so either you have to do that, but in my case even I was not able to open admin panel and for solution time being I have updated my database with below product query.

"UPDATE PRODUCTVARIANT SET ISTAXEXEMPT = 1"

so as it is showing that products are tax exempt, it'll not going to check for any tax method.

I forgot to write the solution, that's why writing here, sothat if anybody have same issue, they can resolve with this.

Thanks Agains.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.