473,545 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

server application aspnet_wp.exe stopped unexpectedly unavailable

hi,

I'm having an absolute nightmare with this!

I've seen many posts on the subject but still can't quite figure it
out.

I'm using csharp and Framework 1.1.4322.537 on Windows2000 Professional
5.00.2195 Service Pack 4

I click a hyperlink which takes me to an aspx page with a document ID
in the request string. The aspx page checks if there is a doc_id in the
request string. If there is, it looks at a Session variable DataView to
find the location of the document based on the doc_id (don't want users
to see actual location).

Once it has this info, it puts that into another Session Variable and
does a Response.Redire ct to the same aspx page but with a user-friendly
request string i.e document=docume ntType.document Name

On reentry, the page sees this request string, finds the location from
the session variable and uses the following code to serve the PDF file:
if(impersonateV alidUser("user" , "domain", "password") )
{
Response.ClearC ontent();
Response.ClearH eaders();
Response.Conten tType="applicat ion/pdf";
Response.WriteF ile(pdfFile);
Response.Flush( );
Response.Close( );
undoImpersonati on();
}
else
{
}
return;

using the standard MS implementation of impersonation found here:
http://support.microsoft.com/default...b;en-us;306158
EXCEPT that I am not doing it in Page_Load.

Code for Page_Load is:
//uses doc_id to identify which document from the dataset is required.
string objectName;
string objectType;
if (Request.QueryS tring["doc_id"] != null)
{
string docId = Request.QuerySt ring["doc_id"];
System.Data.Dat aView documents =
(System.Data.Da taView)Session["documents"];

if (documents == null)
throw new Exception("You must navigate via the Document Viewer and
select a document first.");
documents.RowFi lter="doc_id="+ docId;
//check that there is a document
if (documents.Coun t==1)
{
objectName = documents[0].Row["object_nam e"].ToString();
objectType = documents[0].Row["r_object_t ype"].ToString();
pdfFile = (string)Session["pdfLocatio n"] +
documents[0].Row["DOCUrl"].ToString();
ArrayList pdfArray = new ArrayList();
pdfArray.Add(pd fFile);
pdfArray.Add(do cId);
pdfArray.Add(ob jectName);
pdfArray.Add(ob jectType);
Session["pdfArray"] = pdfArray;
string newURL = HttpContext.Cur rent.Request.Pa th + "?object=" +
objectType + "." + objectName;
Response.Redire ct(newURL);
return;
}
else
{
throw new Exception("Ther e is no such document id in the
current dataset.");
}
}
else
{
if (Session["pdfArray"] != null && Request.QuerySt ring["object"] !=
null)
{
if (((ArrayList)Se ssion["pdfArray"]).Count == 4)
{
pdfFile = (string)((Array List)Session["pdfArray"])[0];
objectName = (string)((Array List)Session["pdfArray"])[2];
objectType = (string)((Array List)Session["pdfArray"])[3];
string[] objRequest =
Request.QuerySt ring["object"].Split(".".ToCh arArray());
if (objRequest.Len gth == 2)
{
if (objRequest[0] != objectType || objRequest[1] != objectName)
throw new Exception("This is not a valid document.");
}
else
throw new Exception("This is not a valid document.");
ServePDF();
return;
}
else
{
throw new Exception("This is not a valid document.");
}
}
else
{
throw new Exception("This is not a valid document.");
}
}

string pdfFile is a class variable.

Now, this code works fine for 3 of my documents which are under 200kb
but the one that is 3822KB fails with the error message Server
Application Unavailable and the event log says aspnet_wp.exe stopped
unexpectedly.

The machine.config is set to use SYSTEM (though with Framework 1.1 I
don't think this should be necessary, and indeed it may not be - have
now tested "machine" and that seems to work the same). The httpRuntime
MaxRequestLengt h in machine.config was 4096 and since this was close I
upped it to 8192 but that didn't fix it. This setting is not overridden
in the web.config file.

What may give the game away (but not to me!) is that the Page_Load is
triggerred 3 times instead of the 2 I was expecting. Once with the
doc_id, then after the Redirect but then a third time??? Presumably
something to do with the Response.Flush or Response.Close. ..

Can anyone help me? Even more frustrating is that I actually had this
big file working occasionally yesterday though it would randomly cause
this error message. However, after my tinkering it always produces the
error now :o( (only for the large file).

thanks
Phil

Nov 19 '05 #1
4 1396
i should say I have also tried without impersonation (having set the
directory permissions appropriately, though my final application will
need to use impersonation or delegation - that's a whole different
question!).

Even without impersonation I still get the same problem.

Phil

Nov 19 '05 #2
can someone at least tell me why Page_Load is being triggerred 3 times
in this example?

I really can't figure out why the failure is so random...

Nov 19 '05 #3

ph*****@2bytes. co.uk wrote:
can someone at least tell me why Page_Load is being triggerred 3 times in this example?

I really can't figure out why the failure is so random...

That's a bug. Install .net framework 1.1 sp1. this would help.

Nov 19 '05 #4
by the way, for anyone else having this problem, it turned out to be
the size of the file at 3822KB. I ended up having to read it in chunks
and outputting it with flush before reading the next chunk. I used
500000 byte chunks and it seems to work fine. There may be an
alternative solution but this is what I ended up doing.

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1413
by: warlord | last post by:
I have a Crystal report that I'm calling from a website - the report executes and then exports to a PDF, and then the PDF is then shown in a new browser window. It runs fine the first time, but any subsequent attempt fails at the point of exporting to PDF and the server eventually times out with a "Server Application Unavailable" message. ...
0
1395
by: Umair Ahmed | last post by:
Hi, I m developing a web application on Win2k platform and deploying the application on Win2k platform. I didnt get any error on the development machine but when i deployed to any machine on wch only .NET framework 1.o is installed it gives the following error Server Application Unavailable The web application you are attempting to...
4
1247
by: Dave Diehl | last post by:
Has anyone heard of a problem with a rebuild of one application causing a problem with another app on the same server? I have two asp.net applications on the same Win2000 server, each with it's own web site (i.e. IP, root folder, etc.). Each accesses it's own SQL Server 2000 database. Let's call them App A and App B. If I open a page in...
2
2470
by: Erik Lindeblom | last post by:
I can suddenly no longer browse any of my ASP.net web services. The browser returns: Server Application Unavailable and tells me to look at the Application Event Log for more details. I have searched around the net and newsgroups and found several references to this problem. However, none have any conclusive fixes. I don't have any...
0
274
by: RT | last post by:
I am getting the following message when I try to access the asp.dotnet pages of our website. "Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message...
0
1883
by: bruce | last post by:
ASP.NET app running for about a year with no problem and suddenly this week it's giving error message. The same as the one decribed by another user. Even stranger is that we only have this problem from some web clients (desktop browser, IE) , some other people do not have problems at all from theirs desktop. Also, some clients can access...
1
4948
by: Paul Wasowicz | last post by:
Configuration: Windows 2000 Server SP4 ..Net Framework 1.1 SP1 Microsoft Site Server 3.0 Problem: the following error messages start showing up in the EVENT LOG on the server every once in a while until server becomes un-usable and has to be rebooted; users see in the browser Server Application Unavailable message; this seems to happen...
17
5073
by: Jon B | last post by:
Hi All! I have a ASP.NET 2.0 site that works on the Windows 2000 Server. However, when I tried to view this site on my local Windows XP machine, I get "Server Unavailable". If I switch the Windows XP IIS back to ASP.NET 1.1 then I get the Configuration Error (which is understandable because I'm trying to run an ASP.NET 2 site with 1.1...
17
4861
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
I have set up a virtual directory using IIS. Whenever, I load a web page of type .htm, I have no problem. Whenever I run a .aspx page I get the statement below. I am running on XP Pro, both Microsoft .Net 1.1 & 2.0 installed. How do I remedy this error? //Error below Server Application Unavailable The web application you are attempting...
0
7486
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7416
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7676
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7932
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6001
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4965
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3473
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1905
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.