JDK-4682202 : deployment of ecperf.ear fails on linux
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 7.0se,5.0u7,7
  • Priority: P4
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: linux,solaris_8,windows_xp
  • CPU: x86,sparc
  • Submitted: 2002-05-09
  • Updated: 2020-10-03
  • Resolved: 2015-11-11
Related Reports
Duplicate :  
Relates :  
Description
the ecperf.ear deployment fails on linux with the following error:


java.util.zip.ZipException: invalid entry compressed size (expected 26301 but got 25793 bytes)
 	at java.util.zi.ZipOutputStream.closeEntry(ZipOutputStream.java:193)
 	at java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:289)
 	at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:134)
 	at java.util.zip.ZipOutputStream.close(ZipOutputStream.java:310)
 	at com.iplanet.ias.deployment.ClientJarArchivist.createClientJar(ClientJarArchivist.java:63)
 	at com.iplanet.ias.deployment.backend.AppDeployer.createClientJar(AppDeployer.java:287)
 	at com.iplanet.ias.deployment.backend.AppDeployer.deployOrReDeployApp(AppDeployer.java:247)
 	at com.iplanet.ias.deployment.backend.AppDeployer.doRequest(AppDeployer.java:64)
 	at com.iplanet.ias.admin.server.core.mbean.config.ManagedServerInstance.deployJ2EEApplication(ManagedServerInstance.java:341)
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 	at java.lang.reflect.Method.invoke(Method.java:324)
 	at com.iplanet.ias.admin.server.core.jmx.Introspector.invokeMethodOn(Introspector.java:188)
 	at com.iplanet.ias.admin.server.core.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:179)
 	at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.callInvoke(AdminAPIEntryServlet.java:172)
 	at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.callMBean(AdminAPIEntryServlet.java:130)
 	at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.doGet(AdminAPIEntryServlet.java:84)
 	at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.doPost(AdminAPIEntryServlet.java:67)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
 	at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:98)
 	at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:176)
 	at java.security.AccessController.doPrivileged(Native Method)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:172)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
 	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:577)
 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:478)
 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
 	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:577)
 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:478)
 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
 	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:577)
 	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
 	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:575)
 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
 	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:575)
 	at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:368)
 	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:575)
 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:478)
 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 	at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:93)
 	at com.iplanet.ias.web.WebContainer.service(WebContainer.java:455)
 com.iplanet.ias.deployment.backend.IASDeploymentException: Deployment Failed -- rolled back deployment -- invalid entry compressed size (expected 26301 but got 25793 bytes)
 	at com.iplanet.ias.deployment.backend.AppDeployer.deployOrReDeployApp(AppDeployer.java:264)
 	at com.iplanet.ias.deployment.backend.AppDeployer.doRequest(AppDeployer.java:64)
 	at com.iplanet.ias.admin.server.core.mbean.config.ManagedServerInstance.deployJ2EEApplication(ManagedServerInstance.java:341)
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 	at java.lang.reflect.Method.invoke(Method.java:324)
 	at com.iplanet.ias.admin.server.core.jmx.Introspector.invokeMethodOn(Introspector.java:188)
 	at com.iplanet.ias.admin.server.core.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:179)
 	at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.callInvoke(AdminAPIEntryServlet.java:172)
 	at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.callMBean(AdminAPIEntryServlet.java:130)
 	at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.doGet(AdminAPIEntryServlet.java:84)
 	at com.iplanet.ias.admin.server.core.servlet.AdminAPIEntryServlet.doPost(AdminAPIEntryServlet.java:67)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
 	at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:98)
 	at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:176)
 	at java.security.AccessController.doPrivileged(Native Method)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:172)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
 	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:577)
 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:478)
 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
 	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:577)
 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:478)
 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
 	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:577)
 	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
 	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:575)
 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
 	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:575)
 	at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:368)
 	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:575)
 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:478)
 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 	at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:93)
 	at com.iplanet.ias.web.WebContainer.service(WebContainer.java:455)
 Caused by: java.util.zip.ZipException: invalid entry compressed size (expected 26301 but got 25793 bytes)
 	at java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:193)
 	at java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:289)
 	at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:134)
 	at java.util.zip.ZipOutputStream.close(ZipOutputStream.java:310)
 	at com.iplanet.ias.deployment.ClientJarArchivist.createClientJar(ClientJarArchivist.java:63)
 	at com.iplanet.ias.deployment.backend.AppDeployer.createClientJar(AppDeployer.java:287)
 	at com.iplanet.ias.deployment.backend.AppDeployer.deployOrReDeployApp(AppDeployer.java:247)



-----


Upon debugging the code, we found the problem to originate from ClientJarArchivist.java during creation of the clientjar file.

Essentially the ClientJarArchivist copies all the .class entries from individual jar files and packages them into one Clientjar file. This problem is seen only when using ecperf.ear. We have tried deploying DukesBankApplication.ear and that deploys properly along with creation of the stubs and client jar file.

The following are some of the combinations we have tried:
1. use a new JDK (1.4.0_01) - same error
2. Deploy DukesBank - no error
3. Deploy different version of ecperf.ear - same error (the expected and returned bytes are different)
4. increase file descriptors to 30000 and limits to umlimited - same error
5. Have Server1 instance running - no change to the error

However the same ecperf deploys on RI with JDK 1.4 - no error
Also, when ClientJarArchivist.java is passed two files and called directly instead of from the appserver, it works with ecperf.ear!! This leads us to deduce that the iAs code isn't a problem but there is some peoblem that occured when ClientJarArchivist is called when appserver is executing.. maybe a JVM problem or a resource crunch is causing this?? it would be helpful if someone has a look at this.

Thu Jun 13 04:02:17 MDT 2002	sm119578

Comments
EVALUATION It's arguable if this is really a "bug" from zos point of view. If you start a new entry in zos with a "zos.putNextEntry(ze);", it's reasonable to assume the info stored in that particular "ze" is "accurate" if it does have a "meanful" value (means not "-1") and the zos implementation to use this info to valide the result.
15-11-2010

WORK AROUND I have taken a look at the source code of com.iplanet.ias.deployment.ClientJarArchivist There is a three line fix which needs to be implemented: private static void addJarEntry(JarFile jar, ZipEntry entry, ZipOutputStream zos) throws IOException { // assumes entry size is never zero try { InputStream in = jar.getInputStream(entry); // old -version: zos.putNextEntry( new ZipEntry(entry) ); // new version: ZipEntry tmpEntry = new ZipEntry(entry); // new line 1 tmpEntry.setCompressedSize(-1); // new line 2 zos.putNextEntry(tmpEntry); // new line 3 ............ The reason why it failed before, is that when one trasfers a ZipEntry from one zip file to another using a combination of get/putNextEntry and read/write ZipInput/OutputStream, the compressed size may change, since the original zip file is not garanteed to have the same compression level as the default compression level of ZipOutputStream. If one takes ZipEntry instance from the input zipfile, then it is dirty in a sence, that it has csize (compressed size) field equal to the compressed size in the original zipfile. After ZipOutputStream is done writing the entry, it checks the compressed size and finds a discrepancy, which is reported as ZipException. When you call setCompressedSize(-1) you tell to ZipOutputStream that you do not yet know the compressed size of the ZipEntry. In Mantis we will fix this problem, but for now iPlanet folks should probably implement the workaround mentioned above. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The workaround works and the deployment proceeds properly. However why doesn't this appear on solaris.. is the default value somehow not gettign set?? ###@###.### 20020612 Thu Jun 13 04:02:17 MDT 2002 sm119578
11-06-2004

EVALUATION It looks like the problem is in the code uses zos.putNextEntry(zis.getNextEntry() idiom. We have a bug in this which has to be fixed. Right now the workaround is to use ZipEntry ze = new ZipEntry(zis.getNextEntry().getName()) zos.putNextEntry(ze); ###@###.### 2002-06-10
10-06-2002