We have recently configured SQL SERVER 2005 reporting server and it works when I go to http://<servername>/reportserver. But when I want to access http://<servername>/reports, I am getting the error.
"The request failed with HTTP status 400: Bad Request"
After going through few articles online about how to fix it...
I have tried changing some code in the RSWebApplication.config file.
<UI>
<ReportServerUrl>http://<servername>/reportserver</ReportServerUrl>
<ReportServerVirtualDirectory></ReportServerVirtualDirectory>
<ReportBuilderTrustLevel>FullTrust</ReportBuilderTrustLevel>
</UI>
But it did not work. Can anyone please help? Thanks!
here is the log...
System.Net.WebException: The request failed with HTTP status 400: Bad Request.
at Microsoft.SqlServer.ReportingServices2005.RSConnection.GetSecureMethods()
at Microsoft.ReportingServices.UI.Global.RSWebServiceWrapper.GetSecureMethods()
at Microsoft.SqlServer.ReportingServices2005.RSConnection.IsSecureMethod(String methodname)
at Microsoft.SqlServer.ReportingServices2005.RSConnection.ValidateConnection()
at Microsoft.ReportingServices.UI.Global.SecureAllAPI()
at Microsoft.ReportingServices.UI.ReportingPage.EnsureHttpsLevel(HttpsLevel level)
at Microsoft.ReportingServices.UI.ReportingPage.ReportingPage_Init(Object sender, EventArgs args)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Page.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
w3wp!ui!7!9/8/2011-13:58:39:: e ERROR: Exception in ShowErrorPage: System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm)
at Microsoft.ReportingServices.UI.ReportingPage.ShowErrorPage(String errMsg) at at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm)
at Microsoft.ReportingServices.UI.ReportingPage.ShowErrorPage(String errMsg)
Look like a security issue. Might want to examine this MSDN article there seems to be number of possibilities. Let us know if any of them work.
Related
I have a web application on .NET4 and MVC3 (razor) .
I want to handle my application errors in Global.asax. I have created application_error function.
I have noticed and found some errors.
one of them returns this string in Application_Error when I am trying to add break point on line Response.Clear(); and that error is generic.
how can I find which codes or part of my codes makes it?
my code:
protected void Application_Error()
{
var exception = Server.GetLastError();
var httpException = exception as HttpException;
Response.Clear();
Server.ClearError();
}
error on httpException:
{System.Web.HttpException (0x80004005): File does not exist.
at System.Web.StaticFileHandler.GetFileInfo(String virtualPathWithPathInfo, String
physicalPath, HttpResponse response)
at System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context, String
overrideVirtualPath)
at System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context,
AsyncCallback callback, Object state) at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionSt
ep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)}
i found the solution
string errorLocation = Request.Path;
this syntax in Application_Error() tel you where is the problem :)
Just to state my experience with this exception, in my case the reason was that there was no webpage specified as the start page for the site.
I'm developing database Application in wp7,when i tried to insert a record into database, it throws constraint failed exception.when I'm googling i found that giving not null can cause the exception.so i just removed the not null from the database fields,after that i can able to insert the record successfully,but when i viewed the records, all the records filled with null values only.so i,m not able to perform any database operations.please help me to solve this problems.Here is my stracktrace
at SQLiteClient.SQLiteCommand.ExecuteNonQuery[T](Case toInsert)
at Lawyers_Application.DBHelper.Insert[T](Case obj, String statement)
at Lawyers_Application.MainPage.button1_Click(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
I assume that stacktrace was thrown when you had a null constraint? There's something wrong with the data you're inserting. If a null constraint was initially thrown, it means you were passing null. Now that you've removed the constraint, the database is allowing you to insert null values. There's nothing wrong with the database in this context, but there seems to be something incorrect about the data you're passing.
I have been working on an issue for the past 2 days.I have tried to debug in every way possible but in vain.
Everything works fine on my local.But on production this fails.
Here is a brief description about the problem.
I have a download button and when I click that button I intend to download a file from a server.
protected void Download_Click(object sender, EventArgs e)
{
Button downloadButton = sender as Button;
string filePath = downloadButton.CommandArgument;
string stuid = Session["browse_files_for_student"].ToString();
string stuUsername = MyHelper.GetUsernameForStudentID(stuid);
MyHelper.LogAccess(User.Identity.Name, StudentUsername.Text, filePath, MyHelper.LogAccessType.Read);
FileInfo file = new FileInfo(filePath);
// Download the file
Response.Clear();
Response.AppendHeader("content-disposition", "attachment; filename=" + file.Name);
try
{
Response.TransmitFile(filePath);
}
catch (IOException error)
{
Response.Cookies.Add(new HttpCookie("global_last_error", "The file is in use by another process."));
Response.Redirect("~/Public/KnownError.aspx");
}
Response.End();
}
I see on the Event Viewer that it generates:
TransmitFile failed:FileName:dsdfsfd.doc,Impersonation Enabled:0,Token Valid:1 HRESULT:0x8007052e.
Environment: The website is deployed on a Windows 2000 server.
Any help and comments would be appreciated.
Thank you.
The account under which your application is running (probably IIS pool account) does not have access to the file that you are trying to send. The error code 0x8007052e means:
Error code: (HRESULT) 0x8007052e (2147943726) - Logon failure: unknown user name or bad password.
In the future you can check the error code using for instance cdb command (cdb is a part of the freely available Windows Debugging Tools):
cdb notepad.exe
And then after it has started:
0:000> !error 0x8007052e
Error code: (HRESULT) 0x8007052e (2147943726) - Logon failure: unknown user name or bad password.
Hope it helps :)
I am developping a web application by using the ASP .NET MVC 3 framework.
I have implemented an ASPX page containing a CrystalReportViewer control.
I instantiate a ReportDocument object in my Page_Load event method of my ASPX page.
Then I load a RPT file by using the Load method of my ReportDocument.
My RPT is correctly loaded when I use the VS2010 development web server and I can view it through my viewer.
But the call to the Load method of my ReportDocument raises an exception when I use my IIS 5.1 local web server.
Here are some information about the exception :
Exception Type : CrystalReportsException
Message : Load report failed
StackTrace :
à CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
à CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
à CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
à ASP.aspnetforms_editionresultats_aspx.Page_Load(Object sender, EventArgs e) dans .aspx:ligne 43
à System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
à System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
à System.Web.UI.Control.OnLoad(EventArgs e)
à System.Web.UI.Control.LoadRecursive()
à System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Does someone know why the exception is raised when I use IIS ?
This works for me:
protected void Page_UnLoad(object sender, EventArgs e)
{
this.CrystalReportViewer1.Dispose();
this.CrystalReportViewer1 = null;
// CrystalReportViewer1.Close();
// CrystalReportViewer1.Dispose();
GC.Collect();
}
protected void Button1_Click(object sender, EventArgs e)
{
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load("C:\\inetpub\\wwwroot\\CrystalReportDemo\\CrystalReport.rpt");
CrystalReportViewer1.ReportSource = cryRpt;
CrystalReportViewer1.RefreshReport();
}
}
I faced the same problem and what I did to solve the 'Load Report Failed' problem.
First check whether your report folder exists or .rpt files in your project folder after you publish the asp.net project. I simply placed my whole project folder in the IIS root directory. I am using the my reports in 'Reports' folder that doesn't cause any error.
Then copy C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13” into your project main folder like C:\inetpub\wwwroot\YourProjectFolder\.
Please, comment when this doesn't work.
I'm using the odata client generator (DataSvcUtil.exe) in a Windows Phone 7 application. Retrieving entities and collections is fine as is updating an existing entity. But when I try to add a new entity, I get a NotSupportedException. Here's my code.
private void Button_Click(object sender, RoutedEventArgs e)
{
Drinks d =new Drink();
d.BarCode = "1234567890";
d.Description = "Test Drink";
d.Quantity = -1;
context.AddToDrinks(d);
context.BeginSaveChanges(SaveChangesOptions.Batch, OnChangesSaved, context);
}
private void OnChangesSaved(IAsyncResult result)
{
Dispatcher.BeginInvoke(() =>
{
try
{
var something = result.AsyncState;
context = result.AsyncState as DrinkTrackerModelContainer;
// Complete the save changes operation and display the response.
ShowSaveResponse("Drink Logged!", context.EndSaveChanges(result));
}
catch (DataServiceRequestException ex)
{
ShowSaveResponse("Error Logging Drink", ex.Response);
}
catch (InvalidOperationException ex)
{
ShowSaveResponse(ex.Message, null);
}
}
);
}
As soon as EndSaveChanges is called, I get the
NotSupportedException.
EDIT: I used fiddler and saw that I was in fact getting a different exception from the service. That exception data was not being shown in the debugger. Once I corrected the actual exception, the insert worked fine.
I think you have first chance exceptions turned on which is causing an internal exception thrown by the client library to surface as an exception. Try turning off First Chance Exceptions in the "Exceptions" menu in VS and running the app.
As you mentioned in your edit, the NotSupportedException was a red herring. I think that when debugging a phone app you will hit the NotSupportedException even if you have cleared the setting to break on unhandled CLR exceptions.
If you continue(F5), you'll hit an actual DataServiceRequestException exception. If it doesn't have enough information to debug it, you can follow the steps in this post to get more detailed information in the exception: http://blogs.msdn.com/b/phaniraj/archive/2008/06/18/debugging-ado-net-data-services.aspx
I ran into the same problem yesterday, and after following the steps in the blog I was able to successfully debug the problem.