This is a migrated thread and some comments may be shown as answers.

NullReferenceException: HttpResponse A_0 - version 3.0.9.430

13 Answers 136 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 1
Markus asked on 02 Jul 2009, 11:40 AM
Hi

I'm new to Telerik.Reporting.
I installed the package and made a report with data from a db using DataSet, and DataSetTableAdapter.
Btw: Environment: Web-Application (Ajax enabled), Master- and Content-Pages.

The first calling of the page ended with an error: something is missing in web.config:

<

 

add verb="*" path="Telerik.ReportViewer.axd" type = "Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=x.x.x.xxx, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" />

 


So I added this one line into the web.config (changed "Version" to: 3.0.9.430) and the report showed up. Even the passed parameter for the SQL-Query worked. (ContentPage: ReportViewer -> ReportLibrary: Report -> TableAdapter.fill(DataSetTable, ParameterValue)

Now the bad thing:
Just below the output of the correctly generated report (even the footer and the pagenumbers are displayed) appears always this error message:

Serverfehler in der Anwendung /.  
--------------------------------------------------------------------------------  
 
Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.   
Beschreibung: Unbehandelte Ausnahme beim Ausführen der aktuellen Webanforderung. Überprüfen Sie die Stapelüberwachung, um weitere Informationen über diesen Fehler anzuzeigen und festzustellen, wo der Fehler im Code verursacht wurde.   
 
Ausnahmedetails: System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.  
 
Quellfehler:   
 
Beim Ausführen der aktuellen Webanforderung wurde einen unbehandelte Ausnahme generiert. Informationen über den Ursprung und die Position der Ausnahme können mit der Ausnahmestapelüberwachung angezeigt werden.    
 
Stapelüberwachung:   
 
[NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.]  
   ᜣ.ᜀ(HttpResponse A_0) +193  
   ᜣ.ᜂ(Object A_0, EventArgs A_1) +550  
   System.EventHandler.Invoke(Object sender, EventArgs e) +0  
   System.Web.HttpApplication.RaiseOnPreSendRequestHeaders() +8804047 
I don't have any code that's been executed after the display of the report. 

My guess is, something else is missing in the web.config file.
These are the entries in the web.config I found for "Reporting" (and the whole httpHandlers Section):

<?xml version="1.0"?>  
<configuration> 
    ...  
    <system.web> 
        ...  
        <compilation defaultLanguage="c#" debug="true">  
            <assemblies> 
                ...  
                <add assembly="Telerik.ReportViewer.WebForms, Version=3.0.9.430, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>  
                <add assembly="Telerik.Reporting.Processing, Version=3.0.9.430, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>  
                <add assembly="Telerik.Reporting, Version=3.0.9.430, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>  
                <add assembly="Telerik.Reporting.Interfaces, Version=3.0.9.430, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>  
                <add assembly="Telerik.Reporting.Design, Version=3.0.9.430, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>  
                <add assembly="Telerik.Reporting.HtmlEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>  
                <add assembly="Telerik.ReportViewer.Design, Version=3.0.9.430, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/></assemblies> 
                ...  
        </compilation> 
        ...  
        <httpHandlers> 
            <remove verb="*" path="*.asmx"/>  
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>  
            <add verb="*" path="Telerik.ReportViewer.axd" type = "Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=3.0.9.430, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" /> 
            <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" verb="*" validate="false"/>  
            <add path="Telerik.RadUploadProgressHandler.ashx" verb="*" type="Telerik.Web.UI.RadUploadProgressHandler, Telerik.Web.UI"/>  
            <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/>  
        </httpHandlers> 
        ...  
    </system.web> 
    ...  
</configuration> 
 

Does anyone have a clue or a good guess?

TIA
Markus

13 Answers, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 02 Jul 2009, 03:07 PM
Hi Markus Ruf,

We have never experienced this error before so we will need additional information about your web application and some advices how to reproduce the exception at our end. Unfortuantelly we are not even able to see which method exactly is causing the problem because of the special characters in the names. It will be much appreciated if you open a support ticket and send us all the relevant information in it. Thanks in advance.

Regards,
Chavdar
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Markus
Top achievements
Rank 1
answered on 08 Jul 2009, 01:34 PM
Hi Chavdar

I tried to extract the report part out of the existing Website project.
The report in the new sample project worked.
I checked the differences between the projects and discovered, the main project is a WebSite and the new sample project is a WebApplication.
After converting the main project into a WebApplication, the report shows up without the trailing Exception.
This problem is solved.

Thanks
Markus
0
Fridli Jacober
Top achievements
Rank 1
answered on 22 Jan 2015, 09:08 AM
This last post is very interesting since we too have a similar problem since some time ago with a "website project" and we intentionally chose a website project instead of a web application project so that changes can be made without having to deploy the wohle application's DLL every time.

I'll have to say: For a long time we've used the default "InProc" session state method and I don't remember that we've ever had this problem then (but I can be wrong though). Some time we changed to "StateServer" session storage because among other reasons we noticed "random errors" which seem to come from lost session data and we also noticed that often the session was "broken" and the user had to login again even though the session timeout couldn't be expired yet. But the hope that the session loss problem is fixed with the StateServer method wasn't fulfilled. We still notice this session loss problem and early expired sessions.

Maybe this session loss problem is the reason for this error message...? And maybe this session loss problem doesn't appear if you deploy your whole web application as one DLL instead of uncompiled aspx / aspx.vb files and so on...?

I'm not sure but if I'd have to guess I'd say we didn't have this problem from the beginning when we switched to StateServer session storage. But I can be wrong again and in general I would say this error appears now more often than a year ago.

Unfortunately I didn't ever see this error by myself. I just get exception mails from our application which shows this error sometimes. So since it only appears "randomly" sometimes and I'd say reports are used much less than the application's functionalities itself where this "random" errors appear more often I'd guess it has something to do with this session loss problem.

But now the magical question: Why is this session loss? Unfortunately, for this question I wasn't able to find an answer up to now.
In forums I found different possible reasons. But I couldn't confirm any of them. Especially when using StateServer session storage method many of them don't apply anymore.

So maybe you people here have any idea why this session loss occurs and / or why this NullReference exception occurs...??

P.S. I just saw that the report was generated successfully but the error occured when trying to print as PDF. I got two times the same exception mail within 10 minutes when the user tried to print the report.
So maybe the report was displayed some time and it's really about missing session data...?!? I don't know. The instance ID is different.

- Telerik.ReportViewer.axd?instanceID=22e672aa2edf4110b3b59074a15b81fd&optype=Print&format=PDF&pageIndex=0&rand=1421914040712

- Telerik.ReportViewer.axd?instanceID=27216a646b5444ed8166362fc52cf5e7&optype=Print&format=PDF&pageIndex=0&rand=1421913447321

My exception stack trace:

System.NullReferenceException: Der Objektverweis wurde
nicht auf eine Objektinstanz festgelegt.

   bei
Telerik.Reporting.Processing.AbsolutePositionLayout.ArrangeContent(IMeasureContext
context, SizeRF finalClientSize)

   bei
Telerik.Reporting.Processing.ReportSectionBase.ArrangeContent(IMeasureContext
context, RectangleRF finalClientBounds)

   bei
Telerik.Reporting.Processing.LayoutElement.ArrangeCore(IMeasureContext context,
RectangleRF bounds)

   bei
Telerik.Reporting.Processing.VisualElement.ArrangeCore(IMeasureContext context,
RectangleRF bounds)

   bei
Telerik.Reporting.Processing.ProcessingElement.ArrangeCore(IMeasureContext
context, RectangleRF bounds)

   bei
Telerik.Reporting.Processing.LayoutElement.Arrange(IMeasureContext context,
RectangleRF finalRect)

   bei
Telerik.Reporting.Processing.StackLayout.ArrangeContent(IMeasureContext context,
SizeRF finalClientSize)

   bei
Telerik.Reporting.Processing.Group.ArrangeContent(IMeasureContext context,
RectangleRF finalClientBounds)

   bei
Telerik.Reporting.Processing.LayoutElement.ArrangeCore(IMeasureContext context,
RectangleRF bounds)

   bei Telerik.Reporting.Processing.VisualElement.ArrangeCore(IMeasureContext
context, RectangleRF bounds)

   bei
Telerik.Reporting.Processing.ProcessingElement.ArrangeCore(IMeasureContext
context, RectangleRF bounds)

   bei
Telerik.Reporting.Processing.LayoutElement.Arrange(IMeasureContext context,
RectangleRF finalRect)

   bei
Telerik.Reporting.Processing.StackLayout.ArrangeContent(IMeasureContext
context, SizeRF finalClientSize)

   bei
Telerik.Reporting.Processing.Group.ArrangeContent(IMeasureContext context, RectangleRF
finalClientBounds)

   bei
Telerik.Reporting.Processing.LayoutElement.ArrangeCore(IMeasureContext context,
RectangleRF bounds)

   bei
Telerik.Reporting.Processing.VisualElement.ArrangeCore(IMeasureContext context,
RectangleRF bounds)

   bei Telerik.Reporting.Processing.ProcessingElement.ArrangeCore(IMeasureContext
context, RectangleRF bounds)

   bei
Telerik.Reporting.Processing.LayoutElement.Arrange(IMeasureContext context,
RectangleRF finalRect)

   bei
Telerik.Reporting.Processing.StackLayout.ArrangeContent(IMeasureContext
context, SizeRF finalClientSize)

   bei
Telerik.Reporting.Processing.Report.ArrangeContent(IMeasureContext context,
RectangleRF finalClientBounds)

   bei
Telerik.Reporting.Processing.LayoutElement.ArrangeCore(IMeasureContext context,
RectangleRF bounds)

   bei
Telerik.Reporting.Processing.VisualElement.ArrangeCore(IMeasureContext context,
RectangleRF bounds)

   bei
Telerik.Reporting.Processing.ProcessingElement.ArrangeCore(IMeasureContext
context, RectangleRF bounds)

   bei
Telerik.Reporting.Processing.LayoutElement.Arrange(IMeasureContext context,
RectangleRF finalRect)

   bei
Telerik.Reporting.Paging.PhysicalPageLayout.PhisicalPageMeasurement.MeasureReport(Report
report, IMeasureContext measureContext)

   bei
Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report,
Hashtable renderingContext, Hashtable deviceInfo, CreateStream
createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)

   bei
Telerik.Reporting.Processing.ReportProcessor.CountPages(IList`1 reports,
IRenderingContext renderingContext, Hashtable deviceInfo, ExtensionInfo
extensionInfo, CreateStream createStreamCallback)

   bei
Telerik.Reporting.Processing.ReportProcessor.RenderCore(ExtensionInfo
extensionInfo, IList`1 reports, Hashtable deviceInfo, IRenderingContext
renderingContext, CreateStream createStreamCallback)

   bei
Telerik.ReportViewer.WebForms.ReportExportOperation.RenderReport(String format,
IList`1 processingReports, Hashtable deviceInfo, IRenderingContext
renderingContext)

   bei
Telerik.ReportViewer.WebForms.ReportRenderOperation.PerformOperationOverride()

   bei
Telerik.ReportViewer.WebForms.BasicHandler.ProcessRequest(HttpContext context)

   bei
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

   bei
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
0
Stef
Telerik team
answered on 26 Jan 2015, 03:02 PM
Hi Fridli,

Please test the following:

  • Verify reports cover all rules listed in Design Considerations for Out-proc Session State;
  • Verify you are using separate report instances for viewers and ReportProcessor, if more than one viewer/ReportProcessor is used in page;
  • The ASP.NET ReportViewer uses the ASP.NET Session and Cache objects to store information about the currently displayed report, which are held until the Session expires. Thus verify the ASP.NET Session and Cache are not manually cleared;
  • Check if the browser accepts cookies - Report is unavailable or session has expired error message;
  • On your development machine run the Upgrade Wizard for the reports project and the Web Site. Verify all assemblies are updated, and then deploy all files by erasing the previously deployed files;

Another reason users session to be lost is IIS restart due to changes in the application files as the web.config or Bin folder. My suggestion is to use the error handling approach from the ASP.NET Application Error Handling post.

On a side note, my recommendation is to upgrade your project to the latest available Telerik Reporting version and switch to the HTML5 Report Viewer. The HTML5 viewer is a client-side widget that can be placed in any web application. The viewer is served through a running Reporting REST service and does not rely on the ASP.NET Session and Cache, which can help you to resolve the current problem.



In order to investigate the problem, please send us a demo project including the problematic report, test data and steps to reproduce it.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Fridli Jacober
Top achievements
Rank 1
answered on 17 Feb 2015, 09:19 AM
Hi Stef

Thanks for your reply!

- Design Considerations: I guess it should be fine. We don't use events. We use things like ' Me.TextBox1.Value = "New Value" ' but only in the constructor. Is this ok?
Also, it is not a constant problem on a single report but more a "random problem" independent of which report. So I cannot reproduce it and therefore not send you a demo...

- Separate instances: It is one aspx page with one ASP .NET viewer

- Session: It is not manually cleared. But you say, if the session expires or is lost, such an exception will occur if for example I change the page of the report or try to print it?

- Cookies: Fine - Otherwise the whole application wouldn't work

- Upgrade Wizard: Unfortunately, atm we use the Express edition, so I can't start this wizard. But what it does, we do manually. Otherwise, due to version differences instead of the application an exception message would appear.

- File changes: I already googled for possible reasons of session loss. But none of the listed possibilities seem to apply to our case. But I'll have a further look on this error handling thing. I've already made my thoughts about this.

- HTML5 Report Viewer: As we discussed in another thread, we're working on this but the REST service isn't working on our development machine.
But anyway, we're working on a new machine with Windows Server 2012 and therefore a new IIS and other SW versions (which is the reason, I came not back again to this thread up to now).
So we hope, that this session loss thing and other issues resolve themselves this way and also that the HTML5 viewer then will run without any problems on this new environment.

P.S. For your reference another NullReference exception - without printing:

Telerik.ReportViewer.axd?instanceID=d81ee7f2ca2840f6befff3250bc52623&optype=Report&PageIndex=0&RenderID=8fb4ca7ab70d440182ff837102a3af02&RenderingFormat=HTML5

System.NullReferenceException: Der Objektverweis wurde
nicht auf eine Objektinstanz festgelegt.

   bei
Telerik.ReportViewer.WebForms.ViewerState.get_CurrentPage()

   bei
Telerik.ReportViewer.WebForms.ReportPageOperation.RenderReport(String format,
IList`1 processingReports, Hashtable deviceInfo, IRenderingContext
renderingContext)

   bei
Telerik.ReportViewer.WebForms.ReportRenderOperation.PerformOperationOverride()

   bei
Telerik.ReportViewer.WebForms.BasicHandler.ProcessRequest(HttpContext context)

   bei
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

   bei
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)


So you think this is about lost / expired sessions and will be solved when using the new HTML5 viewer?

Thx & regards
0
Fridli Jacober
Top achievements
Rank 1
answered on 17 Feb 2015, 11:51 AM
P.S. Another one:

System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei Telerik.Reporting.Paging.AbsolutePositionPager.CalculateChildrenVertically(Double parentOffset, Double parentReservedBefore, Double parentReservedAfter)
   bei Telerik.Reporting.Paging.ReportSectionBase.CalculateContent(Orientation orientation)
   bei Telerik.Reporting.Paging.PagingElement.Calculate(Orientation orientation)
   bei Telerik.Reporting.Paging.PageCompositionBase.WritePageSection(PageArea pageArea, PagingElementBase pageSection)
   bei Telerik.Reporting.Paging.PageCompositionBase.OutputPageSections()
   bei Telerik.Reporting.Paging.PageCompositionBase.SendPhysicalPages()
   bei Telerik.Reporting.Paging.PageCompositionBase.OutputPage()
   bei Telerik.Reporting.Paging.PageCompositionBase.CreatePages()
   bei Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
   bei Telerik.Reporting.Processing.ReportProcessor.RenderCore(ExtensionInfo extensionInfo, IList`1 reports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   bei Telerik.ReportViewer.WebForms.ReportExportOperation.RenderReport(String format, IList`1 processingReports, Hashtable deviceInfo, IRenderingContext renderingContext)
   bei Telerik.ReportViewer.WebForms.ReportRenderOperation.PerformOperationOverride()
   bei Telerik.ReportViewer.WebForms.BasicHandler.ProcessRequest(HttpContext context)
   bei System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   bei System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
0
Stef
Telerik team
answered on 17 Feb 2015, 01:23 PM
Hi Fridli,

Based on the exceptions stack traces we cannot determine for sure the source of the problem.

To summarize the suggestions. Test switching to an out-proc session state, verify you are not working with the ASP.NET Session and Cache during the application execution.

Also test using VS2013 community edition to verify your settings - the Report Designer and Upgrade Wizard work in it. Also this will allow you to host in local IIS and configure it as in the test environment. Note that reports should not be placed in a web site project - Solution Structure (Visual Studio).

On a side note, as we discussed the HTML5 Report Viewer does not depend on the ASP.NET Session by design and the error should not occur with it.


If you need further help, please open a support ticket with a demo project that illustrates your settings and reproduces the problem. Without being able to debug and test the application we can only guess the source of the problem.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Fridli Jacober
Top achievements
Rank 1
answered on 13 Apr 2015, 01:19 PM

Hi Stef
Thanks for your response!

"Test switching to an out-proc session state": In fact we are using state server and therefore can not explain why our web application has session loss (already checked possibilities found on google). It's not only about the report viewer, unfortunately.

 "verify you are not working with the ASP.NET Session and Cache during the application execution": Don't understand...

 

VS 2013 / HTML5-viewer: We're setting up a new machine w. Win Srv. 2012 R2 and VS Community 2013 and newest technologies for our web application and html 5 report viewer, hoping this will solve especially the session loss issues and that I get the html 5 viewer running on this machine.
So we'll see how the application and everything will run on this new environment.

 

Regards

0
Fridli Jacober
Top achievements
Rank 1
answered on 13 Apr 2015, 01:24 PM

"Note that reports should not be placed in a web site project"

 Why? But I guess it doesn't subject our case as we created a class library as described and use the reports DLL in the website project...??

0
Stef
Telerik team
answered on 16 Apr 2015, 10:47 AM
Hello Fridli,

On your questions:
  1. verify you are not working with the ASP.NET Session and Cache during the application execution
    The idea is to check if you are not adding and removing variables in/from the ASP.NET Session object, e.g. verify that you are not calling Session.Clear() in code.
    Changes in the applications files will causes also a session lost.
  2. Note that reports should not be placed in a web site project

    Web Site projects have known limitations not allowing the VS Report Designer to function properly. Thus with this type of projects  reports must be referenced from an external library -  Best Practices.

About using the HTML5 viewer, it is the recommended approach to avoid the lost session problem. You can use the VS template to add the viewer quickly in the already existing project. The added by default HTML page can be used as a reference what settings you need to add in your ASPX pages.

Regards,
Stef
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Fridli Jacober
Top achievements
Rank 1
answered on 21 Apr 2015, 10:34 AM

Hello and thanks!

1. We're not tampering with session during the report's execution. We only access a previously set "parameter" session element in some reports which shouldn't be the case here.
2. We've created a library DLL containing all reports which is used in our webapplication. so all is fine.

 But the topic is fine for us at the moment four your side.

First, it's not about the reporting itself but the session loss problem is application wide and second, We'll see how everything will perform in the new environment...

Regards

0
Stef
Telerik team
answered on 23 Apr 2015, 01:19 PM
Hi Fridli,

If you have time to create a demo project isolating the problem with sample report definition, viewer and the specific settings from your application, please open a support ticket to be able to attach and send it to us. This will allow us to test the settings related to the report and the viewer.

Regards,
Stef
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Fridli Jacober
Top achievements
Rank 1
answered on 27 Apr 2015, 03:08 PM

Unfortunately, it is not reproducable as the session loss is some kind of "random" and affects the whole application.

But doesn't matter anymore since the HTML 5 viewer does not rely on session.
And for the application we'll see how it performs on the new system and what we could possibly fix on the other side.

 regards

Tags
General Discussions
Asked by
Markus
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Markus
Top achievements
Rank 1
Fridli Jacober
Top achievements
Rank 1
Stef
Telerik team
Share this question
or