error of NullReferenceException while running application.

Posted: February 14, 2012 at 3:21 PM Quote #62460
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
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Jigar Shah

[email protected]
Posted: February 14, 2012 at 10:38 PM Quote #62478
can anybody help me in this case ?
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Jigar Shah

[email protected]
Posted: February 15, 2012 at 8:12 AM Quote #62510
Do you have all of the Tax plugins disabled?
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
StackOverflow - http://stackoverflow.com/users/113988/andymckenna
http://bitshiftweb.com - FirstData and Payeezy payment plugin and contract development services
Posted: February 15, 2012 at 2:24 PM Quote #62562
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
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Jigar Shah

[email protected]
Posted: February 15, 2012 at 2:46 PM Quote #62564
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 ?
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Jigar Shah

[email protected]
Posted: February 15, 2012 at 2:47 PM Quote #62566
No, I mean go to your list of plugins.  /Admin/Plugin/List

Are any of the Tax Providers installed?
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
StackOverflow - http://stackoverflow.com/users/113988/andymckenna
http://bitshiftweb.com - FirstData and Payeezy payment plugin and contract development services
Posted: February 15, 2012 at 3:10 PM Quote #62568
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
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Jigar Shah

[email protected]
Posted: February 15, 2012 at 3:38 PM Quote #62570
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.

-:)
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Jigar Shah

[email protected]
Posted: February 21, 2012 at 3:27 PM Quote #63074
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 post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Jigar Shah

[email protected]
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.