yahaosoft / apjp

Automatically exported from code.google.com/p/apjp
0 stars 0 forks source link

错误原因: ROOT.war 使用非ZIP的压缩格式 #96

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Would you like to deploy from the current directory? [Yn]:
Zip end of central directory signature not found
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_central_director
rb:97:in `get_e_o_c_d'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_central_director
rb:55:in `read_e_o_c_d'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_central_director
rb:85:in `read_from_stream'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_file.rb:67:in `b
ck in initialize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_file.rb:66:in `o
n'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_file.rb:66:in `i
tialize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_file.rb:87:in `n
'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_file.rb:87:in `o
n'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rubyzip-0.9.9/lib/zip/zip_file.rb:131:in `
reach'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/zip_util.rb:29:in `entr
lines'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/frameworks.rb:139:in `d
ect_framework_from_war'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/frameworks.rb:77:in `bl
k in detect'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/frameworks.rb:66:in `ch
r'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/frameworks.rb:66:in `de
ct'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/manifest_helper.rb:190:
 `detect_framework'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/manifest_helper.rb:90:i
`configure_app'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/manifest_helper.rb:64:i
`interact'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/commands/apps.rb:900:in
do_push'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/commands/apps.rb:308:in
push'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/runner.rb:465:in `run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/lib/cli/runner.rb:14:in `run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/vmc-0.3.21/bin/vmc:5:in `<top (required)>'
C:/Ruby193/bin/vmc:23:in `load'
C:/Ruby193/bin/vmc:23:in `<main>'

Original issue reported on code.google.com by saml...@gmail.com on 15 Oct 2012 at 2:11

GoogleCodeExporter commented 9 years ago
1.问题原因: "Zip end of central directory signature not found"

2. Google所得详细描述: "Either this file is not a zipfile, or it 
constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on the last 
disk(s) of this archive." from 
http://askubuntu.com/questions/54904/unzip-error-end-of-central-directory-signat
ure-not-found

抱歉,直译不怎么好,我意译一下哈: 
"要么这个文件不是ZIP的,要么就是这个文件是有多个部分组�
��的。" 后一句没什么对解决你的问题没什么作用。

3. 
于是,我就大概可以猜到你可能是哪里出现问题的。只是可��
�哦。

可能是你修改APJP_REMOTE.properties后,不是使用zip的压缩算法压�
��成ROOT.war的。

4. 解决方法: https://code.google.com/p/apjp/wiki/InstallGuideOnCloudFoundry 
这篇关于"编辑APJP_REMOTE.properties文件"的部分写得不是很详细��
�可参考 
https://code.google.com/p/apjp/wiki/InstallGuideOnOpenShift#%E7%BC%96%E8%BE%91AP
JP_REMOTE.properties%E6%96%87%E4%BB%B6 
只是"编辑APJP_REMOTE.properties文件"这个段落的就好,其他的可��
�看。

5. 以防万一有些地方你可能不明白,或者说Windows 
STUPID的默认: 
"隐藏已知文件类型的扩展"。建议去掉复选项,隐藏的话,只
会增加不必要的安全隐患的。如何做,参照此图: 
http://clip2net.com/clip/m96404/1350389649-clip-63kb.png

6. 
之前就有人因为Windows这个STUPID的默认,出现问题的,参考: 
https://code.google.com/p/apjp/issues/detail?id=86

7. 
你的提问所给的信息过少,我目前只能找到这一个导致你的��
�题的原因的,及潜在的解决方法。若能解决,请告知一声。�
��不能的话,请再详细点问题的描述!

Original comment by goknmuse on 16 Oct 2012 at 12:22

GoogleCodeExporter commented 9 years ago
唉. 
既然已经知道你的潜在问题原因,于是我就自己做个小测试��
�看能否出现和你一样的错误。

1. 下载APJP_REMOTE_JAVA*.zip 
,解压。里面包含一个ROOT.war文件,再解压ROOT.war文件,解压�
��文件夹META-INF 和 
WEB-INF,及文件index.html。编辑WEB-INF/APJP_REMOTE.properties后,再重
新将文件夹META-INF和WEB-INF,及index.html压缩为7z格式,得ROOT.7z�
��重命名ROOT.7z 为 ROOT.war。

2. 见附件。

总结,war文件实质上就是zip文件的,只是不同的后缀的。可��
�文件先压缩为zip格式,再重命名为war的。

Solved.

Original comment by goknmuse on 18 Oct 2012 at 4:54

Attachments:

GoogleCodeExporter commented 9 years ago
One shortcut on using cmd. :P

http://clip2net.com/clip/m96404/1350536917-clip-48kb.png

Original comment by goknmuse on 18 Oct 2012 at 5:10

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by goknmuse on 30 Oct 2012 at 11:19

GoogleCodeExporter commented 9 years ago

Original comment by goknmuse on 30 Oct 2012 at 12:46