Home > Junit Java Util Zip Zipexception > Junit Java.util.zip.zipexception Error In Opening Zip File

Junit Java.util.zip.zipexception Error In Opening Zip File

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up java.uti.zip.ZipException error while calling a ant target up vote 2 down vote favorite 1 While calling a ANT target, I am getting the below error. I tried my level best solve the issue but not. Unable to obtain resource from C:\uiunit\log4j.properties: java.util.zip.ZipException: error in opening zip file [junit] Unable to obtain resource from C:\uiunit\log4j.properties: [junit] java.util.zip.ZipException: error in opening zip file [junit] at java.util.zip.ZipFile.open(Native Method) [junit] at java.util.zip.ZipFile.(ZipFile.java:214) [junit] at java.util.zip.ZipFile.(ZipFile.java:144) [junit] at java.util.jar.JarFile.(JarFile.java:152) [junit] at java.util.jar.JarFile.(JarFile.java:116) [junit] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1006) [junit] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:149) [junit] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.(AntClassLoader.java:110) [junit] at org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:953) [junit] at org.apache.tools.ant.AntClassLoader.getNamedResources(AntClassLoader.java:922) [junit] at org.apache.tools.ant.loader.AntClassLoader5.getResources(AntClassLoader5.java:58) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.checkForkedPath(JUnitTask.java:1181) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeAsForked(JUnitTask.java:1061) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:855) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:1903) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:804) [junit] at org.apache.tools.ant.UnknownElement.execute(Unkn

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, http://stackoverflow.com/questions/17248991/java-uti-zip-zipexception-error-while-calling-a-ant-target helping each other. Join them; it only takes a minute: Sign up ZipException when running junit tests up vote 8 down vote favorite 1 I've been trying in vain to get ant to execute some tests written in junit. Any advice would be much appreciated. I'm pretty new to both ant and Java so please be patient. As http://stackoverflow.com/questions/6015092/zipexception-when-running-junit-tests a quick summary, what i'm doing is trying to get ant to execute a very simple test, the classpath looks ok considering the output from ant -debug. I'm getting a null test error for a test who's class file is explicitly mentioned in the classpath. Also, i'm getting a ZipException, i dont know what that's about. Here's a testcase i'm trying to run: package testmanagment; import junit.framework.*; public abstract class EasyTest extends TestCase { public EasyTest(String name) { super(name); } protected void setUp() {} protected void testSeeMee() throws Exception { assertTrue(true); } protected void testSeeMeetoo() throws Exception { assertTrue(true); } } There are a few tests in the package, this one was just to see why everything was failing. it fails with ZipException. and here's a little bit of my make file: http://www.thetekblog.com/2011/03/exception-adding-individually-files-to-classpath-taskdef-java-util-zip-zipexception-error-in-opening-zip-file/comment-page-1/ where the log4J.properties file needed to be http://grokbase.com/t/ant/notifications/12a4nqzcas/bug-53964-new-unable-to-obtain-resource-from-pom-java-util-zip-zipexception-error-in-opening-zip-file in on the test class path. If you add a individually file to the classpath you get an exception which looks like this; [junit] java.util.zip.ZipException: error in opening zip file [junit] junit java.util.zip.zipexception at java.util.zip.ZipFile.open(Native Method) [junit] at java.util.zip.ZipFile.(Unknown Source) [junit] at java.util.zip.ZipFile.(Unknown Source) [junit] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1028) [junit] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:147) [junit] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.nextElement(AntClassLoader.java:130) [junit] at org.apache.tools.ant.util.CollectionUtils$CompoundEnumeration.nextElement(CollectionUtils.java:198) [junit] at sun.misc.CompoundEnumeration.nextElement(Unknown Source) [junit] at org.apache.commons.logging.LogFactory.getConfigurationFile(LogFactory.java:1476) [junit] at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:457) [junit] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685) [junit] at com.everythingeverywhere.youraccount.controllers.payg.simactivation.PaygSIMActivationController.(PaygSIMActivationController.java:36) junit java.util.zip.zipexception error [junit] at com.everythingeverywhere.youraccount.controllers.payg.simactivation.TestPaygSIMActivationController.(TestPaygSIMActivationController.java:26) [junit] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) The easy fix is to include the directory instead of the full path name. If there are other files that you do not need/want including in the directory then put together a fileset and exclude those not required. Previous PostInjecting UUIDGenFactory with Spring (static factory methods) Next PostTutorial: Logging with AOP using AspectJ and Spring 3 1 Comment on "Exception adding individually files to classpath [taskdef] java.util.zip.ZipException: error in opening zip file" Nik June 19, 2014 at 9:07 pm Thanks. This helped when I was having the same errors Leave a Reply Cancel reply Your email address will not be published. Required fields are marked *

4, 2012 at 1:18 pm https://issues.apache.org/bugzilla/show_bug.cgi?id=53964Priority: P2Bug ID: 53964Assignee: [email protected]: Unable to obtain resource from pom:java.util.zip.ZipException: error in opening zip fileSeverity: normalClassification: UnclassifiedOS: LinuxReporter: [email protected]: PCStatus: NEWVersion: 1.8.2Component: OtherProduct: Ant...Unable to obtain resource from/home/matti/.ivy2/cache/org.jboss.ejb3.depchain/jboss-ejb3-depchain-as6/poms/jboss-ejb3-depchain-as6-1.0.4.pom:java.util.zip.ZipException: error in opening zip file[junit] Unable to obtain resource from/home/matti/.ivy2/cache/org.jboss.ejb3.depchain/jboss-ejb3-depchain-as6/poms/jboss-ejb3-depchain-as6-1.0.4.pom:[junit] java.util.zip.ZipException: error in opening zip file[junit] at java.util.zip.ZipFile.open(Native Method)[junit] at java.util.zip.ZipFile.(ZipFile.java:127)[junit] at java.util.jar.JarFile.(JarFile.java:135)[junit] at java.util.jar.JarFile.(JarFile.java:99)[junit] atorg.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1002)[junit] atorg.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:145)[junit] atorg.apache.tools.ant.AntClassLoader$ResourceEnumeration.nextElement(AntClassLoader.java:130)[junit] atorg.apache.tools.ant.util.CollectionUtils$CompoundEnumeration.nextElement(CollectionUtils.java:241)[junit] atorg.apache.tools.ant.taskdefs.optional.junit.JUnitTask.checkForkedPath(JUnitTask.java:1179)[junit] atorg.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeAsForked(JUnitTask.java:1057)[junit] atorg.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:917)[junit] atorg.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:818)[junit] atorg.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)[junit] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)[junit] atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[junit] at java.lang.reflect.Method.invoke(Method.java:597)[junit] atorg.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)[junit] at org.apache.tools.ant.Task.perform(Task.java:348)[junit] at org.apache.tools.ant.Target.execute(Target.java

 
No related pages.