Object reference not set to an instance of an object (Server Error in '/PTWeb' Application)

Object reference not set to an instance of an object (Server Error in '/PTWeb' Application)

Old forum URL: forums.lhotka.net/forums/t/8091.aspx


bharat0204 posted on Friday, December 04, 2009

Hi there, I'm new to csla and I'm struggling. Yeah, I really am!

My configuration is SQL2005, VS 2008 and Windows XP. I tried to follow the instructions in http://www.lhotka.net/files/csla20/BuildCsla.pdf but the PTWeb-project is giving me a hard time.  The error message I get is down here. Can anyone give me a clou? I m using CSLA 3.0.0 and using IIS for the project and not the VS built in Web Server

thanks in advance, Bharat

 

Server Error in '/PTWEBCS' 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:

[No relevant source lines]

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ptwebcs\8e89fd38\e9f076bd\App_Web_dhchu2oh.6.cs    Line: 0

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   System.Web.Hosting.ISAPIWorkerRequestInProc.GetServerVariable(String name) +349
   System.Web.Hosting.ISAPIWorkerRequest.ReadRequestHeaders() +95
   System.Web.Hosting.ISAPIWorkerRequest.GetKnownRequestHeader(Int32 index) +55
   System.Web.HttpRequest.get_UserAgent() +26
   System.Web.Configuration.HttpCapabilitiesEvaluator.GetUserAgent(HttpRequest request) +32
   System.Web.Configuration.HttpCapabilitiesEvaluator.Evaluate(HttpRequest request) +50
   System.Web.Configuration.HttpCapabilitiesBase.GetBrowserCapabilities(HttpRequest request) +38
   System.Web.HttpRequest.get_Browser() +178
   System.Web.UI.Page.SetIntrinsics(HttpContext context, Boolean allowAsync) +189
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +14
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.default_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ptwebcs\8e89fd38\e9f076bd\App_Web_dhchu2oh.6.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082

RockfordLhotka replied on Friday, December 04, 2009

Do you have other working web sites on that server? The exception stack trace makes it look like ASP.NET is failing long before it gets to your code or CSLA .NET code...

bharat0204 replied on Monday, December 07, 2009

thanks for the reply.

yes you are right ...whenever i am trying to use IIS for my current project it is giving the same error but it is working fair enough under VS web Server.

so i dont have any idea what to check for this as my current project is also using CSLA and it is working fine under  VS web server but not not working under IIS and i am new developer assigned to this project so trying to hands on CSLA and configuring projecttracker but failed.

please help...

bharat0204 replied on Tuesday, December 08, 2009

Thank you very much for your help and reply.

i resolved that problem and now i can able to see the Login page of project but while logging i am getting below error..

 

this error i guess is because of missing of below step..

7.The PTWeb and PTWebService projects are configured to use the

EnterpriseServicesProxy within the data portal. Before you can run these

projects you need to start aVisual Studio 2005 Command Prompt window and

run regsvcs.exe to register the EnterpriseServicesHostvb.dll or

EnterpriseServicesHostcs.dll file. Alternately, you can change PTWeb and

PTWebService to use either the Remoting or Web Services proxies instead.

If you do use the EnterpriseServicesProxy, you must also open the COM+

Applications properties window for the service and set the Application Root

Directory in the Activation tab. The path should point to the same

 

But i need to know is there some alternate to this option as i could not able to get the Component Service on my machine.

please suggest.

waiting for your reply.

thanks in advance.

Server Error in '/PTWEBCS' 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 218:          innerMessage = ex.InnerException.Message;
Line 219:        }
Line 220:        throw new DataPortalException(
Line 221:          String.Format("DataPortal.Fetch {0} ({1})", Resources.Failed, innerMessage), 
Line 222:          ex.InnerException, result.ReturnObject);

Source File: C:\P\CSLA\CSLA 3.0.0 C#\cslacs\cslacs\Csla\DataPortal\Client\DataPortal.cs    Line: 220

Stack Trace:

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

[CallMethodException: DataPortal_Fetch method call failed]

[DataPortalException: DataPortal.Fetch failed (Object reference not set to an instance of an object.)]
   Csla.DataPortal.Fetch(Type objectType, Object criteria) in C:\P\CSLA\CSLA 3.0.0 C#\cslacs\cslacs\Csla\DataPortal\Client\DataPortal.cs:220
   Csla.DataPortal.Fetch(Object criteria) in C:\P\CSLA\CSLA 3.0.0 C#\cslacs\cslacs\Csla\DataPortal\Client\DataPortal.cs:156
   ProjectTracker.Library.Security.PTIdentity.GetIdentity(String username, String password) in C:\P\CSLA\CSLA 3.0.0 C#\cslacs\ProjectTrackercs\ProjectTracker.Library\Security\PTIdentity.cs:57
   ProjectTracker.Library.Security.PTPrincipal.Login(String username, String password) in C:\P\CSLA\CSLA 3.0.0 C#\cslacs\ProjectTrackercs\ProjectTracker.Library\Security\PTPrincipal.cs:15
   PTMembershipProvider.ValidateUser(String username, String password) in c:\P\CSLA\CSLA 3.0.0 C#\cslacs\ProjectTrackercs\www\PTWeb\App_Code\PTMembershipProvider.cs:11
   System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
   System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +119
   System.Web.UI.WebControls.Login.AttemptLogin() +115
   System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
   System.Web.UI.WebControls.Button.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) +1565


Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082

ajj3085 replied on Tuesday, December 08, 2009

I'd change the configuration to use the local dataportal mode only; that is, remove the line specifying the kind of dataportal to use in the configuration file. 

Once you understand this setup, then move on to trying to get a remote dataportal setup to work.

bharat0204 replied on Wednesday, December 09, 2009

Thank you very much...its work..and i am able to see all the pages..

once again thank you very much for all your support and help.

Copyright (c) Marimer LLC