WHY? java.util.zip.ZipException: error in opening zip file

i'm trying to restart tomcat 4.1 (bin/startup.bat) and getting the following error (windows xp profession machine)
code:
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:112)
at java.util.jar.JarFile.<init>(JarFile.java:127)
at java.util.jar.JarFile.<init>(JarFile.java:65)
at org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(StandardClassLoader.java:1082)
at org.apache.catalina.loader.StandardClassLoader.<init>(StandardClassLoader.java:200)
at org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:202)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:140)
Bootstrap: Class loader creation threw exception
java.lang.IllegalArgumentException: addRepositoryInternal: java.util.zip.ZipException: error in opening zip file
     at org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(StandardClassLoader.java:1110)
     at org.apache.catalina.loader.StandardClassLoader.<init>(StandardClassLoader.java:200)
     at org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:202)
     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:140)
thanks!

These exceptions occur when opening JAR files (since they are renamed ZIPs). Most likely the file cannot be ffound because you have classpaths setup incorrectly

Similar Messages

  • IOException java.util.zip.ZipException: error in opening zip file

    Hi Folks,
    In my application one Zip file will be placed in the server. to unzip that zip file i have used java.util.Zip.
    It is working fine.but some times it gets the following error.
    **IOException java.util.zip.ZipException: error in opening zip file**
    why is it so? but very rarely. I couldnt identify the exact scenario, where it causes the problem.
    Normally that zip file contains set of images of customer.
    Please share your inputs.
    Thanks,
    Balu.

    Thanks for ur reply.
    EJB is not used in my application.
    VC++ application at customer side prepares the zip file, and it will upload that zip to te server using ftp.
    After uploading done, at the server end one java program(contains main function) will access that folder to unzip.
    Thanks,
    Balu.

  • Java.util.zip.ZipException error in opening zip file

    Hello all,
    We are using Sun Java System web server 6.1 SP2. When I tried to deploy an application, I received this message: "Posted content length of --- exceeds limit of --- " the -dashes are the size of the file actually.
    I then added an init-param to the web.xml specifying the maximum size.
    After doing that, I tried to deploy the war file using administration interface, but received a network tcp/ip error. I then deployed it using command line wdeploy command. It worked but the web server won't start up after the deployment. The following error messages are found in the log file. Any thoughts as to whats wrong here? Is there a bug in SP2?
    [22/Sep/2006:17:30:44] finer ( 5668): ContextConfig[search]: URI='/search', ResourcePath='/WEB-INF/sun-web-search.tld' [22/Sep/2006:17:30:44] finer ( 5668): ContextConfig[search]:
    tldConfigJar(/WEB-INF/sun-web-search.tld): java.util.zip.ZipException: error in opening zip file
    [22/Sep/2006:17:30:44] finer ( 5668): ContextConfig[search]: URI='/jstl-fmt', ResourcePath='/WEB-INF/fmt.tld' [22/Sep/2006:17:30:44] finer ( 5668): ContextConfig[search]: tldConfigJar(/WEB-INF/fmt.tld): java.util.zip.ZipException: error in opening zip file
    [22/Sep/2006:17:30:48] failure ( 5668): CORE4007: Internal error: Unexpected Java exception thrown (java.lang.NoClassDefFoundError: org/xml/sax/ext/Attributes2, org/xml/sax/ext/Attributes2), stack: java.lang.NoClassDefFoundError: org/xml/sax/ext/Attributes2 at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:537) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1717) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:983) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1431) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1301) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at org.apache.xerces.parsers.AbstractSAXParser.<init>(Unknown Source) at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source) at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source) at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source) at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:274) at org.apache.catalina.startup.ContextConfig.defaultConfig(ContextConfig.java:882) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1004) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:257) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3752) at com.iplanet.ias.web.WebModule.start(WebModule.java:257) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133) at org.apache.catalina.core.StandardHost.start(StandardHost.java:652) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355) at org.apache.catalina.startup.Embedded.start(Embedded.java:995) at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431) at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500) at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161) [22/Sep/2006:17:30:48] failure ( 5668): CORE3186: Failed to set configuration

    ooks like you are running into bug: 4719677
    When you deploy a web application using the Administration Server from a
    remote machine, the maximum upload size by default is 10 MB. This can be
    changed by editing the
    install-root/bin/https/webapps/instance-app/WEB-INF/web.xml file. In the
    servlet webappdeploy, insert an init param named maxUploadSize with a
    value in bytes specifying the maximum upload size. Example:
    <init-param>
    <param-name>maxUploadSize</param-name>
    <param-value>90000000</param-value>
    </init-param>

  • Java.util.zip.ZipException: error in opening zip file Deploment Error

    Hi All,
    I am getting the fallowing Deployment exception while i am trying to deploy my webdynpro DC. Kindly help me if anybody know the solution for it.
    deployment aborted : file:/C:/DOCUME1/291123/LOCALS1/Temp/temp7081pg.comiprscipr~dc_intreg_process.ear
    Aborted: development component 'ipr/scipr/dc_intreg_process'/'pg.com'/'GGD_EPREGDEV_D'/'20101220152524'/'0':Caught exception during application deployment from SAP J2EE Engine's deploy service:java.rmi.RemoteException: Error while getting the internal libraries of application pg.com/iprsciprdc_intreg_process in operation update.. Reason: error in opening zip file; nested exception is:      java.util.zip.ZipException: error in opening zip file (message ID: com.sap.sdm.serverext.servertype.i
    Thanks,
    Mahesh Nuli.

    Hello Ram,
    It is saying that the library file is missing. Can you deploy pg.com/iprsciprdc_intreg_process  first and try to deploy this ear temp7081pg.comiprscipr~dc_intreg_process.ear.
    Regards
    Nizamudeen SM

  • Webb Exception - java.util.zip.ZipException: error in opening zip file

              I am tring to run my Servlet with myWAR.war. So I started first installing the CookieCounter example that came with weblogic, I did exactly as the document said but I getting the following exception:
              Thu Jan 04 11:26:45 MST 2001:<E> <HTTP> Error reading Web application '/weblogic/myserver/cookieWar.war'
              java.util.zip.ZipException: error in opening zip file
              at java.util.zip.ZipFile.open(Native Method)
              at java.util.zip.ZipFile.<init>(ZipFile.java:69)
              at weblogic.utils.jar.JarFile.<init>(JarFile.java:57)
              at weblogic.utils.jar.JarFile.<init>(JarFile.java:44)
              at weblogic.t3.srvr.HttpServer.loadWARContext(HttpServer.java:582)
              at weblogic.t3.srvr.HttpServer.initServletContexts(HttpServer.java, Compiled Code)
              at weblogic.t3.srvr.HttpServer.start(HttpServer.java:388)
              at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java, Compiled Code)
              at weblogic.t3.srvr.T3Srvr.main(T3Srvr.java:827)
              at java.lang.reflect.Method.invoke(Native Method)
              at weblogic.Server.startServerDynamically(Server.java:99)
              at weblogic.Server.main(Server.java:65)
              at weblogic.Server.main(Server.java:55)
              at weblogic.NTServiceHelper.run(NTServiceHelper.java:19)
              at java.lang.Thread.run(Thread.java:479)
              Has anybody encountered the problem before I created the jar using jar cvf cookieWar.war cookie- under the command line
              

    I have seen problems like this in the past. When you create your war file, try using "jar
              cv0f" so that the jar file won't be compressed...
              mark bouchard wrote:
              > I am having this same error... the strange thing is i have two different ear files...
              > one of them works, the other doesn't. there are NO differences between them according
              > to Araxis Merge... both will deploy, and both show servlets as being registered,
              > but i can only call the servlets from one...
              >
              > what is BEA's suggested way of creating an ear file? on NT and on UNIX please....
              >
              > use the java.util.zip methods? or use a utility like jar or winzip? Personally,
              > i've found this deployment to be HIGHLY flakey at best.... my same ear files
              > deploy perfectly with iPlanet's app server.
              >
              > Mark Spotswood <[email protected]> wrote:
              > >I think this is basically the same as a file not found error.
              > >The error message says it can't open the file. Its looking
              > >for the file under: /weblogic/myserver/cookieWar.war
              > >Make sure the file is in that directory/readable, etc.
              > >--
              > >mark
              > >
              > >Paul Garduno wrote:
              > >
              > >> Just to let you know, I am getting the same error message. I haven't
              > >worked on it but hope to at some point. I would like to know if the
              > >Weblogic people have seen this error.
              > >>
              > >> Paul Garduno
              > >>
              > >> bionic99 wrote:
              > >>
              > >> > I am tring to run my Servlet with myWAR.war. So I started first installing
              > >the CookieCounter example that came with weblogic, I did exactly as
              > >the document said but I getting the following exception:
              > >> > Thu Jan 04 11:26:45 MST 2001:<E> <HTTP> Error reading Web application
              > >'/weblogic/myserver/cookieWar.war'
              > >> > java.util.zip.ZipException: error in opening zip file
              > >> > at java.util.zip.ZipFile.open(Native Method)
              > >> > at java.util.zip.ZipFile.<init>(ZipFile.java:69)
              > >> > at weblogic.utils.jar.JarFile.<init>(JarFile.java:57)
              > >> > at weblogic.utils.jar.JarFile.<init>(JarFile.java:44)
              > >> > at weblogic.t3.srvr.HttpServer.loadWARContext(HttpServer.java:582)
              > >> > at weblogic.t3.srvr.HttpServer.initServletContexts(HttpServer.java,
              > >Compiled Code)
              > >> > at weblogic.t3.srvr.HttpServer.start(HttpServer.java:388)
              > >> > at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java, Compiled Code)
              > >> > at weblogic.t3.srvr.T3Srvr.main(T3Srvr.java:827)
              > >> > at java.lang.reflect.Method.invoke(Native Method)
              > >> > at weblogic.Server.startServerDynamically(Server.java:99)
              > >> > at weblogic.Server.main(Server.java:65)
              > >> > at weblogic.Server.main(Server.java:55)
              > >> > at weblogic.NTServiceHelper.run(NTServiceHelper.java:19)
              > >> > at java.lang.Thread.run(Thread.java:479)
              > >> >
              > >> > Has anybody encountered the problem before I created the jar using
              > >jar cvf cookieWar.war cookie- under the command line
              > >
              

  • OC4J startup failed: java.util.zip.ZipException: error in opening zip file

    I am getting the following error. Can someone help me on how to fix this issue?
    Thanks
    E:\oracle\product\oas\10.1.3.1\j2ee\home>java -jar oc4j.jar
    OC4J startup failed
    org.xml.sax.SAXException: META-INF/boot.xml in E:\oracle\product\oas\10.1.3.1\j2
    ee\home\oc4j.jar, line 466: Could not process 'external-classes' for /E:/oracle/
    product/oas/10.1.3.1/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META
    -INF/boot.xml in E:\oracle\product\oas\10.1.3.1\j2ee\home\oc4j.jar): caught java
    .util.zip.ZipException: error in opening zip file.
    at oracle.classloader.util.XMLConfiguration.fail(XMLConfiguration.java:1
    279)
    at oracle.classloader.util.XMLConfiguration.registerExternalsFromPackage
    Names(XMLConfiguration.java:833)
    at oracle.classloader.util.XMLConfiguration.registerExternalsForPostProc
    essing(XMLConfiguration.java:842)
    at oracle.classloader.util.XMLConfiguration.endElement(XMLConfiguration.
    java:716)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endEleme
    nt(AbstractSAXParser.java:633)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
    l.scanEndElement(XMLDocumentFragmentScannerImpl.java:1241)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
    l$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
    l.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
    ML11Configuration.java:834)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
    ML11Configuration.java:764)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
    java:148)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
    stractSAXParser.java:1242)
    at oracle.classloader.util.XMLConfiguration.configureLoaders(XMLConfigur
    ation.java:277)
    at oracle.classloader.util.InitialLoadersFactory.populateLoaders(Initial
    LoadersFactory.java:389)
    at oracle.classloader.util.InitialLoadersFactory.initLoaders(InitialLoad
    ersFactory.java:230)
    at oracle.classloader.util.InitialLoadersFactory.create(InitialLoadersFa
    ctory.java:167)
    at oracle.oc4j.loader.boot.BootStrap.main(BootStrap.java:26)

    Sorry for the delay, i can't attach it so i'll just post it
    User:
    Logname: root
    Monday February 23 14:29:15 GMT 2009
    smpatch settings:
    smpatch analyze:
    Entitlement:
    Sun UC patch revision:
    112945-03
    Solaris release:
    Solaris 9 s9_58shwpl3 SPARC
    Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.
    Use is subject to license terms.
    Assembled 15 April 2002
    Solaris Kernel: Generic_112233-05
    Machine Type: sun4u
    Platform: SUNW,Sun-Fire
    Java -version:
    Unrecognized option: -version:1.5+
    Could not create the Java virtual machine.
    Software Cluster:
    CLUSTER=SUNWCXall
    All ccr properties:
    Sun UC package status:
    SUNWbreg not installed
    SUNWccccr not installed
    SUNWccccrr not installed
    SUNWccsign not installed
    SUNWcsmauth not installed
    SUNWppro-plugin-sunos-base not installed
    SUNWppror not installed
    SUNWpprou not installed
    SUNWupdatemgrr not installed
    SUNWupdatemgru not installed

  • Re: RE: Re: Webb Exception - java.util.zip.ZipException: error in opening zip

    Instead of uploading the servlet via the WL Console, try FTPing it into the
              applications directory and starting up WL
              "robert wright" <[email protected]> wrote in message
              news:3b96bd64$[email protected]..
              > I am having this problem as well has anyone found a solution?
              

    I have the same problem using FTP and hotdeploy, when i try to upload the application, half of the times it fails with the "error in opening zip file
              at java.util.zip.ZipFile.open(Native Method)
              at java.util.zip.ZipFile.<init>(Unknown Source)"
              I dont know why it happens, it seemed that was needed more space, but now, it has enough space for everything in everywhere...
              Has anybody another idea?
              

  • ZipException : error in opening zip file

    Hello,
    I need to create a zip file using Java. I have to zip content from a directory (sub-folders included). So I'm using a recursive method.
    In fact my zip file is well created, when I open it with winrar, winzip, everything is ok, same thing with a bash on linux (unzip).
    My problem is that I have to open the created zip file in Java. When I do it, i get an exception:
    java.util.zip.ZipException: error in opening zip file
            at java.util.zip.ZipFile.open(Native Method)
            at java.util.zip.ZipFile.<init>(ZipFile.java:203)
            at java.util.zip.ZipFile.<init>(ZipFile.java:234)
            ...This is my method:
    public void zipContent()
           ZipOutputStream zipout;
            try
                zipout = new ZipOutputStream("destination zip file");
                zipDir("main source directory", zipout, "");
                zipout.close();
            catch (FileNotFoundException e)
                e.printStackTrace();
            catch (IOException e)
                e.printStackTrace();
        private void zipDir(String source, ZipOutputStream zipout, String relativeDir) throws IOException
            File zipDir = new File(source);
            String[] dirList = zipDir.list();
            byte[] readBuffer = new byte[2156];
            int bytesIn = 0;
            // Loop through dirList, and zip the files.
            for (int i = 0; i < dirList.length; i++)
                File f = new File(zipDir, dirList);
    if (f.isDirectory())
    // If the File object is a directory, call this
    // function again to add its content recursively.
    String filePath = f.getPath();
    String name = f.getName();
    if (!name.endsWith("/")) name += "/";
    zipEntries.put(name, name);
    if (relativeDir.equals(""))
    ZipEntry anEntry;
    anEntry = new ZipEntry(name);
    zipout.putNextEntry(anEntry);
    zipout.closeEntry();
    zipDir(filePath, zipout, name);
    else
    ZipEntry anEntry;
    if (!relativeDir.endsWith("/"))
    relativeDir += "/";
    anEntry = new ZipEntry(relativeDir + name);
    zipout.putNextEntry(anEntry);
    zipDir(filePath, zipout, relativeDir + name);
    // Loop again.s
    continue;
    // Create a FileInputStream on top of f.
    FileInputStream fis = new FileInputStream(f);
    ZipEntry anEntry;
    if ((!relativeDir.endsWith("/")) && (!relativeDir.equals("")))
    relativeDir += "/";
    if (!relativeDir.equals(""))
    anEntry = new ZipEntry(relativeDir + f.getName());
    else
    anEntry = new ZipEntry(f.getName());
    // Place the zip entry in the ZipOutputStream object.
    zipout.putNextEntry(anEntry);
    zipEntries.put(anEntry.getName(), anEntry.getName());
    // Now write the content of the file to the ZipOutputStream.
    while ((bytesIn = fis.read(readBuffer)) != -1)
    zipout.write(readBuffer, 0, bytesIn);
    // Close the Stream.
    zipout.closeEntry();
    fis.close();
    This the code I use to unzip:
            try
                ZipFile zip = new ZipFile(zipFile);
                Enumeration zipEnum = zip.entries();
                zipEnum = zip.entries();
                while (zipEnum.hasMoreElements())
                    ZipEntry item = (ZipEntry) zipEnum.nextElement();
                    // Directory case.
                    if (item.isDirectory())
                        File newdir = new File(unzippedFilesDir + "/" + item.getName());
                        newdir.mkdir();
                    // File case.
                    else
                        String newfile = unzippedFilesDir + "/" + item.getName();
                        InputStream is = zip.getInputStream(item);
                        FileOutputStream fos = new FileOutputStream(newfile);
                        int ch;
                        while ((ch = is.read()) != -1)
                            fos.write(ch);
                        is.close();
                        fos.close();
                zip.close();
            catch (Exception e)
                System.out.println(e);
                e.printStackTrace();
            }The exception is thrown on the line:
    ZipFile zip = new ZipFile(zipFile);Do you see something weird in my code..?
    I'm working on this problem for several days, and I'm losing hope...
    Thanks,
    Phil

    This looks wierd:
    ZipFile zip = new ZipFile(zipFile);
    Enumeration zipEnum = zip.entries();
    zipEnum = zip.entries();

  • Java.util.zip.ZipException: error in opening

    i ahve problem unzipping some zip file
    any one help me
    the zip file is name PRICE.ZIP and content is PRICE.TXT
    Please help
    code
                   //zf will contain the actual zip file object
                   System.out.println("FILE TO UNZIP"+SERVER_DIRECTORY+zipfilename);
                   ZipFile zf = new ZipFile(SERVER_DIRECTORY+zipfilename);
                   //enumeration will contain the list of files in the zip archive
                   Enumeration enumeration = zf.entries();
                   while (enumeration.hasMoreElements())
                        //zipentry will contain the actual files in the zip archive
                        ZipEntry zipentry = (ZipEntry)enumeration.nextElement();
                        InputStream ins = zf.getInputStream(zipentry);
                        //System.out.println(SERVER_DIRECTORY+zipentry.getName());
                        File outFile = new File(SERVER_DIRECTORY+zipentry.getName());
                        FileOutputStream fos = new FileOutputStream(outFile);
                        byte[] neo = new byte[14096];
                        //loop through reading the zipped file entry and
                        // write it to the external file
                        while ((spice = ins.read(neo, 0, 14096)) > -1)
                             fos.write(neo, 0, spice);
                        ins.close();
                        fos.close();
              }

    Your code looks right on. Problem has to be in the two variables (String, one presumes) that hold directory and name. To isolate the problem, use those two as soon as they are created to open a FileInputStream. Bet that will fail and lead you to the solution. Probably:
    using a relative dir that's not valid: here/there/ (try /root/here/there)
    or using the wrong slash direction (for'd for Unix, backr'd for Wintel)

  • Java.util.zip.ZipException error when building

    Good Day All,
    I am a newbie and this is my first JWS deployment. I have an app that I am writing in Netbeans 6.1 that I want to deploy via JWS. The app accesses five different JAR libraries and that is where my troubles started. I thought that I needed to figure a way to configure Netbeans so the libraries would be deployed with my app JAR so it would run correctly using JWS.
    I was trying to get things working and now my problem is that when I build I am getting the following error:
    init:
    deps-jar:
    compile:
    Copy libraries to C:\Java\DataMed\dist\lib.
    To run this application from the command line without Ant, try:
    java -jar "C:\Java\DataMed\dist\DataMed.jar"
    jnlp:
    jnlp-init-generate-master:
    C:\Java\DataMed\nbproject\jnlp-impl.xml:61:  The following error occurred while executing this line:
    C:Java\DataMed\nbproject\jnlp-impl.xml:386:  java.util.zip.ZipException:  error in opening zip file
    BUILD FAILED (total time: 0seconds)Scrolling to line 386 in the jnlp-impl.xml file it says:
    componentsprop="jnlp.components">I futzed with my options so much I can't seem to figure out how to get everything reset so I can get a clean build ! As a newbie to Netbeans I sometimes have difficulty figuring out where all the different things are hidden ... I **think** it all went bad when I was working on the Properties > Libraries > Compile > Compile-time Libraries but I can't remember.
    So I have two questions really:
    1) How can I resolve the ZipException error? I suspect it is one of the JAR libraries but how can I tell ?
    2) How do I get JWS to find my five libraries ? I now suspect that I am supposed to upload the five libraries to the webserver and then in my JNLP it will have links to the libraries in the <resources> part of the code. Is that correct ?
    Edited by: DBirdManAR on Aug 10, 2008 7:22 AM
    Rather than spend to much time figuring this out, I just used my revert modifications through my SVN to go back to a previous version that builds correctly.

    Hi,
    I have the same problem but I cannot solve it.
    Help much appreciated.
    Regards,

  • Weblogic EAR deployment - "error in opening zip file"

    Dear All,
    we build EAR using MAVEN 3.0.4 on Unix and are trying to deploy the application. The weblogic version is 10.3.4.
    We get the following error.
    <Mar 12, 2012 5:31:41 PM CET> <Error> <HTTP> <BEA-101220> <Error occurred while setting document root for "ServletContext@1306153[app:sma-1 module:afis/sma path:/afis/sma spec-version:2.5]" to "/AFIS_DOMAIN/AFIS/servers/production/tmp/_WL_user/sma-1/bmzpi3/sma.web-1.1.0.war".>
    <Mar 12, 2012 5:31:42 PM CET> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1331569832008' for task '13'. Error is: 'weblogic.application.ModuleException: Failed to load webapp: 'afis/sma''
    weblogic.application.ModuleException: Failed to load webapp: 'afis/sma'
    at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:393)
    at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    Truncated. see log file for complete stacktrace
    Caused By: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:114)
    at java.util.zip.ZipFile.<init>(ZipFile.java:131)
    at weblogic.utils.classloaders.ZipClassFinder.<init>(ZipClassFinder.java:23)
    at weblogic.servlet.internal.ArchivedWar$WebInfClassesFinder.<init>(ArchivedWar.java:298)
    Truncated. see log file for complete stacktrace
    >
    Obviously, the WAR file cannot be opened by Weblogic, but why and how to solve it ... have no clue. We went through almost everything in Internet, regarding this issue, but we couldn't find a solution.
    Every idea or suggestion is more than welcome because I'm running out of ideas :(

    Did you perhaps do something like FTP the EAR file to the RedHat box in text mode or something? Can you check that the file size of the file on RedHat is the same as it was on Windows?

  • J2ee Log is filled all time with  "error in opening zip file"

    Hi,
    When I check the J2ee log in NWA, there is a lot of messages
    " java.util.zip.ZipException: error in opening zip file", all time!.
    any idea???
    thanks in advance.
    Detail:
      error 2008-11-11 20:44:12:544 java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:111)... [see details]
    /System/Server com.sapmarkets.bam.jmxadapter.AbstractLog sap.com/tcwddispwda server-epdesa Server 0 0_36836
       error 2008-11-11 20:44:12:404 java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:111)... [see details]
    /System/Server com.sapmarkets.bam.jmxadapter.AbstractLog sap.com/tcwddispwda server-epdesa Server 0 0_36836
       error 2008-11-11 20:44:12:404 java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:111)... [see details]
    /System/Server com.sapmarkets.bam.jmxadapter.AbstractLog sap.com/tcwddispwda server-epdesa Server 0 0_36836
       error 2008-11-11 20:44:12:404 java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:111)... [see details]

    Hi Guys -
    I am facing a similar issue while trying to run a VC model. I am using BAPI_SALESORDER_GETLIST with two input fields and some output columns.
    The problem here is that when I check the output using this BAPI on the backend system (ABAP), I can see the output. However, with VC it always generated a log in defaultTrace file with the following content;
    #1.5 #001E0BC934680032000001D300001A500004633307D8A2D2#1234970732710#com.sapmarkets.bam.jmxadapter.AbstractLog##com.sapmarkets.bam.jmxadapter.AbstractLog#Administrator#57787##n/a##61c79e80fdd011ddcf25001e0bc93468#SAPEngine_Application_Thread[impl:3]_7##0#0#Error#1#/System/Server#Plain###java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
         at java.util.zip.ZipFile.<init>(ZipFile.java:111)
         at java.util.zip.ZipFile.<init>(ZipFile.java:127)
         at com.sapmarkets.bam.jmxadapter.AbstractLog.getArchiveInfo(AbstractLog.java:328)
         at com.sapmarkets.bam.jmxadapter.AbstractLog.getArchives(AbstractLog.java:454)
         at com.sapmarkets.bam.jmxadapter.AbstractLog.getArchives(AbstractLog.java:477)
         at sun.reflect.GeneratedMethodAccessor905.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.getAttribute(DefaultMBeanInvoker.java:129)
         at javax.management.StandardMBean.getAttribute(StandardMBean.java:229)
         at com.sap.pj.jmx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:1296)
         at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.getAttribute(MBeanServerWrapperInterceptor.java:181)
         at com.sap.engine.services.jmx.CompletionInterceptor.getAttribute(CompletionInterceptor.java:309)
         at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.getAttribute(BasicMBeanServerInterceptor.java:169)
         at com.sap.jmx.provider.ProviderInterceptor.getAttribute(ProviderInterceptor.java:195)
         at com.sap.engine.services.jmx.RedirectInterceptor.getAttribute(RedirectInterceptor.java:232)
         at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.getAttribute(MBeanServerInterceptorChain.java:124)
         at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.getAttribute(MBeanServerSecurityWrapper.java:234)
         at com.sap.engine.services.jmx.ClusterInterceptor.getAttribute(ClusterInterceptor.java:522)
         at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.getAttribute(MBeanServerInterceptorChain.java:124)
         at com.sapmarkets.bam.logcontroller.jmx.LogControllerFacade.getLogInfo(LogControllerFacade.java:227)
         at com.sapmarkets.bam.logcontroller.jmx.LogControllerFacade.getLogInfosWithPattern(LogControllerFacade.java:193)
         at com.sapmarkets.bam.logcontroller.jmx.LogControllerFacade.getLogInfos(LogControllerFacade.java:174)
         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.sap.pj.jmx.introspect.DefaultMBeanInvoker.getAttribute(DefaultMBeanInvoker.java:129)
         at javax.management.StandardMBean.getAttribute(StandardMBean.java:229)
         at com.sap.pj.jmx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:1296)
         at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.getAttribute(MBeanServerWrapperInterceptor.java:181)
         at com.sap.engine.services.jmx.CompletionInterceptor.getAttribute(CompletionInterceptor.java:309)
         at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.getAttribute(BasicMBeanServerInterceptor.java:169)
         at com.sap.jmx.provider.ProviderInterceptor.getAttribute(ProviderInterceptor.java:195)
         at com.sap.engine.services.jmx.RedirectInterceptor.getAttribute(RedirectInterceptor.java:232)
         at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.getAttribute(MBeanServerInterceptorChain.java:124)
         at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.getAttribute(MBeanServerSecurityWrapper.java:234)
         at com.sap.engine.services.jmx.ClusterInterceptor.getAttribute(ClusterInterceptor.java:522)
         at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.getAttribute(MBeanServerInterceptorChain.java:124)
         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.sapmarkets.bam.jmx.connector.AbstractLVServer.invoke(AbstractLVServer.java:183)
         at sun.reflect.GeneratedMethodAccessor470.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.services.rmi_p4.P4DynamicSkeleton.dispatch(P4DynamicSkeleton.java:161)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:319)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:200)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    An error was returned from the back-end system: [V4213] No data found
    Do you have a clue as to why this is happening?
    Kind Regards,
    Raza.

  • Error in opening zip file after Patch 4 HF6 install

    Hello,
    Just upgraded to EP 6 SP 2 Patch 4 HF 6 on a Windows 2000/MSSQL instance.  In the cluster\server\managers\console_logs the error.log now contains the following;
    error during parse of jar file D:\usr\sap\XXXA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.sap.portal.runtime.admin.LoggingConsole\private\lib\com.sap.portal.runtime.admin.LoggingConsolecore.jar
    java.util.zip.ZipException: error in opening zip file.
    I also receive this error message for several other .jar files we've deployed.
    Any ideas what steps need to be taken to correct this message?
    Regards,
    John

    Here is a list of our .zip errors we see.  Two of these files are not 0-byte in length, they have been identified by a size at the end of the file.
    Also, I am checking on the LoggingConsole.  I'll post something when I have an answer.
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.LoggingConsole\lib\com.kcc.yy.kc.LoggingConsoleapi.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.LoggingConsole\private\lib\com.kcc.yy.kc.LoggingConsolecore.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.sap.pct.crm.kcdam.crmkmconvkc\lib\com.sap.pct.crm.kcdam.crmkmconvkcapi.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.sap.pct.crm.kcdam.crmkmconvkc\private\lib\com.sap.pct.crm.kcdam.crmkmconvkccore.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.sap.pct.crm.kcdam.crmdamkc\lib\com.sap.pct.crm.kcdam.crmdamkcapi.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.sap.pct.crm.kcdam.crmdamkc\private\lib\com.sap.pct.crm.kcdam.crmdamkccore.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.sap.portal.runtime.admin.LoggingConsole\lib\com.sap.portal.runtime.admin.LoggingConsoleapi.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.sap.portal.runtime.admin.LoggingConsole\private\lib\com.sap.portal.runtime.admin.LoggingConsolecore.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    Portal initialization done.
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.PortalMonitor\private\lib\com.kcc.yy.kc.PortalMonitorcore.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.atKCDesk.MastHead\lib\com.kcc.yy.kc.atKCDesk.MastHeadapi.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.atKCDesk.MastHead\exlib\com.kcc.yy.kc.atKC.MastHeadapi.jar - 1kb
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.atKCDesk.MastHead\exlib\com.sap.portal.navigation.mastheadapi.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.atKCDesk.MastHead\private\lib\com.kcc.yy.kc.atKCDesk.MastHeadcore.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.atKCDesk.MastHead\private\exlib\com.kcc.yy.kc.atKC.MastHeadcore.jar - 5kb
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.atKCDesk.ToolArea\lib\com.kcc.yy.kc.atKCDesk.ToolAreaapi.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.atKCDesk.ToolArea\private\lib\com.kcc.yy.kc.atKCDesk.ToolAreacore.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.atKC.pagesensitivity\lib\com.kcc.yy.kc.atKC.pagesensitivityapi.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.atKC.pagesensitivity\private\lib\com.kcc.yy.kc.atKC.pagesensitivitycore.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.atKC.layouts\lib\com.kcc.yy.kc.atKC.layoutsapi.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.atKC.layouts\private\lib\com.kcc.yy.kc.atKC.layoutscore.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.mk.kc.bb\private\lib\com.kcc.mk.kc.bbcore.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    [email protected]5c #
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.atKC.Logon\lib\com.kcc.yy.kc.atKC.Logonapi.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.atKC.Logon\private\lib\com.kcc.yy.kc.atKC.Logoncore.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.kcc.yy.kc.systemviewer\private\lib\com.kcc.yy.kc.systemviewercore.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)
    [email protected]3e #
    error during parse of jar file D:\usr\sap\DGPA\j2ee\j2ee_00\cluster\server\services\servlet_jsp\work\jspTemp\irj\root\WEB-INF\portal\portalapps\com.sap.pct.crm.debug.SOAPTest\lib\Jcatestapi.jar
    java.util.zip.ZipException: error in opening zip file
         at java.util.zip.ZipFile.open(Native Method)

  • Error in opening zip file

    i'm trying to download a zip file through my java program and extract a .dbf file from the downloaded file.
    i'm getting java.util.zip.ZipException: error in opening zip file at:
    ZipFile zf=new ZipFile("c:\\tomcat\\webapps\\project\\PR.zip");
    can anyone tell me what the problem is?
    ========================================================================
    import java.io.*;
    import java.net.*;
    import java.sql.*;
    import java.util.*;
    import java.util.zip.*;
    public class BhavMod
    public static void main(String arr[])
    System.out.println("Downloading file PR.ZIP from location http://nseindia.com/content/equities/PR.zip...");
         try
              URL u = new URL("http://nseindia.com/content/equities/PR.zip");
              InputStream ip = u.openStream();
              int af;
              byte b[] = new byte[256];
         File fp = new File("c:\\tomcat\\webapps\\project\\PR.zip");
              FileOutputStream fos = new FileOutputStream(fp);
              af=1;
              for(int i=0;af>0;i++)
                   af=ip.read(b);
                   if(af>0) {
                        fos.write(b);     
                        System.out.print(".");
              ip.close();
              fos.close();
    System.out.println("\n\nDownloaded file PR.Zip to location c:\\tomcat\\webapps\\project\\PR.zip");
    catch(Exception e3)
    System.out.println("<b>DOWNLOAD FAILED.</b><BR>");
    System.out.println(e3);
         try{
              System.out.println("entered");
         ZipFile zf=new ZipFile("c:\\tomcat\\webapps\\project\\PR.zip");
              System.out.println("opened");
         Enumeration e=zf.entries();
         System.out.println("connected"+zf.size());
         ZipEntry a=new ZipEntry("dbasefile");
         while(e.hasMoreElements())
              a=(ZipEntry)e.nextElement();
         if(a.getName().startsWith("pr"))
         InputStream is=zf.getInputStream(a);
         int nw;
         File f=new File("c:\\tomcat\\webapps\\project\\bhav.dbf");
         FileOutputStream os=new FileOutputStream(f);
         while(is.available()>0)
         nw=is.read();
         os.write(nw);
    System.out.println(a);
              zf.close();
    }catch(Exception e2)
    System.out.println(e2);
    try{
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              String DBUrl = "jdbc:mysql:///portdb";
              Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection cn=DriverManager.getConnection("jdbc:odbc:dbf");
    Statement st=cn.createStatement();
    ResultSet rs=st.executeQuery("select * from bhav WHERE MKT='Y' OR MKT='y' OR MKT='N' or MKT='n'");
    String str=new String();
    Connection cndb=DriverManager.getConnection(DBUrl);
              System.out.println("Connected!!!");
    Statement stdb=cndb.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    int rsdb=stdb.executeUpdate("delete from script");
    System.out.println("UPDATED RATES...\n\nScript-----------------------------------Price");
    while(rs.next())
    str=rs.getString("SECURITY");
    str=str.replace('\'','_');
              str=str.trim();
    str=str.replace(' ','_');
              // to remove blank spaces from script id
              String s1=new String(str);
              StringBuffer s2=new StringBuffer(s1);
              int f;
              while((s1.indexOf(' '))!=-1)
                   f=s1.indexOf(' ');
                   s2=new StringBuffer(s1);
                   s2=s2.deleteCharAt(f);
                   s1=s2.toString();                         
    // so now insert s1 as script id and str as script name....
    float price=rs.getFloat("CLOSE_PRIC");
    rsdb=stdb.executeUpdate("insert into script values ('"+s1+"','"+str+"','N',"+price+",now())");
    System.out.println(str+"\t\t\t\t\t"+price);
         catch(Exception eupd)
              System.out.println("UPDATION FAILED."+eupd);
    =======================================================================
    Output:
    Downloading file PR.ZIP from location http://nseindia.com/content/equities/PR.zip...
    Downloaded file PR.Zip to location c:\tomcat\webapps\project\PR.zip
    entered
    java.util.zip.ZipException: error in opening zip file
    Connected!!!
    UPDATED RATES...
    Script-----------------------------------Price
    S&P_CNX_Nifty                         1017.1
    CNX_Nifty_Junior                         1336.75
    S&P_CNX_Defty                         739.9
    S&P_CNX_500                         729.75
    CNX_Midcap_200                         708.8
    ASEA_BROWN_BOVERI_LTD                         302.3
    ASSOCIATED_CEMENT_CO_LTD                         144.9
    BAJAJ_AUTO_LTD                         499.0
    BHEL                         206.55
    BHARAT_PETROLEUM_CORP__LT                         215.1

    the file is at its location....... not password protected.... and i've thought of all the "half-a-dozen things" u haven't thought of...
    thanks anyway for taking the pain to reply.
    u needn't have replied if it was bugging u so.
    Maybe the zip file isn't at that location. Maybe it
    didn't get completely downloaded. Maybe downloading it
    puts permissions on it that don't allow you to open
    it. Maybe it's password-protected. Maybe half-a-dozen
    things I haven't thought of yet. Did you check any of
    those obvious things? Can you open the file yourself
    with a zip utility?

  • Java.util.zip.ZipException: Too many open files on Linux

    Hi,
    We have web application running on Caucho's resin server on jdk 1.5.0_11 and Red hat Linux. We are noticing that java process is running out of file handles within 24-30 hours. We have file limit of 5000 which it consumes in 24 hours throwing 'java.util.zip.ZipException: Too many open files'.
    I have made sure all sorts of file handles are closed from application point of view. Here is the snapshot of lsof (list of file handles) from java process. The following list keeps growing until it runs out of limit. Do you have tips/suggestions on how to mitigate this problem (considering we dont want to increase ulimit for this process)? Also, can you make out any thing more from the description of file handles like, are they unclosed POP3 connections or URL connection to external sites?
    java 7156 resin 120u IPv4 34930051 UDP localhost.localdomain:59693
    java 7156 resin 121u IPv4 34927823 UDP localhost.localdomain:59663
    java 7156 resin 122u IPv4 34931861 UDP localhost.localdomain:59739
    java 7156 resin 123u IPv4 34932023 UDP localhost.localdomain:59745
    java 7156 resin 124u IPv4 34930054 UDP localhost.localdomain:59700
    java 7156 resin 125u IPv4 34927826 UDP localhost.localdomain:59665
    java 7156 resin 126u IPv4 34927829 UDP localhost.localdomain:59666
    java 7156 resin 127u IPv4 34930057 UDP localhost.localdomain:59703
    java 7156 resin 128u IPv4 34930713 UDP localhost.localdomain:59727
    java 7156 resin 129u IPv4 34930716 UDP localhost.localdomain:59730
    java 7156 resin 130u IPv4 34932238 UDP localhost.localdomain:59789
    java 7156 resin 131u IPv4 34932026 UDP localhost.localdomain:59749
    java 7156 resin 132u IPv4 34932221 UDP localhost.localdomain:59770
    java 7156 resin 133u IPv4 34932224 UDP localhost.localdomain:59775
    java 7156 resin 134u IPv4 34932029 UDP localhost.localdomain:59753
    java 7156 resin 135u IPv4 34932032 UDP localhost.localdomain:59754
    java 7156 resin 138u IPv4 34932035 UDP localhost.localdomain:59760
    java 7156 resin 139u IPv4 34932038 UDP localhost.localdomain:59763
    java 7156 resin 140u IPv4 34932227 UDP localhost.localdomain:59780
    java 7156 resin 141u IPv4 34932230 UDP localhost.localdomain:59781
    java 7156 resin 144u IPv4 34932234 UDP localhost.localdomain:59786
    java 7156 resin 146u IPv4 34932241 UDP localhost.localdomain:59792
    java 7156 resin 147u IPv4 34932247 UDP localhost.localdomain:59802

    Finally we resolved this issue. It was oracle driver which had some compatibility issue, we upgraded our Oracle client driver to newer version, and this fixed the problem. Base line, there was nothing wrong with application code, code was doing good resource clean up, but oracle driver was leaking handles per every connection.

Maybe you are looking for