12 Replies Latest reply on Apr 30, 2007 8:21 AM by rajeshchande

    java.util.zip.ZipException

    pat270881

      Hello,

      I use jboss with eclipse and myeclipse. I develop a j2ee struts web application. I start JBoss not from eclipse but outside from eclipse. Then I deploy my web application and look at my application in the browser, this works fine. But when I add some functions to my application or change something I have to redeploy my web application. The problem is that I can only redeploy my application when I stop the Jboss, redeploy it and start the Jboss again, because other the following error occurs

      12:47:27,937 WARN [WebappClassLoader] Failed to open JAR
      java.util.zip.ZipException: Das System kann die angegebene Datei nicht finden
      at java.util.zip.ZipFile.open(Native Method)
      at java.util.zip.ZipFile.(ZipFile.java:204)
      at java.util.jar.JarFile.(JarFile.java:132)
      at java.util.jar.JarFile.(JarFile.java:97)
      at org.apache.catalina.loader.WebappClassLoader.openJARs(WebappClassLoader.java:1544)
      at org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1763)
      at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1570)
      at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:850)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1299)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
      at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:207)
      at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:231)
      at org.apache.struts.action.ActionServlet.getRequestProcessor(ActionServlet.java:860)
      at org.apache.struts.action.ActionServlet.destroyModules(ActionServlet.java:725)
      at org.apache.struts.action.ActionServlet.destroy(ActionServlet.java:430)
      at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1316)
      at org.apache.catalina.core.StandardWrapper.stop(StandardWrapper.java:1651)
      at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:892)
      at org.apache.catalina.core.StandardContext.removeChild(StandardContext.java:3035)
      at org.apache.catalina.startup.ContextConfig.stop(ContextConfig.java:1083)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:271)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4265)
      at org.apache.catalina.core.ContainerBase.destroy(ContainerBase.java:1131)
      at org.apache.catalina.core.StandardContext.destroy(StandardContext.java:4358)
      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:585)
      at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
      at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.web.tomcat.tc5.TomcatDeployer.performUndeployInternal(TomcatDeployer.java:421)
      at org.jboss.web.tomcat.tc5.TomcatDeployer.performUndeploy(TomcatDeployer.java:392)
      at org.jboss.web.AbstractWebDeployer.stop(AbstractWebDeployer.java:404)
      at org.jboss.web.WebModule.stopModule(WebModule.java:85)
      at org.jboss.web.WebModule.stopService(WebModule.java:51)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStop(ServiceMBeanSupport.java:300)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:232)
      at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
      at $Proxy0.stop(Unknown Source)
      at org.jboss.system.ServiceController.stop(ServiceController.java:519)
      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:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy45.stop(Unknown Source)
      at org.jboss.web.AbstractWebContainer.stop(AbstractWebContainer.java:432)
      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:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy46.stop(Unknown Source)
      at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:640)
      at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:613)
      at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:608)
      at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:581)
      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:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy6.undeploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.undeploy(URLDeploymentScanner.java:349)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:483)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)

      Can I do anything to avoid this????:( - because it is very exhausting to start and stop the jboss after every deployment and/or for every deployment.

      Kind regards

      pat

        • 1. Re: java.util.zip.ZipException
          pat270881



          Has nobody an idea, how I can solve this problem?:(

          regards

          • 2. Re: java.util.zip.ZipException
            pat270881



            I don't understand it, has nobody recognized this problem before???

            • 3. Re: java.util.zip.ZipException
              peterj

              You problem might be similar to what was mentioned in this post: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=71732

              • 4. Re: java.util.zip.ZipException
                pat270881



                Thank you for your reply but I do not understand exaclty the solution which is quoted in the posting.

                Can you explain me that in an easier way?:(

                regards

                • 5. Re: java.util.zip.ZipException
                  peterj

                  When you copy a WAR or EAR file to the deploy directory, if the file is fairly large and takes a while to copy, it could be that JBoss attempts to hot-deploy the new file befoe it is fully copied. This could result in the error message that you are seeing.

                  So the solution is to copy the WAR/EAR file to a temporary directory on the same disk as JBoss, and then to move the WAR/EAR file to the JBoss deploy directory (with possibly removing the existing EAR/WAR file first).

                  An alternate solution is to change the hot deploy scan time. Change the value for "ScanPeriod" for the "URLDeploymentScanner" in the jboss-service.xml file. Of course, you could still occasionally end up with JBoss scanning the deploy directory at the same time that your EAR/WAR is being copied.

                  • 6. Re: java.util.zip.ZipException
                    pat270881



                    Mhmm...the thing is that I deploy my web applications directly from eclipse and the war-files and/or war-directories(exploded) will be automatically copied to the deploy directory of the jboss.

                    should I then use the solution with changing the hot deploy scan time? - What do I have exaclty to do to change the scan time and which value I should use to fix my problem?

                    kind regards

                    • 7. Re: java.util.zip.ZipException
                      peterj

                      Um, I already told you which value to change, and which file that value is in. Did you look at the file, and the current value, and the comment that explains the value?

                      • 8. Re: java.util.zip.ZipException
                        pat270881

                        Hello,

                        okay I tried to raise the scan period from 5000 to 10000 milliseconds and I also tried it with setting the ScanEnabled to false, but I still get the same error. In my deployment-window in eclipse the error message looks as follows when I try to redeploy my web application AssetRatioCheck while the jboss
                        is running:

                        Undeployment failure on JBoss 4. File
                        C:\Programs\jboss-4.0.3\server\default\deploy\AssetRatioCheck.war\WEB-INF\lib\struts.jar
                        unable to be deleted. If a is locked, you can wait until the lock times out to
                        redeploy or stop the server and redeploy or manually move the deployment at C:\Programme\jboss-4.0.3\server\default\deploy\AssetRatioCheck.war

                        //the manual movement does also not work.

                        Has anybody further tipps for me how I can solve this problem???

                        regards

                        • 9. Re: java.util.zip.ZipException
                          peterj

                          Actually, you are now getting a different error than before. The error in your first post was from JBoss when it attempted to hot-deploy your app. The error you just now posted came from Eclipse as it had problems copying the struts.jar file because it is in use.

                          My guess is that as a side-effect of turning off hot-deploy that JBoss keeps all of the files, including struts.jar, open, and thus the files are in use, hence the error message. (I think that when you use hot-deploy, JBoss copies the jar and other files to the server/xxx/tmp directory and uses the files there to run your app. This way the files in the deploy directory are never "in use" and can be easily overwritten.)

                          How long does it take Eclipse to copy your app?

                          • 10. Re: java.util.zip.ZipException
                            pat270881



                            It takes a short time. I have found something in the myeclipse forum, because I use the myeclipse ide with jboss.

                            http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-4596.html

                            What do you think about it? - I also think that the error occurs because the struts.jar file is stil locked after the deployment. the thing is how could i workaround that problem?

                            regards

                            • 11. Re: java.util.zip.ZipException
                              peterj

                              The MyEclipse forum post sounds like the same problem you are having. I'm not sure what you could do to work around it. Sorry I could not have been of more help.

                              • 12. Re: java.util.zip.ZipException

                                Hello,

                                May be thats too late for you, but I think will help others.

                                I faced similar situation. My guess was that the Jars in WEB-INF/lib were creating a conflict with the jars loaded by Jboss instance from server/lib directory.

                                You can try removing the unwanted jars from WEB-INF/lib that are already present in JBoss lib directory.

                                Regards