Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Christine 104 posts 256 karma points
    Apr 24, 2014 @ 16:35
    Christine
    0

    Error message when using search

    Hi luke,

     

    I tried the search and I got the following error message:

    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: 

    Line 20:         Examine.SearchCriteria.ISearchCriteria filter = null;
    Line 21:         string searchTerm = "";
    Line 22:         results = SmartBlogLibraries.Helpers.Search.SearchBlog(out filter, out searchTerm).Select(x => ((IPublishedContent)Umbraco.Content(x.Id))).ToList();
    Line 23:     }
    Line 24:     else


    Source File: c:\SRC\Konverge.WebSite.Umbraco\KonvergeUmbraco\Views\Partials\SmartListPosts.cshtml    Line: 22 

    Stack Trace: 

    [NullReferenceException: Object reference not set to an instance of an object.]
       SmartBlogLibraries.Helpers.Search.SearchBlog(ISearchCriteria& filter, String& searchTerm) +168
       ASP._Page_Views_Partials_SmartListPosts_cshtml.Execute() in c:\SRC\Konverge.WebSite.Umbraco\KonvergeUmbraco\Views\Partials\SmartListPosts.cshtml:22
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +96
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +88
       System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +259
       System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +93
       System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection) +276
       System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +108
       System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName) +31
       ASP._Page_Views_SmartBlogBlog_cshtml.Execute() in c:\SRC\Konverge.WebSite.Umbraco\KonvergeUmbraco\Views\SmartBlogBlog.cshtml:9
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +96
       System.Web.WebPages.StartPage.RunPage() +17
       System.Web.WebPages.StartPage.ExecutePageHierarchy() +62
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +76
       System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +259
       System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +93
       System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +294
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
       System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +23
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
       System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
       System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +175
       System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +324
       System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__19() +23
       System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +19
       System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
       System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
       System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
       System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
       System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
       System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9690164
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
    



    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

  • Luke Alderton 187 posts 492 karma points
    Apr 24, 2014 @ 16:39
    Luke Alderton
    0

    Hi Christine,

    That's odd, I did notice a problem with the search on a clients website earlier. I'm afraid I won't have a chance to look at it today unfortunately. I'll have a look at it tomorrow for you if that's okay?

    Thanks, Luke

  • Christine 104 posts 256 karma points
    Apr 24, 2014 @ 16:42
    Christine
    0

    That would be great!  Maybe this is a local host issue?  I am planning to move the site to a testing server today.

  • Luke Alderton 187 posts 492 karma points
    Apr 24, 2014 @ 16:55
    Luke Alderton
    0

    It could well be, the search seems to work well when i run the website directly from visual studio. Could I ask what the address is of the website your building? It might be something simple enough.

  • Christine 104 posts 256 karma points
    Apr 24, 2014 @ 17:00
    Christine
    0

    I tried the search running from Visual Studio and that's when I got the error.  I put the Umbraco site on a testing server and the blog is not working at all currently: http://umbracotest.konverge.com/konverge-blog/.  Looking into that....would I have to reinstall the package?

  • Luke Alderton 187 posts 492 karma points
    Apr 24, 2014 @ 17:11
    Luke Alderton
    0

    To fix the search, I could create a zip file which you would just have to unpack into the root directory of your website.

    However the URL you have provided shows a server side error. Could I ask how you published the website? I find that sometimes when publishing an Umbraco 7 website, the global.asax file does not get copied and so the website breaks.

  • Christine 104 posts 256 karma points
    Apr 24, 2014 @ 17:30
    Christine
    0

    My apologies - the url is only available internally or by vpn

    This is what I see when I view the blog:

  • Christine 104 posts 256 karma points
    Apr 24, 2014 @ 17:36
    Christine
    0

    The Umbraco site was published from Visual Studio and copied onto the server.

  • Luke Alderton 187 posts 492 karma points
    Apr 24, 2014 @ 17:38
    Luke Alderton
    0

    It's a possibility that the site hasn't been copied correctly. You might want to confirm that all the files exist on the live server.

  • Christine 104 posts 256 karma points
    Apr 24, 2014 @ 18:29
    Christine
    0

    Thanks - you're right.  Some files didn't get published.  That is resolved now.


    Regarding the search - there is no error message on the server, it just does not do anything.

  • Luke Alderton 187 posts 492 karma points
    Apr 28, 2014 @ 18:22
    Luke Alderton
    0

    From memory, the search is handled via JS, it redirects you to the search results page with a query string on the end, can you check if the JS is running?

  • Christine 104 posts 256 karma points
    Apr 29, 2014 @ 20:12
    Christine
    0

    Hi Luke - The Main.Smartblog.js is running without any errors.

  • Punit 2 posts 22 karma points
    May 28, 2014 @ 01:21
    Punit
    0

    Hi Luke / Christine - Did you ever find a solution for this error? I tried creating new projects in VS and WebMatrix on two different servers and keep getting this error.

  • Luke Alderton 187 posts 492 karma points
    May 28, 2014 @ 10:11
    Luke Alderton
    0

    Hi Punit,

    Does the error occur only after publishing the site?

    Thanks, Luke

  • Punit 2 posts 22 karma points
    May 28, 2014 @ 20:03
    Punit
    0

    Hi Luke, it occurs on my local development environment. Steps: 1. download and install Umbraco via visual studio / nuget. 2. install smartblog package. 3. publish content nodes. 4. browse to site and search.

    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:

    Line 19: Examine.SearchCriteria.ISearchCriteria filter = null; Line 20: string searchTerm = ""; Line 21: results = SmartBlogLibraries.Helpers.Search.SearchBlog(out filter, out searchTerm).Select(x => ((IPublishedContent)Umbraco.Content(x.Id))).ToList(); Line 22: } Line 23: else

    Source File: c:\inetpub\smartblog\smartblog\Views\Partials\SmartListPosts.cshtml Line: 21

Please Sign in or register to post replies

Write your reply to:

Draft