+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Creating newsletter failed - Object reference

Creating newsletter failed - Object reference

8 posts, 0 answered
  1. IT
    IT avatar
    52 posts
    Registered:
    30 Sep 2008
    20 Nov 2008
    Link to this post
    I'm not getting the "usual" newsletter problem that I've read about in other threads.  When I create a new newsletter (this is my first one) I enter in the name, from address and click on the "Next: Write Content" button.  When that submits, I get the following error:

    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.]   Telerik.Notifications.Newsletters.WebControl.CreateNewsletter.OnWriteContent(ControlPanel cntrlPnlObj) +354   Telerik.Notifications.Newsletters.WebControl.CreateNewsletter.button_Command(Object sender, CommandEventArgs e) +290   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +105   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +132   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +177   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746


    From my sitefinity.log:

    ************************************************************************************
    ID: 22268483-2c40-4e70-9c68-a9d2dd0b1bcf; Code: 3005; Occurrence: 1; Sequence: 16
    ------------------------------------------------------------------------------------

    Application information:
    Machine name: XXXXXXXXXXX
    OS Version: Microsoft Windows NT 5.2.3790 Service Pack 2
    Product Version: 3.5.1714.2
    Application Path: D:\Data\web\Sitefinity35\
    Debug: True

    Process information:
    Process ID: 3908
    Process Name: w3wp

    Request information:
    Request URL: /en/Sitefinity/Admin/Modules.aspx?module=Newsletters
    Rewrite URL: http://XXXXXXXXXXX/en/Sitefinity/Admin/Modules.aspx?module=Newsletters
    Url Referrer: http://XXXXXXXXXXX/en/Sitefinity/Admin/Modules.aspx?module=Newsletters
    Is Authenticated: True
    Authentication Type: Forms
    User: michaels
    User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.3.154.9 Safari/525.19
    User Address: 10.4.0.37

    Variables:
    cmscurrcult: en
    Sitefinity.UrlChahged: False
    RadControlRandomNumber: 0
    AspSessionIDManagerInitializeRequestCalled: True
    CmsHttpRequest: /Sitefinity/Admin/Modules.aspx?module=Newsletters

    - L0 -------------------------------------------------------------------------------

    Exception Type: System.NullReferenceException

    Message: Object reference not set to an instance of an object.

    Source: Telerik.Notifications

    Stack Trace: 
       at Telerik.Notifications.Newsletters.WebControl.CreateNewsletter.OnWriteContent(ControlPanel cntrlPnlObj)
       at Telerik.Notifications.Newsletters.WebControl.CreateNewsletter.button_Command(Object sender, CommandEventArgs e)
       at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
       at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    ------------------------------------------------------------------------------------

    Any ideas??
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    21 Nov 2008
    Link to this post
    Hello Michael,

    Do you have different membership provider set? This error was typical for Sitefinity 3.5. Upgrading to SP1 will solve the problem.

    Greetings,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. IT
    IT avatar
    52 posts
    Registered:
    30 Sep 2008
    21 Nov 2008
    Link to this post
    I do have two membership providers (added Active Direcotry).

    After going through the upgrade, I get a new error:

    Server Error in '/' Application.

    Specified cast is not valid.

    Description: Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code.

    Exception Details: System.InvalidCastException: Specified cast is not valid.

    Source Error:

    An unhandled exception was generated during the execution of thecurrent web request. Information regarding the origin and location ofthe exception can be identified using the exception stack trace below.

    Stack Trace:

    [InvalidCastException: Specified cast is not valid.]   Telerik.Notifications.Newsletters.WebControl.CreateNewsletter.OnWriteContent(ControlPanel cntrlPnlObj) +390   Telerik.Notifications.Newsletters.WebControl.CreateNewsletter.button_Command(Object sender, CommandEventArgs e) +290   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +105   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +132   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +177   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746

    Strangely, no error is created in the log.

  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    25 Nov 2008
    Link to this post
    Hi Michael,

    Please browse to "\[YourProjectName]\Sitefinity\ServiceAssemblies"
    Under that folder you will find an assembly file looking like the one below.

    "3889AC4AF542BAC3C62ABB154E78FEA8.dll"


    Please delete this assembly from your directory, restart your IIS server and try to load Newsletters module again.
    Most probably this assembly is left from the version before the upgrade. A new assembly should be generated automatically.

    Let us know about the results.


    All the best,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Darren
    Darren avatar
    72 posts
    Registered:
    19 Mar 2008
    07 Mar 2010
    Link to this post
    I get the same error.
    I haven't upgraded but I do use my own providers.

    Anyway, deleting that .dll and restarting hasn't fixed it. What are the requirements for this call to succeed so I can check that the providers we're using are not causing problems?

    Many thanks
    Darren
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    07 Mar 2010
    Link to this post
    Hello Darren,

    If you use Active Directory where the users are identified by SID you may get this error. Sitefinity uses Guid and the newsletter expects Guid instead of SID.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  7. Darren
    Darren avatar
    72 posts
    Registered:
    19 Mar 2008
    07 Mar 2010
    Link to this post
    In fact I'm using the YAF provider which stores the UserId as an NVARCHAR(64) which in turn holds a GUID value.
    I don't know why an NVARCHAR(64) was chosen, presumably it's to allow a range of databases to be used including any which don't suppose the GUID datatype.

    I'm guessing that since the provider shouldn't be causing a problem with the UserId type that this is in fact a problem with a sproc which I could alter to convert between NVARCHAR(64) and a GUID?
    If this is the case can you tell me which sproc's need changing to convert types or whether it's something else which can't be modified?

    Thanks again.
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    08 Mar 2010
    Link to this post
    Hi Darren,

    You need to convert SID to GUID or use Guids with AD. You should override the membership provider classes and make a Guid - SID mapping. By default we call GetUser by  ProviderUserKey

    (Guid)UserManager.Default.GetUser().ProviderUserKey

    sample

    public override  MembershipUser GetUser(object providerUserKey, bool  userIsOnline)
        {
            // check if providerUserKey is Guid and get its mapped SID
            return base.GetUser(providerUserKey, userIsOnline);
        }


    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
8 posts, 0 answered