Operating System - HP-UX
1830477 Members
2357 Online
110005 Solutions
New Discussion

How to transfer tomcat war file from windows to hpux?

 
SOLVED
Go to solution
SeanN_1
Advisor

How to transfer tomcat war file from windows to hpux?

FTP'd a tomcat war file to a HP-UX in Ascii mode and got the following message:

226-WARNING! 32101 bare linefeeds received in ASCII mode
File may not have transferred correctly.
226 Transfer complete.

Separately FTP'd same war file in Binary and success:

200 PORT command successful.
150 Opening BINARY mode data connection for AssetCenterWebService.war.
226 Transfer complete.


On the HP-UX machine I vi'd the file and got errors below (both ascii and binary versions):

# vi AssetCenterWebService.war
File opens with error:
"AssetCenterWebService.war" [Incomplete last line] 32217 lines, 8469751 characters (30878 nulls)

I then proceeded with a dos2ux and attempted to open the new file but still got errors (both ascii and binary versions):

# dos2ux *.war > newfile.war
# vi newfile.war
File opens with error:
"newfile.war" [Incomplete last line] 3 lines, 201 characters (33 nulls)

I attemped to deploy the war file but the war file is unreadable...error in tomcat log below.

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Invalid or unreadable WAR file : reading zip
file central directory failed

So I checked the war file to see if it is valid via unzip -t . The only valid war file is the one ftp in binary mode before the dos2ux is run on it.

So how should I transfer the war file and ensure it is a valid readable file on HP-UX?

5 REPLIES 5
Steven E. Protter
Exalted Contributor
Solution

Re: How to transfer tomcat war file from windows to hpux?

Shalom,

Note that windows FTP client defaults to ascii.

Issue the binary command to transfer files using the windows FTP client for binary files.

Or use SFTP which is smart enough to get this right by itself. Filezilla has a nice client for sftp.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Heironimus
Honored Contributor

Re: How to transfer tomcat war file from windows to hpux?

Since a war file is a binary file, not a text file, you should not try to open it in vi. For the same reason you should always use binary mode if you FTP it around, though I would recommend moving away from FTP altogether.
Steven Schweda
Honored Contributor

Re: How to transfer tomcat war file from windows to hpux?

I know less than I should about JAR, WAR, and
other, similar archive formats, but I gather
that they're basically Zip archives with some
special content among the archived files.

> The only valid war file is the one ftp in
> binary mode before the dos2ux is run on it.

That sounds right to me. Unless you have
some good reason, and I can't imagine what it
would be, you should avoid attacking a valid
Zip (or JAR, or WAR, or ...) archive (which
is not a text file) with text-file tools like
"vi" or "dos2ux".
SeanN_1
Advisor

Re: How to transfer tomcat war file from windows to hpux?

I transfered the file using SFTP so in binary and the unzip -t was successful. Tomcat was able to read the war file.
Thanks for your comments.
SeanN_1
Advisor

Re: How to transfer tomcat war file from windows to hpux?

See previous comment.