RolProvider throw error sometime

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.
8/14/2006 9:31:32 AM
kwa
Gravatar
Total Posts 23

RolProvider throw error sometime

when I start up the application, sometime it works good, sometime I see this unknown error:

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Exception has been thrown by the target of an invocation.

Source Error:

Line 327:		<roleManager enabled="true" defaultProvider="mojoRoleProvider">
Line 328:			<providers>
Line 329:				<add name="mojoRoleProvider" type="mojoPortal.Web.mojoRoleProvider"  />
Line 330:			</providers>
Line 331:		</roleManager>

 

when the error detail is hidden like this, I have no clue how to fix it. do you have an idea what caused the error? The weird problem is it does not show up every time, it's like whenever it feels like.

8/14/2006 9:45:44 AM
Gravatar
Total Posts 18439

Re: RolProvider throw error sometime

I've only ever seen that when first setting up a site if an error occurs and siteSettings is a null object that error will happen in the constructor of mojoRoleProvider.

I've never seen it happen once a site has been correctly configured.
maybe should change the constructor code to be like this:

public mojoRoleProvider()
        {
            if (HttpContext.Current != null)
            {
                siteSettings = SiteSettings.GetCurrent();
                if(siteSettings != null)
                {
                    this.applicationName = siteSettings.SiteName;
                }
            }

        }
adding the check for null

but then again if siteSettings is null maybe its best if an error is raised, I suppose I could throw an error which would give more info about the problem. The error is probably in the mojoportal error log ~/Data/currentlog.config

The real solution is most likely find the cause of siteSettings being null sometimes which I guess is what is happening for you. Again, I have only seen this happen in initial site setup when some setup isse causes siteSettings to be null.

Joe
8/14/2006 5:38:57 PM
kwa
Gravatar
Total Posts 23

Re: RolProvider throw error sometime

Now I kind of understand the cause of null refference, before this error occured. there was an error from SQLExpress too. It's Timeout expired.  . And that occured when I start up my desktop and hit the local site right away.

When there is "Timeout expired." error, it usually gone after I refresh the page, and what is left is error from mojoRoleProvider. and this error is gone when I recompiled the dll or update web.config.

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