Object reference not set.... in WebStore

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
10/7/2008 9:20:38 PM
Gravatar
Total Posts 29

Object reference not set.... in WebStore

When creating a new instance of the WebStore, I go to the 'Store Manager' and then 'Store Settings' and I get:

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 285: protected override void OnLoad(EventArgs e)
Line 286: {
Line 287: base.OnLoad(e);
Line 288: if (
Line 289: (Request.IsAuthenticated)


Source File: C:\Projects\MojoPortal\Web\Components\mojoBasePage.cs Line: 287

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
WebStore.UI.AdminStoreSettingsPage.LoadSettings() +231
WebStore.UI.AdminStoreSettingsPage.Page_Load(Object sender, EventArgs e) +103
System.Web.UI.Control.OnLoad(EventArgs e) +99
mojoPortal.Web.mojoBasePage.OnLoad(EventArgs e) in C:\Projects\MojoPortal\Web\Components\mojoBasePage.cs:287
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

 

Is there something I'm supposed to do prior?

 

Thx

Greg P

10/8/2008 7:56:39 AM
Gravatar
Total Posts 18439

Re: Object reference not set.... in WebStore

I do not get this error. Maybe something is missing in your db data like languages or countries or currency.

Which db platform are you using? Have you tried a clean install on a new db?

If all else fails just set a break point and step through the code to see what is null

Hope it helps,

Joe

10/8/2008 9:09:49 AM
Gravatar
Total Posts 29

Re: Object reference not set.... in WebStore

That's whats strange. It craps out when it his base.OnInit(e) but base is not null at that point. I'm not in front of it now but I'll go see what base is at that point.

This is on MySQL ...... cant recall the version right now but it's a stable one. I'll look that up as well.

Thx

Greg

10/8/2008 10:30:03 AM
Gravatar
Total Posts 18439

Re: Object reference not set.... in WebStore

base in this case is mojoBasePage, so you may need to set your breakpoint in mojoBasePage.OnInit

I just tested here with a new empty MySql db, did an install and it worked for me creating a page and putting a store on it and I got no error in Store Settings.

Best,

Joe

10/8/2008 10:34:54 PM
Gravatar
Total Posts 29

Re: Object reference not set.... in WebStore

Here's what I have so far - see if I'm on the right track.

The missing object is from AdminStoreSettings.aspx.cs line 494 where moduleID is tested against the store.ModuleID. The store object is null. It's null because in line 488 CurrentPage,ContainsModule(ModuleID) returns false so the store object in the if clause never gets asigned. I'm still backtracking but there is something with line 482 in CacheHelper.cs in PageSettings currentPage = new PageSettings(siteSettings.SiteId, pageID); that's causing currentPage to be returned as null, so then in 486 currentPage is given a new instance and in your comments you state it is defaulting to the Home Page.

So in AdminStoreSettingsPage line 488, it's looking for the Store's ModuleID but since it has the Home Page modules if fails and the store object never gets assigned.

Am I heading in the right direction?

Thx

Greg P

10/9/2008 6:00:37 AM
Gravatar
Total Posts 18439

Re: Object reference not set.... in WebStore

Yeah, you're on the right track. Need to find out why pagesettings isn't finding the page. The page id is in the query string for that page so it should find it. And if the store module is on that page it should find that as well.

You are using the latest svn code right?

Best,

Joe

10/11/2008 10:27:25 PM
Gravatar
Total Posts 9

Re: Object reference not set.... in WebStore

I got the same problem , when I create a new webstore instance :

SqlParameterHelper sph = new SqlParameterHelper(GetConnectionString(), "mp_ModuleSettings_CreateDefaultSettings", 1);
sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > -1);

-----------------------return 0,and my db  table "mp_ModuleSettings_CreateDefaultSettings" have nothing about webstore ,it is ok or not?

10/12/2008 6:12:14 AM
Gravatar
Total Posts 18439

Re: Object reference not set.... in WebStore

Yes, 0 rows is ok there because there are no module settings for web store. It has a separate table for Store Settings.

You must sign in to post in the forums. This thread is closed to new posts.