Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / November 2003

Tip: Looking for answers? Try searching our database.

premature end of script headers - jar file?

Thread view: 
jeep@93.usenet.us.com - 03 Nov 2003 04:52 GMT
Hi all-

I know what the definition of a premature end of script header is
in my log file.  What i cant seem to figure out is why it is happening.

I have a policy file setup for my website for a chat script.
This java code worked on a solaris machine and I ported it over to my
RH 9.0 machine.  I have an html file which posts to a perl script
which dynamically builds the .html file for the <applet codebase etc
stuff.  Permissions seem correct on all files, security policy etc,
but I always get:

[Sun Nov 02 20:04:59 2003] [error] [client 192.168.1.1] Premature end of script headers: babylon101.jar
[Sun Nov 02 20:05:01 2003] [error] [client 192.168.1.1] Premature end of script headers: babylon101.jar
[Sun Nov 02 20:05:01 2003] [error] [client 192.168.1.1] Premature end of script headers: babylonApplet.class
[Sun Nov 02 20:05:01 2003] [error] [client 192.168.1.1] Premature end of script headers: babylonApplet.class
[Sun Nov 02 20:05:01 2003] [error] [client 192.168.1.1] script not found or unable to stat: /var/www/mine/cgi-bin/java/babylonApplet
[Sun Nov 02 20:05:01 2003] [error] [client 192.168.1.1] script not found or unable to stat: /var/www/mine/cgi-bin/java/babylonApplet

interestingly enough, each line comes out twice, which is odd to me also.

the files all appear in the correct places from DocumentRoot etc.
Its on loading the .jar file where I get the error.

Any ideas?  Ive scanned the web for a few hours with no luck.

I even tried telnet'ing in on port 80 and doing a GET to see if I
could get the file:

Trying xx.xx.83.15...
Connected to xx.xx.83.15.
Escape character is '^]'.
GET http://secure1.no-ip.com/cgi-bin/java/babylon101.jar HTTP 1.1

HTTP/1.1 500 Internal Server Error
etc etc

with errlog:

[Sun Nov 02 20:49:19 2003] [error] [client 66.237.72.25] Premature end of script headers: babylon101.jar

Thanks,
Jeff
VK - 03 Nov 2003 18:52 GMT
It has nothing to do with Java. In your Perl script you did not put
extra new line character after the header (Perl's Top 10 Error).
Check that the first thing your Perl script says to the world is:
"Content-Type: text/html\n\n"

> Hi all-
>
[quoted text clipped - 11 lines]
> [Sun Nov 02 20:05:01 2003] [error] [client 192.168.1.1] Premature end of script headers: babylon101.jar
> [Sun Nov 02 20:05:01 2003] [error] [client 192.168.1.1] Premature end
of script headers: babylonApplet.class
> [Sun Nov 02 20:05:01 2003] [error] [client 192.168.1.1] Premature end
of script headers: babylonApplet.class
> [Sun Nov 02 20:05:01 2003] [error] [client 192.168.1.1] script not found or unable to stat: /var/www/mine/cgi-bin/java/babylonApplet
> [Sun Nov 02 20:05:01 2003] [error] [client 192.168.1.1] script not found or unable to stat: /var/www/mine/cgi-bin/java/babylonApplet
[quoted text clipped - 23 lines]
> Thanks,
> Jeff
jeep@93.usenet.us.com - 04 Nov 2003 07:33 GMT
> It has nothing to do with Java. In your Perl script you did not put
> extra new line character after the header (Perl's Top 10 Error).
> Check that the first thing your Perl script says to the world is:
> "Content-Type: text/html\n\n"

I already have that:

print "Content-type: text/html\r\n\r\n";

Any other suggestions? :)
VK - 04 Nov 2003 16:59 GMT
not \r\n\r\n

\n\n !

You are in CGI, not in Windows anymore as soon as you print anything to
the Web.

"Premature End Of Script Headers" is a very specific Perl error message.
It means only two options:
1. You did not "Content-Type: text/html\n\n" as the first string of your
script.
2. You did "Content-Type: text/html\n\n" and tried to add more headers
(cookie etc) after that.

Check your HTML-output subs.

Start a new thread if it doesn't help (I will :-)
jeep@93.usenet.us.com - 07 Nov 2003 02:45 GMT
Fixed it.  Turned out I had it under the cgi-bin area instead of outside
the cgi-bin area (apparnetly based on another posting a while back).

Thanks for the suggestions and help anyhow!
Jeff


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.