0

I have frustrating problem in my web application. When I tested app local i didnt have any exception, when i published app, then throw a many null exception or like "Object reference not set to an instance of an object.". I don't understand why. I use hosting http://1and1.pl/. Can anybody help me?

Stack trace:

[NullReferenceException: Object reference not set to an instance of an object.] QuestionnaireEx.Controllers.QuestionnaireController.TestStart(AttemptAnswers attA, String prevBtn) +7267 lambda_method(Closure , ControllerBase , Object[] ) +119 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) +182 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) +27 System.Web.Mvc.Async.<>c_DisplayClass42.b_41() +28 System.Web.Mvc.Async.<>c_DisplayClass81.<BeginSynchronous>b__7(IAsyncResult _) +10 System.Web.Mvc.Async.WrappedAsyncResult1.End() +50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32 System.Web.Mvc.Async.<>c_DisplayClass39.b_33() +58 System.Web.Mvc.Async.<>c_DisplayClass4f.b_49() +225 System.Web.Mvc.Async.<>c_DisplayClass4f.b_49() +225 System.Web.Mvc.Async.<>c_DisplayClass37.b_36(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResult1.End() +50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34 System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +24 System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +99 System.Web.Mvc.Async.WrappedAsyncResult1.End() +50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27 System.Web.Mvc.<>c_DisplayClass1d.b_18(IAsyncResult asyncResult) +14 System.Web.Mvc.Async.<>c_DisplayClass4.b_3(IAsyncResult ar) +23 System.Web.Mvc.Async.WrappedAsyncResult1.End() +55 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +39 System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23 System.Web.Mvc.Async.WrappedAsyncResult1.End() +55 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10 System.Web.Mvc.<>c_DisplayClass8.b_3(IAsyncResult asyncResult) +25 System.Web.Mvc.Async.<>c_DisplayClass4.b__3(IAsyncResult ar) +23 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +31 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629296 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

5
  • Anything in the fusion or windows logs? Apr 27, 2013 at 13:43
  • thats all, i can add that this exception occur in random cases
    – matiii
    Apr 27, 2013 at 13:52
  • Can you show the TestStart action code?
    – devdigital
    Apr 27, 2013 at 13:58
  • In which case you need add logging to narrow down what's happening. Essentially you need to be able to create a scenario that's repeatable. When you random, what do you mean? What about the data? Is this the same on both sites? Apr 27, 2013 at 13:58
  • The random means that the exception in the some case one occur the next time doesnt. Maybe this a problem server no code or database ? Link to action: link
    – matiii
    Apr 27, 2013 at 14:08

1 Answer 1

0

Make sure that the local configuration is the same as the server you're using.

For example, if you're hosting in IIS, set up a local IIS server with the same settings as on your remote server.

If your 1and1 hosting is shared, then look at your local configuration, and get on the phone with 1and1 support to see what the differences are between the local and remote configuration.

It's possible that you'll have to upgrade to a VPS or Dedicated server depending on your configuration needs.

Edit

Will you please post the source of the mvc controller method that is being called? Also, the values of each member in the method when it runs on the server? That would help in the process of evaluating your question.

Also,

I just realized that lambda_method(Closure , ControllerBase , Object[] ) +119 is on the second line of the stack trace.

If the error is being thrown from a lambda expression it may be that the iteration item that you're using in the lambda method is set to null at some point. If you don't check for null in your lambda expression, try that. It's just a guess, but without source code, all we've got are guesses.

3
  • the problem was in the server, this hosting is very weak
    – matiii
    May 10, 2013 at 11:32
  • the problem was fixed when you moved to a better server? Incidentally, I don't know if you've heard of windows azure, or tried to use it, but for web applications, their website hosting is great. They have other options if you have a larger budget. May 12, 2013 at 2:08
  • but i doesn't ;p in this server session die out
    – matiii
    May 16, 2013 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.