File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSP getting downloaded Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP getting downloaded" Watch "JSP getting downloaded" New topic
Author

JSP getting downloaded

sreenivas arumilli
Greenhorn

Joined: Jun 09, 2011
Posts: 12
Hi All,

I am not sure whether I pick up the right category to raise this ticket.

My problem is some times JSP getting downloaded instead of loading. When i check the downloaded JSP it contains full of junk data(like ascii values). TO resolve this we are restarting the web server for couple of times.

It's not happening every time but happening interpretively.

Can someone guide me where I need to look into it.

Sreenivas A
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

Sounds like a problem with your web/app server itself. Since you didn't mention what that is, I can only say that first have a look at the web site of your server (i.e. for tomcat go to tomcat.apache.org) and look for any known issues for the specific version you're using. Maybe upgrading will fix it, or there may be other known workarounds.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

Is the content-type set correctly? Browsers usually use the response's content-type to determine what to do with it. "text/plain" will be shown as plain text, "text/html" as an HTML page, etc.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
sreenivas arumilli
Greenhorn

Joined: Jun 09, 2011
Posts: 12
Thanks for your reply..

Koen :I am using Apache/2.2.3- webserver,jboss-4.2.3.GA-application servers

Rob: content type i set was "text/html" only. the following content was showing in downloaded file.


GQÎ"0…žj®Ð”³ õ¥Ð<åãŠwÙ#tJdGQÎ"0…žj®Ð”³ õ¥Ð<åãŠwÙ#tJd


Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

sreenivas arumilli wrote:Koen :I am using Apache/2.2.3- webserver,jboss-4.2.3.GA-application servers

What mod_jk version are you using? I remember having some weird issues in the past that were solved by downloading, compiling and deploying the latest version of mod_jk (tomcat/http connector): http://tomcat.apache.org/connectors-doc/
sreenivas arumilli
Greenhorn

Joined: Jun 09, 2011
Posts: 12
Hi,

We are connecting through mod_proxy_ajp.

Sreenivas A
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

It looks like somewhere, binary data is outputted. Since you created only HTML pages (right?), that means that the problem must be found somewhere else. The mod_proxy plugin would be my first guess. Do you get the same problem when servicing the same requests directly from Tomcat (i.e. using port 8080)?
sreenivas arumilli
Greenhorn

Joined: Jun 09, 2011
Posts: 12
Thanks for your response...

We are unable to replicate this by connecting application server directly(as you said from 8080).From this we can confirm that our application server providing the correct response.

So some where in webserver is converting this to binary data..

can you help me out here please.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Binary data? So you don't mean that the JSP is being sent to the browser unprocessed, but that the browser is receiving garbage data? Is any of it recognizable?

I'd advise using an HTTP monitoring tool so that, when this happens, you can see what the response body and response headers are. This could hold valuable clues to what's transpiring.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sreenivas arumilli
Greenhorn

Joined: Jun 09, 2011
Posts: 12
Hi ,

I checked this and found that in headerTransfer-Encoding is chucked(during this issue). For normal scenario it's value showing the size. Is this would the issue?

How can see the response of jboss is there any parameter I can turn on?

Or else any parameter I can turn on in webserver level to see all the responses?


Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

sreenivas arumilli wrote:I checked this and found that in header Transfer-Encoding is chucked(during this issue). For normal scenario it's value showing the size. Is this would the issue?

It shouldn't but perhaps this scenario might be hitting a bug in mod_proxy_ajp or the http server itself.
sreenivas arumilli
Greenhorn

Joined: Jun 09, 2011
Posts: 12
How can I find the bug in apache module..Is there anyway to debug this.

Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

Check their bug list or try a newer/older version and see if it fixes the problem.
sreenivas arumilli
Greenhorn

Joined: Jun 09, 2011
Posts: 12
Where can I find the buglist?

I googled it but haven't got relevant information.

sreenivas arumilli
Greenhorn

Joined: Jun 09, 2011
Posts: 12
We observed JSP download is not happening in 2.2.22.

But the problem is we are RHEL5 only supporting upto 2.2.3 version. so no RPM's for 2.2.22.

We tried to compile the HTTPD source and it keep on telling some dependencies problem.

Is there any way to install without compiling source code?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP getting downloaded
 
Similar Threads
Websphere 4.0 and j2sdkee1.3.1 support
50 million foxes!
jsp not displaying the changes
Can't play Rules Roundup
Null Pointer ...