Ant Junit Error In Opening Zip File Reading Resource
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and ant build + error in opening zip file policies of this site About Us Learn more about Stack Overflow the company
Java.util.zip.zipexception Error In Opening Zip File Junit Ant
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Error In Opening Zip File Java
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a
Java.util.zip.zipexception Error In Opening Zip File Eclipse
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 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: 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 http://stackoverflow.com/questions/6015092/zipexception-when-running-junit-tests Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Configuring ant to run unit http://stackoverflow.com/questions/461417/configuring-ant-to-run-unit-tests-where-should-libraries-be-how-should-classpa tests. Where should libraries be? How should classpath be configured? avoiding ZipException up vote 17 down vote favorite 4 I'm trying to run my junit tests using ant. The tests are kicked off using a JUnit 4 test suite. If I run this direct from Eclipse the tests complete without error. However if I run it from ant then many of the tests fail with this error repeated over and over until the junit task crashes. [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:114) [junit] at java.util.zip.ZipFile.(ZipFile.java:131) [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(CompoundEnumeration.java:43) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.checkForkedPath(JUnitTask.java:1128) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeAsForked(JUnitTask.java:1013) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:834) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:1785) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:785) [junit] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) [junit] at sun.reflect.Generat [x] | Forgot Password Login: [x] First https://discuss.gradle.org/t/ant-task-java-util-zip-zipexception-error-in-opening-zip-file/769 Last Prev Next This bug is not in your last search results. Bug53964 - Unable to obtain resource from pom: java.util.zip.ZipException: error in opening zip file Summary: Unable to obtain error in resource from pom: java.util.zip.ZipException: error in open... Status: RESOLVED FIXED Product: Ant Classification: Unclassified Component: Other Version: 1.8.2 Hardware: PC Linux Importance: P2 normal (vote) TargetMilestone: 1.9.4 Assigned To: Ant Notifications List URL: Keywords: Depends on: Blocks: Show error in opening dependency tree Reported: 2012-10-04 13:18 UTC by matti Modified: 2014-01-02 16:03 UTC (History) CC List: 0 users Attachments Add an attachment (proposed patch, testcase, etc.) Note You need to log in before you can comment on or make changes to this bug. Description matti 2012-10-04 13:18:26 UTC ... 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. non-jar resources on the classpath giving me 1000s of " java.util.zip.ZipException: error in opening zip file" errors. This has only started happening recently although I can't remember with which Gradle version it started. Is it possible to configure the ant task to ignore these files? task generateRm() { description 'Generate RM classes from schema' def jaxbTargetDir = new File(generatedSrcDir) doLast { ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask', classpath: configurations.compile.asPath) ant.jaxbTargetDir = jaxbTargetDir ant.xjc(destdir: '${jaxbTargetDir}', package: 'com.mvr.business.portal.rm.enquiries', extension: true) { schema(dir: 'src/main/resources/schema/rm', includes: 'rm_schema.xsd') binding(dir: 'src/main/resources/schema/rm', includes: 'rm-bindings.xjb') } } generateRm.outputs.dir jaxbTargetDir } :generateRm Unable to obtain resource from /Users/phill/.gradle/caches/modules-2/files-2.1/org.apache.wicket/wicket/6.14.0/528ab2deef2e48dfaa4af0fbfbd6e5404659932f/wicket-6.14.0.pom: java.util.zip.ZipException: error in opening zip file [ant:xjc] Unable to obtain resource from /Users/phill/.gradle/caches/modules-2/files-2.1/org.apache.wicket/wicket/6.14.0/528ab2deef2e48dfaa4af0fbfbd6e5404659932f/wicket-6.14.0.pom: [ant:xjc] java.util.zip.ZipException: error in opening zip file [ant:xjc] at java.util.zip.ZipFile.open(Native Method) bmuschko (Benjamin Muschko) 2015-12-22 21:37:20 UTC #2 I ran into the same issue. It seems that com.sun.tools.xjc.XJCTask has issues when executed concurrently. It seems that using com.sun.tools.xjc.XJC2Task instead seems to fix it. Home Categories FAQ/Guidelines Terms of Service Privacy Policy Powered by Discourse, best viewed with JavaScript enabled