Summary: | Unable to rename old file to temporary file JAR TASK | ||
---|---|---|---|
Product: | Ant | Reporter: | Arinjay <arinjaybaj> |
Component: | Core tasks | Assignee: | Ant Notifications List <notifications> |
Status: | NEW --- | ||
Severity: | critical | ||
Priority: | P2 | ||
Version: | 1.8.2 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Bug Depends on: | |||
Bug Blocks: | 51069 | ||
Attachments: |
passing test
test using antcall |
Description
Arinjay
2010-04-14 05:07:16 UTC
Are you using an operating system that locks files that are open (like Windows)? If you've just created the jar and then try to update it in a subsequent task the file may not have been closed properly - in this case this would be a duplicate of bug 45960 and is supposed to be fixed with Ant 1.8.0. Could you please try Ant 1.8.0 and report back? (In reply to comment #2) > Could you please try Ant 1.8.0 and report back? I did tried with Ant 1.8.0 and I am getting the same issue. However, if I am facing that only in the case of a manifest update. If I remove the target which updates the manifest, then the script completes but I fail with classnotfoundexceptions as the manifest is not updated with the appropriate classpaths. Can you please help? It would be good if you could provide a small testcase build file, I'll give it a try myself. Are you running Windows? Created attachment 25335 [details]
passing test
The attached test file works fine for me (Java6 on Windows 7).
(In reply to comment #5) > Created an attachment (id=25335) [details] > passing test > > The attached test file works fine for me (Java6 on Windows 7). I am running Java6 on Win Xp Professional SP3. <jar jarfile="${file.input}" update="yes"> <manifest> <attribute name="Class-Path" value="${lib.path} ${manifest.default.classpath}"/> </manifest> </jar> does my attached build file cause any problems for you? (In reply to comment #7) > does my attached build file cause any problems for you? The file which you have shared works well with 1.6.5 as well. so what is different in your case? In case my last question sounded a bit rude, sorry about that, that wasn't intended. In order to fix the problem you see, we will need to figure out what the difference between your testcase and my minimal snippet is. In an ideal world we'd be able to distill a reproducable testcase. I understand you won't be able to provide us with the full build environment you are using. If you don't manage to trim it down to the problem, maybe a start could be if you provided us with the -debug log of your build process when it fails using Ant 1.8.0. If even the logfile would reveal sensitive information than feel free to send it to me in private email rather than attaching it to the issue. (In reply to comment #10) > In case my last question sounded a bit rude, sorry about that, that wasn't > intended. > > In order to fix the problem you see, we will need to figure out what the > difference between your testcase and my minimal snippet is. In an ideal world > we'd be able to distill a reproducable testcase. > > I understand you won't be able to provide us with the full build environment > you are using. If you don't manage to trim it down to the problem, maybe a > start could be if you provided us with the -debug log of your build process > when it fails using Ant 1.8.0. > > If even the logfile would reveal sensitive information than feel free to send > it to me in private email rather than attaching it to the issue. Let me give a try to produce a similar one and we can try reproducing it at your end. Does this give any idea which we can try? <target name="ear.create" depends="ear.environment.setup"> <antcall target="jar.create"/> <antcall target="manifest.create"/> <<<It fails here>>> After the updation of manifest above and executing the other targets, it creates the ear. <ear > </ear> <target> Created attachment 25341 [details]
test using antcall
I'm afraid the antcall layer isn't enough to cause problems - the attached build file still works for me.
(In reply to comment #13) > Created an attachment (id=25341) [details] > test using antcall > > I'm afraid the antcall layer isn't enough to cause problems - the attached > build file still works for me. Sorry for the delay! I will require your email id ...will not be possible to send you the build but will try to reproduce something similar. (In reply to comment #14) > (In reply to comment #13) > > Created an attachment (id=25341) [details] [details] > > test using antcall > > > > I'm afraid the antcall layer isn't enough to cause problems - the attached > > build file still works for me. > > Sorry for the delay! > I will require your email id ...will not be possible to send you the build but > will try to reproduce something similar. For the 1.8.0, I get this at the end...after I put a debug to the build: C:\work\subscriptions\cvssubscriptions\esc\source\java\build\build.xml:1709: Una ble to rename old file (C:\work\subscriptions\cvssubscriptions\esc\source\java\b uildpackage\buildtemp\eartemp\ICECommon-ejbs.jar) to temporary file at org.apache.tools.ant.taskdefs.Zip.renameFile(Zip.java:757) at org.apache.tools.ant.taskdefs.Zip.executeMain(Zip.java:636) at org.apache.tools.ant.taskdefs.Zip.execute(Zip.java:568) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68) at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:217) at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360) at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(Single CheckExecutor.java:38) at org.apache.tools.ant.Project.executeTargets(Project.java:1212) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441) at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105) at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68) at net.sf.antcontrib.logic.ForEach.executeSequential(ForEach.java:178) at net.sf.antcontrib.logic.ForEach.execute(ForEach.java:254) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360) at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(Single CheckExecutor.java:38) at org.apache.tools.ant.Project.executeTargets(Project.java:1212) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441) at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360) at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(Single CheckExecutor.java:38) at org.apache.tools.ant.Project.executeTargets(Project.java:1212) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441) at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360) at org.apache.tools.ant.Project.executeTarget(Project.java:1329) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe cutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1212) at org.apache.tools.ant.Main.runBuild(Main.java:801) at org.apache.tools.ant.Main.startAnt(Main.java:218) at org.apache.tools.ant.Main.start(Main.java:180) at org.apache.tools.ant.Main.main(Main.java:269) This is happening for me in 64-Bit Java, Windows 7 and 1.8.2 ANT environment, When I tried it with 32-Bit Java it worked fine can you provide a build file allowing to reproduce the problem ? |