Copied to clipboard

Flag this post as spam?

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


  • John Martin 5 posts 25 karma points
    Mar 06, 2012 @ 17:53
    John Martin
    0

    ERROR importing provider NHibernateProvider

    Hello,  I wrote a function to programmatically do a Courier Transfer as part of a Workflow.  Everything was working fine for a while (using Courier 2.0 dlls) until recently when I recently started receiving this error (below).  This still occurs when I updated my dlls to the latest hot fix 2.6.6.  Does anyone know how to fix this, or what could be the root cause?

    Here is the part of my code that breaks:

     

    string providerGuidStr = GetProviderId(nodeid);
    string itemIdStr = GetItemId(providerGuidStr, nodeid);
    SystemItem sysitem = new SystemItem();
    errorInfo = String.Format("{0} Providerguid: {1}", errorInfo, providerGuidStr);
    Guid providerGuid = new Guid(providerGuidStr);
    ItemProvider ip = ItemProviderCollection.Instance.GetProvider(providerGuid);
                   
    sysitem = ip.FindSystemItem(itemIdStr);

     

    ERROR from log_Error.txt 

     

    3/6/2012 10:42:13 AM: Can't import provider 'Umbraco.Courier.Persistence.V4.NHibernate.NHibernateProvider' 

    id: e0474ca8-e73b-11df-9492-0800200c9a66: 

    System.NullReferenceException: Object reference not set to an instance of an object.

       at Umbraco.Courier.Persistence.V4.NHibernate.NHibernateProvider.CreateSessionFactory() 

    in c:\Program Files (x86)\teamcity\buildAgent\work\51d185ff47ab530d\Umbraco.Courier.Persistence.NHibernate\NHibernate.cs:

    line 215

       at Umbraco.Courier.Core.ProviderCollection`1.™(IEnumerable`1 types)

     

  • John Martin 5 posts 25 karma points
    Mar 09, 2012 @ 22:04
    John Martin
    0

    I am still receiving this error.  Is there anyway to get the source code to NHiberante so I can look at line 170 and figure out what the null reference is?  Per, any ideas?

    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 124:            Guid providerGuid = new Guid(providerGuidStr);
    Line 125:            ItemProvider ip = ItemProviderCollection.Instance.GetProvider(providerGuid);
    Line 126: sysitem = ItemProviderCollection.Instance.GetProvider(providerGuid).FindSystemItem(itemIdStr); Line 127:            PackagingManager instance = PackagingManager.Instance;
    Line 128:            instance.ClearQueue();


    Source File: C:\Projects\HoosierLotteryWebsite CMS - v4.5.8\HoosierLottery.CourierHelper\CourierTransfer.cs Line: 126

    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
       Umbraco.Courier.Persistence.V4.NHibernate.NHibernateProvider.CreateSessionFactory() in d:\TeamCity6\buildAgent\work\8233cfd3f736a0ca\Umbraco.Courier.Persistence.NHibernate\NHibernate.cs:170
       Umbraco.Courier.Persistence.V4.NHibernate.NHibernateProvider.get_SessionFactory() in d:\TeamCity6\buildAgent\work\8233cfd3f736a0ca\Umbraco.Courier.Persistence.NHibernate\NHibernate.cs:59
       Umbraco.Courier.Persistence.V4.NHibernate.NHibernateProvider.OpenSession() in d:\TeamCity6\buildAgent\work\8233cfd3f736a0ca\Umbraco.Courier.Persistence.NHibernate\NHibernate.cs:162
       Umbraco.Courier.Persistence.V4.NHibernate.NHibernateProvider.get_Session() in d:\TeamCity6\buildAgent\work\8233cfd3f736a0ca\Umbraco.Courier.Persistence.NHibernate\NHibernate.cs:44
       Umbraco.Courier.Persistence.V4.NHibernate.NHibernateProvider.GetCurrentSession() in d:\TeamCity6\buildAgent\work\8233cfd3f736a0ca\Umbraco.Courier.Persistence.NHibernate\NHibernate.cs:132
       Umbraco.Courier.Persistence.V4.NHibernate.Persisters.DocumentItem.AvailableItems(ItemIdentifier itemId) in d:\TeamCity6\buildAgent\work\8233cfd3f736a0ca\Umbraco.Courier.Persistence.NHibernate\Persisters\Document.cs:15
       Umbraco.Courier.Core.ItemCrud.AvailableItems() +122
       Umbraco.Courier.Core.ItemCrudProvider.AvailableItems() +175
       Umbraco.Courier.ItemProviders.DocumentItemProvider.AvailableSystemItems() in d:\TeamCity6\buildAgent\work\8233cfd3f736a0ca\Umbraco.Courier.Providers\ItemProviders\ContentItemProvider.cs:36
       Umbraco.Courier.Core.ItemProvider.FindSystemItem(String id) +109
       HoosierLottery.CourierHelper.CourierTransfer.PackageSelectedItems(Int32 nodeid, String snapshotdirectory) in C:\Projects\HoosierLotteryWebsite CMS - v4.5.8\HoosierLottery.CourierHelper\CourierTransfer.cs:126
       HoosierLottery.CourierHelper.CourierTransfer.TransferNode(Int32 nodeid, String url, String user, String pass) in C:\Projects\HoosierLotteryWebsite CMS - v4.5.8\HoosierLottery.CourierHelper\CourierTransfer.cs:38
       umbraco.controls.ContentControl.sendToUAT(Object Sender, ImageClickEventArgs e) in C:\Projects\HoosierLotteryWebsite CMS - v4.5.8\umbraco 4.7.1\umbraco\presentation\umbraco\controls\ContentControl.cs:406
       System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115
       System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +120
       System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
    



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

  • John Martin 5 posts 25 karma points
    Mar 12, 2012 @ 14:15
    John Martin
    0

    I found the root cause of this issue.  Another developer thought it would be a good idea to remove the umbracoDbDSN setting in the web config file to get rid of redundant connection strings.  However, NHibernate (via my Courier code), is dependent on this setting being there, which would explain the null reference error.  Anyway, I figured it out, thanks anyways.

Please Sign in or register to post replies

Write your reply to:

Draft