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

Forums / Bugs & Issues / "Object reference not set" error when saving SMTP settings

"Object reference not set" error when saving SMTP settings

20 posts, 0 answered
  1. Kyle Baley
    Kyle Baley avatar
    15 posts
    Registered:
    09 Jun 2004
    02 Jan 2009
    Link to this post
    Just upgraded to Sitefinity 3.5 SP1 and I'm not able to set the SMTP settings in the user interface. When I enter values for them, I get an error page "Object reference not set to an instance of an object".

    From the stack trace (below), it sounds similar to the error I'm getting with RSS feeds (http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bmckch.aspx). Like that problem, it works locally, but not on my server (dedicated server, not a shared host).

    Could it be related to the assembly located in Sitefinity\ServiceAssemblies? I realize now that I didn't delete it before I upgraded it but when I delete it now, I get an error message when I go to the Newletter module.

    Stack trace:

    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.WebServices.DynamicProxy.WebServiceDynamicProxy.InvokeWebMethodCall(Boolean async) +300
       Telerik.WebServices.DynamicProxy.WebServiceDynamicProxy.InvokeWebMethodCall() +7
       Telerik.Notifications.Services.MailingServiceProxy.VerifySMTPSetting(String smtpHost, Int32 smtpPort, String smtpUsername, String smtpPassword, Boolean smtpSsL, String msgBody) +153
       Telerik.Notifications.Newsletters.WebControl.SMTPSettingControl.TestCurrentSettings() +265
       Telerik.Notifications.Newsletters.WebControl.SMTPSettingControl.SaveCurrentSetting() +18
       Telerik.Notifications.Newsletters.WebControl.SMTPSettingControl.button_Command(Object sender, CommandEventArgs e) +233
       System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +108
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
       System.Web.UI.WebControls.LinkButton.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) +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    06 Jan 2009
    Link to this post
    Hello Kyle Baley,

    Could you please check if the assembly gets generated after you delete it? If not, you could try generating the such with the same version of the CMS on some other server (for example on your local one).

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Kyle Baley
    Kyle Baley avatar
    15 posts
    Registered:
    09 Jun 2004
    06 Jan 2009
    Link to this post
    Georgi,

    I did try this previously based on another forum thread. Tried again this morning and am still having trouble.

    The assembly doesn't get re-generated. After deleting it, I get an error when I try to go to the Newletters module. The error is:\

    A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 72.167.49.197:80

    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.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 72.167.49.197:80

    Source Error:

    Line 267:            foreach (IWebModule module in ModuleManager.GetWebModulesValues())
    Line 268:            {
    Line 269:                if (module is SecuredModule && ((SecuredModule)module).CanCreate())
    Line 270:                    webModules.Add(module);
    Line 271:            }

    Source File: c:\Data\Websites\BahaNetNew\Sitefinity\Admin\Default.aspx.cs    Line: 269

    Stack Trace:

    [SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 72.167.49.197:80]
       System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +239
       System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +35
       System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +224
    
    [WebException: Unable to connect to the remote server]
       System.Net.HttpWebRequest.GetResponse() +5313085
       Telerik.WebServices.DynamicProxy.WsdlHelper.GetWsdlFromUri(String uri, Cookie authCookie) +104
       Telerik.WebServices.DynamicProxy.WsdlHelper.GetWsdl(String source, Cookie authCoocke) +76
       Telerik.WebServices.DynamicProxy.WebServiceDynamicProxy.BuildProxy() +32
       Telerik.WebServices.DynamicProxy.WebServiceDynamicProxy..ctor(String wsdlLocation, Cookie authCookie) +146
       Telerik.Notifications.Services.MailingServiceProxy..ctor(String wsdlUri) +296
       Telerik.Notifications.Newsletters.DataManager.OnInitialized() +53
       Telerik.ManagerBase`1.Initialize() +505
       Telerik.ManagerBase`1..ctor(String providerName) +21
       Telerik.ManagerBase`1..ctor() +11
       Telerik.Notifications.Newsletters.DataManager..ctor(String providerName) +15
       Telerik.Notifications.Newsletters.DataManager.get_Providers() +32
       Telerik.Notifications.Newsletters.DataManager.get_SecurityRoots() +56
       Telerik.Notifications.Newsletters.NewsletterModule.get_SecurityRoots() +5
       Telerik.Security.Permissions.SecuredModule.CanCreate() +34
       Admin_Default.Page_Load(Object sender, EventArgs e) in c:\Data\Websites\BahaNetNew\Sitefinity\Admin\Default.aspx.cs:269
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       Telerik.Cms.Web.CmsPageBase.OnLoad(EventArgs e) +55
       Telerik.Cms.Web.AdminPage.OnLoad(EventArgs e) +19
       Admin_Default.OnLoad(EventArgs e) in c:\Data\Websites\BahaNetNew\Sitefinity\Admin\Default.aspx.cs:69
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

    When I replace it with the generated assembly from my local machine, I can go to the Newsletters module but I still get an error when I try to save the SMTP settings. The error is slightly different:

    The request failed with HTTP status 404: Not Found.

    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.Net.WebException: The request failed with HTTP status 404: Not Found.

    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:

    [WebException: The request failed with HTTP status 404: Not Found.]
       Telerik.WebServices.DynamicProxy.WebServiceDynamicProxy.InvokeWebMethodCall(Boolean async) +340
       Telerik.WebServices.DynamicProxy.WebServiceDynamicProxy.InvokeWebMethodCall() +7
       Telerik.Notifications.Services.MailingServiceProxy.VerifySMTPSetting(String smtpHost, Int32 smtpPort, String smtpUsername, String smtpPassword, Boolean smtpSsL, String msgBody) +153
       Telerik.Notifications.Newsletters.WebControl.SMTPSettingControl.TestCurrentSettings() +265
       Telerik.Notifications.Newsletters.WebControl.SMTPSettingControl.SaveCurrentSetting() +18
       Telerik.Notifications.Newsletters.WebControl.SMTPSettingControl.button_Command(Object sender, CommandEventArgs e) +233
       System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +108
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
       System.Web.UI.WebControls.LinkButton.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) +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    

    On a side note, in order to delete the generated assembly, I had to reset IIS completely. It wouldn't allow me to delete if I stopped the application pool or the website. If possible, it would be nice if it were easier to delete this assembly without taking down IIS completely.

    Thanks
    Kyle
  4. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    06 Jan 2009
    Link to this post
    i finally got my smtp settings but now when I save them I too am getting the 404 error, specifically: "The request failed with HTTP status 404: Not Found"

    any ideas what I may be doing wrong here?
  5. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    07 Jan 2009
    Link to this post
    Hi,

    Unfortunately the problem is in the web service, and we could not provide a fix for this at this time. We are currently working on resolving this issue.
    I assume you both tried with Anonymous Authentication enabled in your IIS already.

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Kyle Baley
    Kyle Baley avatar
    15 posts
    Registered:
    09 Jun 2004
    07 Jan 2009
    Link to this post
    Ok, thanks for the update, Georgi. Yes, I'm using Anonymous Authentication in IIS. I'll watch for the fix in a newer version. Is it an issue with IIS7? I'm trying to determine why it works for some people (and on my local machine) but not for my server.

    Also, is there a way we could insert the SMTP settings directly into the database? I see where it goes but the GUID there is putting me off trying anything myself.
  7. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    08 Jan 2009
    Link to this post
    Hi Kyle Baley,

    Here is a little update - one of our customers reported that he got this working after setting trust level to full in the web.config file, perhaps you can run your project in full trust and try using the Newsletters again?

    As for the SMTP settings in the database, I will check this out and will report back if it is possible.

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Kyle Baley
    Kyle Baley avatar
    15 posts
    Registered:
    09 Jun 2004
    08 Jan 2009
    Link to this post
    Hi Georgi,

    Don't think that's my issue because by default, sites run under full trust, don't they? In any case, I added <trust level="Full" originUrl="" /> to the <system.web> section of my web.config. I'm still not able to save SMTP settings. Not sure if the Newletters module is working because it won't let me send newsletters until I have SMTP settings saved.

    Thanks
    Kyle
  9. Kyle Baley
    Kyle Baley avatar
    15 posts
    Registered:
    09 Jun 2004
    09 Jan 2009
    Link to this post
    Georgi,

    I managed to get this fixed. I used Reflector to examine the dynamically generated service assembly and noticed that it was initializing to the wrong base URL (using the localhost URL from my local machine).

    The way I was able to fix it was to re-generate the service assembly as you described. What was not clear to me earlier was that I had to access the site locally from my web server in order to re-generate the service assembly. When I tried accessing it from an external site, the service assembly would not get re-generated.

    After I re-generated the service assembly, I was able to save the SMTP settings as expected.

    To summarize: It appears the dynamic service assembly can be re-generated only if you access the site locally. The reason I had avoided that is because I run several websites on this server so localhost isn't mapped to any particular site. And DNS is set up such that navigating to them from a browser on the web server doesn't work. I ended up having to create a mapping in my hosts file to map the site back to 127.0.0.1.

    Thanks for your help with this!

    Kyle
  10. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    09 Jan 2009
    Link to this post
    Hi Kyle Baley,

    It is great to hear that you managed to find this workaround! It will definitely help both to us and to the people having this problem.

    We updated your account for this very helpful feedback!

    Greetings,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  11. Chanan Zass
    Chanan Zass avatar
    123 posts
    Registered:
    21 Aug 2012
    19 Jan 2009
    Link to this post

    Tried to follow Kyle's advice regarding the Hosts file.

    Unfortunately, it appears this approach works only when your site is placed under the Default Web Site (or under /intepub/wwwroot).

    Our sites are set up under a different folder and we can't seem to be able to map the call to our site locally on the Web server.

    Any other way we can take in order to configure our SMTP Server?

    Thanks.

    Chanan Zass.

  12. Kyle Baley
    Kyle Baley avatar
    15 posts
    Registered:
    09 Jun 2004
    19 Jan 2009
    Link to this post

    Chanan,

    It should work if the site isn't under the Default Web Site. I know because mine isn't. I've disabled the default site and created a brand new one for www.bahanet.org. But I added the following to my hosts file on the web server:

    127.0.0.1    bahanet.org

    In IIS, I have a host header set up to bahanet.org as well. So when I navigate to bahanet.org from the web server itself, it redirects to the localhost IP address.

  13. Chanan Zass
    Chanan Zass avatar
    123 posts
    Registered:
    21 Aug 2012
    19 Jan 2009
    Link to this post
    Thanks for your prompt reply.
    In other words, you've replaced the default Web site with your new site in IIS.
    Is that correct?

    I'll try that tomorrow. A bit concerned about doing that, as our server is managed by Parallels Plesk Panel...

    Will let you all know how it went.

    Chanan.
  14. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    22 Jan 2009
    Link to this post
    Hello,

    We are still working on the problem with the web services. Let us know about the results with this approach though.

    Kind regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  15. Chanan Zass
    Chanan Zass avatar
    123 posts
    Registered:
    21 Aug 2012
    22 Jan 2009
    Link to this post
    I've not gone ahead and tried it, because I remembered we're in a situation where we must use our server's default mail service (127.0.0.1) without a username and password.
    So, assuming I resolve the problems with
    3889AC4AF542BAC3C62ABB154E78FEA8.dll

    I would still, so it appears, not be able to configure the SMTP server required for sending out the newsletters.

    Hope this problem is on the ToDo list for version 3.6??

    Many thanks.
  16. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    27 Jan 2009
    Link to this post
    Hi Chanan Zass,

    That's right, it is in the To-Do and we are already working on it. We replied to the support ticket as well.

    We apologize for the inconvenience.

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  17. Jay
    Jay avatar
    25 posts
    Registered:
    12 May 2008
    02 Feb 2009
    Link to this post
    Hi Kyle,

    Did you get the newsletter module sending mail from a remote machine or from the local machine but using a domain name other than localhost? I was able to regenerate the service assembly following your steps but unfortunately I can only get the newsletter module to send mail via the localhost domain name using any other and it fails.

    Regards,

    Jay
  18. Kyle Baley
    Kyle Baley avatar
    15 posts
    Registered:
    09 Jun 2004
    02 Feb 2009
    Link to this post
    Jay,

    I have it sort of working for my domain. I didn't test locally but It's a little flaky though. I got error messages saying it didn't get sent out because the e-mail address wasn't valid even though it is. Furthermore, an informal poll showed that a good number of people (possibly all of them) actually did get the message. Because of this, I've reverted to the tried and true mass mailout to a group I was using before Sitefinity.
  19. Jesse
    Jesse avatar
    21 posts
    Registered:
    28 Nov 2007
    09 Feb 2009
    Link to this post
    I got an even stranger issue -- when we're logged in locally, it saves/sends no problem -- when you're remote, it doesn't work.  We tried to do the full trust (both in the root and /sitefinity) ...no luck.

    Anyone got another trick to get this to work?
  20. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    10 Feb 2009
    Link to this post
    Hello Jesse,

    This is the same problem. Could you please try the approach with the hosts file?
    The issue is fixed for Sitefinity 3.6, which should be released in a few days.

    Best wishes,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
20 posts, 0 answered