You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by SHAILJA <sh...@gmail.com> on 2010/04/08 16:20:38 UTC

Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Hi All,

I used ant1.8.0 to build my project. In build.xml I have following lines of
code. I am putting snippet of code as  only copy section gives me error.

        <mkdir dir="${TOPDIR}/${SCRIPT_DEST}" />
        <copy todir="${TOPDIR}/${SCRIPT_DEST}" 
            failonerror="true" flatten="true" >
            <fileset 
                dir="${basedir}"  
                id="script.srcs" 
                includes="${SCRIPT_SRCS}" />
        </copy>


When I  use ant1.8.0, it gives error like this

Failed to copy /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl to
/u/kumari/main/base/bin/share/run_m.pl due to java.io.FileNotFoundException
/u/kumari/main/shailja/bin/share/run_m.pl (Permission denied)

But I have file /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl
with correct permission.

Note: The above error is not comming with ant1.7.1


Is it a bug in ant1.8.0 or somewhere I am doing wrong here ?



                
-- 
View this message in context: http://old.nabble.com/Ant1.8-copy-task-gives-error-%22Failed-to-copy%22-with-%22Permission-denied%22-tp28179282p28179282.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-04-09, SHAILJA <sh...@gmail.com> wrote:

> Stefan Bodewig wrote:

>> On 2010-04-08, SHAILJA <sh...@gmail.com> wrote:

>>> When I  use ant1.8.0, it gives error like this

>>> Failed to copy
>>> /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl to
>>> /u/kumari/main/base/bin/share/run_m.pl due to
>>> java.io.FileNotFoundException
>>> /u/kumari/main/shailja/bin/share/run_m.pl (Permission denied)

>> The error is about /u/kumari/main/shailja/bin/share/run_m.pl not the
>> file you mention.  Could there be a symbolic link somewhere that Ant
>> tries to traverse but can't?

> Copy task is copying from
> /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl to
> /u/kumari/main/shailja/bin/share/run_m.pl location

That's what the error message says, yes ;-)

> Before executing copy task /u/kumari/main/shailja/bin/share/run_m.pl
> does not exists.

OK.  What about the /u/kumari/main/shailja/bin/share/run_m.pl location?
Any idea why Ant ist traying to touch this?  I thought there might be a
symbolic link pointing from /u/kumari/main/shailja/bin/share to
/u/kumari/main/shailja/bin/share (or connecting the bin directories) or
something connecting /u/kumari/main/shailja/src/java/a/jsh/mm/script to
/u/kumari/main/shailja/bin/share.

> Anyways this error is comming only with ant1.8.0 not with ant1.7.1. I
> am not sure about the behavior of ant. :(

We have changed a few things WRT handling of symbolic links (that's why
I asked).  Can you give us the -verbose output of the copy task in
question?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by SHAILJA <sh...@gmail.com>.
>>
The error is about /u/kumari/main/shailja/bin/share/run_m.pl not the 
file you mention.  Could there be a symbolic link somewhere that Ant 
tries to traverse but can't? 
>>

Copy task is copying from
/u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl to 
/u/kumari/main/shailja/bin/share/run_m.pl location

Before executing copy task /u/kumari/main/shailja/bin/share/run_m.pl does
not exists.

There is no symlink anywhere in /u/kumari/main/shailja/bin/share, that ant
tries to traverse. Anyways this error is comming only with ant1.8.0 not with
ant1.7.1. I am not sure about the behavior of ant. :(





Stefan Bodewig wrote:
> 
> On 2010-04-08, SHAILJA <sh...@gmail.com> wrote:
> 
>> When I  use ant1.8.0, it gives error like this
> 
>> Failed to copy /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl
>> to
>> /u/kumari/main/base/bin/share/run_m.pl due to
>> java.io.FileNotFoundException
>> /u/kumari/main/shailja/bin/share/run_m.pl (Permission denied)
> 
>> But I have file /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl
>> with correct permission.
> 
> The error is about /u/kumari/main/shailja/bin/share/run_m.pl not the
> file you mention.  Could there be a symbolic link somewhere that Ant
> tries to traverse but can't?
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Ant1.8-copy-task-gives-error-%22Failed-to-copy%22-with-%22Permission-denied%22-tp28179282p28188260.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-06-07, SHAILJA wrote:

> /u/kumari/ant> less less build.xml
> <project>
> <target name="install_scripts">
>  <copy file="${basedir}/myfile.txt" tofile="/u/kumari/myfile.txt"/>
>  <chmod file="/u/kumari/myfile.txt" perm="555"/> </target>
>  </project>

> I tried with apache-ant-1.8.1 also and got same error as previous append.

Yes, this is to be expected.  More so it will be that way with any later
release of Ant as well. In addition the workaround I suggested will stop
working in the future (but you get a new attribute on <copy> which makes
it overwrite read-only files).

> Stefan Bodewig wrote:

>> For Ant 1.8.0 and 1.8.1 there is a workaround - make <copy> use the
>> filtering mode (i.e. add a filterset that doesn't change your files at
>> all) and it will overwrite read-only files just like 1.7.1 did.

> Can you please suggest me what kind of filter set I can use to copy and
> change mode of this file.

Please note, filtering will break binary files so the advice only
applies to text files.  It will not change the mode of any file, it will
just make Ant fall back to the same code that was used in <copy> prior
to Ant 1.8.0 which would happily overwrite read-only files.

What I suggest is something like

  <copy file="${basedir}/myfile.txt" tofile="/u/kumari/myfile.txt">
    <filterset>
      <filter token="foo" value="bar"/>
    </filterset>
  </copy>

where I assume that myfile.txt does not contain a literal @foo@.  With
this approch replacing tokens doesn't change the content of your file
and read-only files can be overwritten in 1.8.[01].

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by SHAILJA <sh...@gmail.com>.
Hi Stefan,

>>
/u/kumari/ant> less less build.xml 
<project> 
<target name="install_scripts"> 
 <copy file="${basedir}/myfile.txt" tofile="/u/kumari/myfile.txt"/> 
 <chmod file="/u/kumari/myfile.txt" perm="555"/> </target> 
 </project> 
>>

I tried with apache-ant-1.8.1 also and got same error as previous append.


>>
i.e. add a filterset that doesn't change your files at 
all)
>>

Can you please suggest me what kind of filter set I can use to copy and
change mode of this file.



Stefan Bodewig wrote:
> 
> On 2010-05-18, SHAILJA <sh...@gmail.com> wrote:
> 
>> Stefan Bodewig wrote:
> 
>>> Sounds like you are hitting the problem described in the recently opened
>>> <https://issues.apache.org/bugzilla/show_bug.cgi?id=49261>
> 
>> When the above mentioned bug will be fixed?
> 
> Like the bug report says, it is already fixed in trunk and will be fixed
> in the next release (after 1.8.1).  The fix may not be what you expect,
> though.  The next release will never overwrite read-only files with
> <copy> unless you explicitly set a force attribute to make it do so.
> 
> For Ant 1.8.0 and 1.8.1 there is a workaround - make <copy> use the
> filtering mode (i.e. add a filterset that doesn't change your files at
> all) and it will overwrite read-only files just like 1.7.1 did.  This
> workaround won't work anymore with the next release.
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Ant1.8-copy-task-gives-error-%22Failed-to-copy%22-with-%22Permission-denied%22-tp28179282p28801724.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-05-18, SHAILJA <sh...@gmail.com> wrote:

> Stefan Bodewig wrote:

>> Sounds like you are hitting the problem described in the recently opened
>> <https://issues.apache.org/bugzilla/show_bug.cgi?id=49261>

> When the above mentioned bug will be fixed?

Like the bug report says, it is already fixed in trunk and will be fixed
in the next release (after 1.8.1).  The fix may not be what you expect,
though.  The next release will never overwrite read-only files with
<copy> unless you explicitly set a force attribute to make it do so.

For Ant 1.8.0 and 1.8.1 there is a workaround - make <copy> use the
filtering mode (i.e. add a filterset that doesn't change your files at
all) and it will overwrite read-only files just like 1.7.1 did.  This
workaround won't work anymore with the next release.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by SHAILJA <sh...@gmail.com>.
Hi Stefan,

>>
Sounds like you are hitting the problem described in the recently opened
<https://issues.apache.org/bugzilla/show_bug.cgi?id=49261>
>>

When the above mentioned bug will be fixed?


Stefan Bodewig wrote:
> 
> On 2010-05-07, SHAILJA <sh...@gmail.com> wrote:
> 
>> I tried to debug my problem with small example. It seems something has
>> changed in "copy" target with ant1.8.0. We change permission of
>> destination
>> file after copy. With ant-1.7.1 copy target copied the source file if
>> source
>> file is newer than destination file but with ant-1.8.0 copy target
>> failed.
>> My small build.xml is
>> ==============
>> /u/kumari/ant> less less build.xml
>> <project>
>> <target name="install_scripts">
>>  <copy file="${basedir}/myfile.txt" tofile="/u/kumari/myfile.txt"/>
>>  <chmod file="/u/kumari/myfile.txt" perm="555"/>
>> </target>
>>  </project>
>> ================
> 
> Sounds like you are hitting the problem described in the recently opened
> <https://issues.apache.org/bugzilla/show_bug.cgi?id=49261>
> 
> I haven't found the time to fully look into this but think Ant should
> not overwrite read-only files by default - so this part would be a fix
> rather than a regression.  It probably should do so if the overwrite
> attribute has been set to true, but the bug report says ant doesn't do
> so either.
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Ant1.8-copy-task-gives-error-%22Failed-to-copy%22-with-%22Permission-denied%22-tp28179282p28593129.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-05-07, SHAILJA <sh...@gmail.com> wrote:

> I tried to debug my problem with small example. It seems something has
> changed in "copy" target with ant1.8.0. We change permission of destination
> file after copy. With ant-1.7.1 copy target copied the source file if source
> file is newer than destination file but with ant-1.8.0 copy target failed.
> My small build.xml is
> ==============
> /u/kumari/ant> less less build.xml
> <project>
> <target name="install_scripts">
>  <copy file="${basedir}/myfile.txt" tofile="/u/kumari/myfile.txt"/>
>  <chmod file="/u/kumari/myfile.txt" perm="555"/>
> </target>
>  </project>
> ================

Sounds like you are hitting the problem described in the recently opened
<https://issues.apache.org/bugzilla/show_bug.cgi?id=49261>

I haven't found the time to fully look into this but think Ant should
not overwrite read-only files by default - so this part would be a fix
rather than a regression.  It probably should do so if the overwrite
attribute has been set to true, but the bug report says ant doesn't do
so either.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by SHAILJA <sh...@gmail.com>.
Hi Stefan,

I tried to debug my problem with small example. It seems something has
changed in "copy" target with ant1.8.0. We change permission of destination
file after copy. With ant-1.7.1 copy target copied the source file if source
file is newer than destination file but with ant-1.8.0 copy target failed. 

My small build.xml is
==============
/u/kumari/ant> less less build.xml
<project>
<target name="install_scripts">
 <copy file="${basedir}/myfile.txt" tofile="/u/kumari/myfile.txt"/>
 <chmod file="/u/kumari/myfile.txt" perm="555"/>
</target>
 </project>
================
 
Result with ant1.7.1
=================
/u/kumari/ant> /apache/ant-1.7.1/bin/ant install_scripts
Buildfile: build.xml

install_scripts:
     [copy] Copying 1 file to /u/kumari

BUILD SUCCESSFUL
Total time: 0 seconds

/u/kumari> ls -alh myfile.txt
-r-xr-xr-x   1 kumari   kumari         0 May  7 04:33 myfile.txt

/u/kumari/ant> touch myfile.txt
/u/kumari/ant> ls -alh myfile.txt
-rw-rw-r--   1 kumari   kumari         0 May  7 04:35 myfile.txt
/u/kumari/ant> /apache/ant-1.7.1/bin/ant install_scripts
Buildfile: build.xml

install_scripts:
     [copy] Copying 1 file to /u/kumari

BUILD SUCCESSFUL
Total time: 0 seconds

/u/kumari> ls -alh myfile.txt
-r-xr-xr-x   1 kumari   kumari         0 May  7 04:35 myfile.txt

=========================
Result with ant-1.8.0
====================
/u/kumari> ls -alh myfile.txt
myfile.txt: No such file or directory

kumari@invest2.nyc:/u/kumari/ant> /apache/ant-1.8.0/bin/ant install_scripts
Buildfile: /u/kumari/ant/build.xml

install_scripts:
     [copy] Copying 1 file to /u/kumari

BUILD SUCCESSFUL
Total time: 0 seconds

/u/kumari> ls -alh myfile.txt
-r-xr-xr-x   1 kumari   kumari         0 May  7 04:40 myfile.txt

/u/kumari/ant> touch myfile.txt
/u/kumari/ant> ls -alh myfile.txt
-rw-rw-r--   1 kumari   kumari         0 May  7 04:41 myfile.txt
/u/kumari/ant> /apache/ant-1.8.0/bin/ant install_scripts
Buildfile: /u/kumari/ant/build.xml

install_scripts:
     [copy] Copying 1 file to /u/kumari

BUILD FAILED
/u/kumari/ant/build.xml:5: Failed to copy /u/kumari/ant/myfile.txt to
/u/kumari/myfile.txt due to java.io.FileNotFoundException
/u/kumari/myfile.txt (Permission denied)

Total time: 0 seconds

/u/kumari/ant> 
/u/kumari> ls -alh myfile.txt
myfile.txt: No such file or directory









Stefan Bodewig wrote:
> 
> On 2010-04-08, SHAILJA <sh...@gmail.com> wrote:
> 
>> When I  use ant1.8.0, it gives error like this
> 
>> Failed to copy /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl
>> to
>> /u/kumari/main/base/bin/share/run_m.pl due to
>> java.io.FileNotFoundException
>> /u/kumari/main/shailja/bin/share/run_m.pl (Permission denied)
> 
>> But I have file /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl
>> with correct permission.
> 
> The error is about /u/kumari/main/shailja/bin/share/run_m.pl not the
> file you mention.  Could there be a symbolic link somewhere that Ant
> tries to traverse but can't?
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Ant1.8-copy-task-gives-error-%22Failed-to-copy%22-with-%22Permission-denied%22-tp28179282p28483682.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-04-08, SHAILJA <sh...@gmail.com> wrote:

> When I  use ant1.8.0, it gives error like this

> Failed to copy /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl to
> /u/kumari/main/base/bin/share/run_m.pl due to java.io.FileNotFoundException
> /u/kumari/main/shailja/bin/share/run_m.pl (Permission denied)

> But I have file /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl
> with correct permission.

The error is about /u/kumari/main/shailja/bin/share/run_m.pl not the
file you mention.  Could there be a symbolic link somewhere that Ant
tries to traverse but can't?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by SHAILJA <sh...@gmail.com>.
>>
| Failed to copy /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl to
| /u/kumari/main/shailja/bin/share/run_m.pl (Permission denied
| /u/kumari/main/shailja/bin/share/run_m.pl (Permission denied)
>>

Oops, /u/kumari/main/base/bin/share/run_m.pl due to
java.io.FileNotFoundException --> is 
/u/kumari/main/shailja/bin/share/run_m.pl due to
java.io.FileNotFoundException

>>
Which doesn't mean anything to me since I don't know whether you are the
owner or in the appropriate group 8-)
>>

Owner and group is "kumari", (myself)

>>
> df -akh .
>   11G   9.7G   1.3G    89%

and I don't know how big the file is. 8-)

>>
Size of file is in KB, so it should not matter, as disk has enough location
for copy.



Stefan Bodewig wrote:
> 
> On 2010-04-14, SHAILJA <sh...@gmail.com> wrote:
> 
>>> Failed to copy
>>> /u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
>>> to /u/kumari/main/shailja/bin/share/load_stats.pl due to
>>> java.io.FileNotFoundException
>>> /u/kumari/main/shailja/bin/share/load_stats.pl
>>> (Permission denied)
> 
>>> this time something is different, the file the exception talks about
>>> actually is the same as the one the task wants to copy to.  In your
>>> first post they've been different.
> 
>> I am getting this kind of error only in my first post also.
> 
> In your initial post it was
> 
> ,----
> | Failed to copy /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl
> to
> | /u/kumari/main/base/bin/share/run_m.pl due to
> java.io.FileNotFoundException
> | /u/kumari/main/shailja/bin/share/run_m.pl (Permission denied)
> `----
> 
> Different source and target files and in particular the error message
> talks about a third file that is different from both the source and the
> destination.
> 
>>> But do you have permissions to write there - and is there enough space?
> 
>> Permission on /u/kumari/main/shailja/bin/share directory is
>> drwxrwsr-x
> 
> Which doesn't mean anything to me since I don't know whether you are the
> owner or in the appropriate group 8-)
> 
>> df -akh .
>>   11G   9.7G   1.3G    89%
> 
> and I don't know how big the file is. 8-)
> 
>>> Does a simple
>>> cp
>>> /u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
>>> /u/kumari/main/shailja/bin/share/
> 
>>> succeed on the command line?
> 
>> Yes it succeeded. Thats why I am not getting the cause of this error.
> 
> I'm sorry, I'm running out of ideas myself and honestly it doesn't
> really help that the issue seems to be a moving target with every post.
> 
> Cheers
> 
>         Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Ant1.8-copy-task-gives-error-%22Failed-to-copy%22-with-%22Permission-denied%22-tp28179282p28323592.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-04-14, SHAILJA <sh...@gmail.com> wrote:

>> Failed to copy
>> /u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
>> to /u/kumari/main/shailja/bin/share/load_stats.pl due to
>> java.io.FileNotFoundException
>> /u/kumari/main/shailja/bin/share/load_stats.pl
>> (Permission denied)

>> this time something is different, the file the exception talks about
>> actually is the same as the one the task wants to copy to.  In your
>> first post they've been different.

> I am getting this kind of error only in my first post also.

In your initial post it was

,----
| Failed to copy /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl to
| /u/kumari/main/base/bin/share/run_m.pl due to java.io.FileNotFoundException
| /u/kumari/main/shailja/bin/share/run_m.pl (Permission denied)
`----

Different source and target files and in particular the error message
talks about a third file that is different from both the source and the
destination.

>> But do you have permissions to write there - and is there enough space?

> Permission on /u/kumari/main/shailja/bin/share directory is
> drwxrwsr-x

Which doesn't mean anything to me since I don't know whether you are the
owner or in the appropriate group 8-)

> df -akh .
>   11G   9.7G   1.3G    89%

and I don't know how big the file is. 8-)

>> Does a simple
>> cp
>> /u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
>> /u/kumari/main/shailja/bin/share/

>> succeed on the command line?

> Yes it succeeded. Thats why I am not getting the cause of this error.

I'm sorry, I'm running out of ideas myself and honestly it doesn't
really help that the issue seems to be a moving target with every post.

Cheers

        Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by SHAILJA <sh...@gmail.com>.
>>
> Failed to copy
> /u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
> to /u/kumari/main/shailja/bin/share/load_stats.pl due to
> java.io.FileNotFoundException
> /u/kumari/main/shailja/bin/share/load_stats.pl
> (Permission denied)

>>

I am getting this kind of error only in my first post also. 

>>
But do you have permissions to write there - and is there enough space?
>>
Permission on /u/kumari/main/shailja/bin/share directory is 
drwxrwsr-x  

df -akh .
  11G   9.7G   1.3G    89% 

>>
cp
/u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
/u/kumari/main/shailja/bin/share/

succeed on the command line?
>>

Yes it succeeded. Thats why I am not getting the cause of this error. 


Stefan Bodewig wrote:
> 
> On 2010-04-13, SHAILJA <sh...@gmail.com> wrote:
> 
>>      [copy] Copying
>> /u/kumari/main/shailja/src/java/a/utd/writer/realtimelagstats/load_stats.pl
>> to /u/kumari/main/shailja/bin/share/load_stats.pl
> 
>> Failed to copy
>> /u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
>> to /u/kumari/main/shailja/bin/share/load_stats.pl due to
>> java.io.FileNotFoundException
>> /u/kumari/main/shailja/bin/share/load_stats.pl
>> (Permission denied)
> 
> this time something is different, the file the exception talks about
> actually is the same as the one the task wants to copy to.  In your
> first post they've been different.
> 
>> 	at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:839)
> 
> just rethrows the exception from
> 
>> Caused by: java.io.FileNotFoundException:
>> /u/kumari/main/shailja/bin/share/load_stats.pl (Permission denied)
>> 	at java.io.FileOutputStream.open(Native Method)
>> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
>> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
>> 	at
>> org.apache.tools.ant.util.ResourceUtils.copyResource(ResourceUtils.java:460)
> 
> which just tries to open the output file.
> 
>>  ls -alh
>> /u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
>> -rwxrwxr-x
> 
>> this file exists with right permission
> 
> Yes, the error occurs on the destination side.
> 
>> copy task should copy from source to detination location
>> /u/kumari/main/shailja/bin/share/load_stats.pl
>> here location /u/kumari/main/shailja/bin/share exists and no symlink is
>> there.
> 
> But do you have permissions to write there - and is there enough space?
> Does a simple
> 
> cp
> /u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
> /u/kumari/main/shailja/bin/share/
> 
> succeed on the command line?
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Ant1.8-copy-task-gives-error-%22Failed-to-copy%22-with-%22Permission-denied%22-tp28179282p28238710.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-04-13, SHAILJA <sh...@gmail.com> wrote:

>      [copy] Copying
> /u/kumari/main/shailja/src/java/a/utd/writer/realtimelagstats/load_stats.pl
> to /u/kumari/main/shailja/bin/share/load_stats.pl

> Failed to copy
> /u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
> to /u/kumari/main/shailja/bin/share/load_stats.pl due to
> java.io.FileNotFoundException /u/kumari/main/shailja/bin/share/load_stats.pl
> (Permission denied)

this time something is different, the file the exception talks about
actually is the same as the one the task wants to copy to.  In your
first post they've been different.

> 	at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:839)

just rethrows the exception from

> Caused by: java.io.FileNotFoundException:
> /u/kumari/main/shailja/bin/share/load_stats.pl (Permission denied)
> 	at java.io.FileOutputStream.open(Native Method)
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
> 	at
> org.apache.tools.ant.util.ResourceUtils.copyResource(ResourceUtils.java:460)

which just tries to open the output file.

>  ls -alh
> /u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
> -rwxrwxr-x

> this file exists with right permission

Yes, the error occurs on the destination side.

> copy task should copy from source to detination location
> /u/kumari/main/shailja/bin/share/load_stats.pl
> here location /u/kumari/main/shailja/bin/share exists and no symlink is
> there.

But do you have permissions to write there - and is there enough space?
Does a simple

cp /u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl /u/kumari/main/shailja/bin/share/

succeed on the command line?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by SHAILJA <sh...@gmail.com>.
install_scripts:
    [mkdir] Skipping /u/kumari/main/shailja/bin/share because it already
exists.
     [copy] load_stats.pl added as load_stats.pl is outdated.
     [copy] No sources found.
     [copy] Copying 1 file to /u/kumari/main/shailja/bin/share
     [copy] Copying
/u/kumari/main/shailja/src/java/a/utd/writer/realtimelagstats/load_stats.pl
to /u/kumari/main/shailja/bin/share/load_stats.pl
      [ant] Exiting /u/kumari/main/shailja/src/java/a/build.xml.

BUILD FAILED
/u/kumari/main/shailja/src/java/build.xml:13: The following error occurred
while executing this line:
/u/kumari/main/shailja/src/java/a/build.xml:17: The following error occurred
while executing this line:
/u/kumari/main/shailja/src/java/a/guas/build.xml:193: The following error
occurred while executing this line:
/u/kumari/main/shailja/src/java/a/guas/utd/build.xml:60: The following error
occurred while executing this line:
/u/kumari/main/shailja/src/java/a/guas/utd/writer/build.xml:69: The
following error occurred while executing this line:
/etc/ScriptBuild.xml:50: Failed to copy
/u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
to /u/kumari/main/shailja/bin/share/load_stats.pl due to
java.io.FileNotFoundException /u/kumari/main/shailja/bin/share/load_stats.pl
(Permission denied)
	at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:839)
	at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:508)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java: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(SingleCheckExecutor.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.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java: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(SingleCheckExecutor.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.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java: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(SingleCheckExecutor.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.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java: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(SingleCheckExecutor.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.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java: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(SingleCheckExecutor.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.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java: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(DefaultExecutor.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.launch.Launcher.run(Launcher.java:280)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.FileNotFoundException:
/u/kumari/main/shailja/bin/share/load_stats.pl (Permission denied)
	at java.io.FileOutputStream.open(Native Method)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
	at
org.apache.tools.ant.util.ResourceUtils.copyResource(ResourceUtils.java:460)
	at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:519)
	at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:481)
	at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:310)
	at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:827)
	... 77 more

Total time: 1 minute 14 seconds

>>
 ls -alh
/u/kumari/main/shailja/src/java/a/guas/utd/writer/realtimelagstats/load_stats.pl
-rwxrwxr-x

this file exists with right permission
>>
copy task should copy from source to detination location
/u/kumari/main/shailja/bin/share/load_stats.pl 
here location /u/kumari/main/shailja/bin/share exists and no symlink is
there.




Stefan Bodewig wrote:
> 
> On 2010-04-12, SHAILJA <sh...@gmail.com> wrote:
> 
>> I am executing ant from /u/kumari/main/shailja/src/java, means my
>> build.xml
>> file is /u/kumari/main/shailja/src/java/build.xml. The error occurs only
>> if
>> I invoke ant from src/java in my project. The error is not comming if I
>> invoke ant from /u/kumari/main/shailja/src/java/a/jsh/mm. what could be
>> the
>> reason behind it?
> 
> Hard to tell without looking at your filesystem.  A symbolic link (sorry
> to bring that up again 8-) using a relative path would be different if
> you followed it from different places.
> 
>> Even the output in verbose mode is not clear to say what ant1.8 is
>> doing.
> 
> It may be clearer for one of Ant's developers.  Could you please at
> least give us the full stack trace of the exception so we can see which
> file operation is failing?
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Ant1.8-copy-task-gives-error-%22Failed-to-copy%22-with-%22Permission-denied%22-tp28179282p28230841.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-04-12, SHAILJA <sh...@gmail.com> wrote:

> I am executing ant from /u/kumari/main/shailja/src/java, means my build.xml
> file is /u/kumari/main/shailja/src/java/build.xml. The error occurs only if
> I invoke ant from src/java in my project. The error is not comming if I
> invoke ant from /u/kumari/main/shailja/src/java/a/jsh/mm. what could be the
> reason behind it?

Hard to tell without looking at your filesystem.  A symbolic link (sorry
to bring that up again 8-) using a relative path would be different if
you followed it from different places.

> Even the output in verbose mode is not clear to say what ant1.8 is
> doing.

It may be clearer for one of Ant's developers.  Could you please at
least give us the full stack trace of the exception so we can see which
file operation is failing?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"

Posted by SHAILJA <sh...@gmail.com>.
I am executing ant from /u/kumari/main/shailja/src/java, means my build.xml
file is /u/kumari/main/shailja/src/java/build.xml. The error occurs only if
I invoke ant from src/java in my project. The error is not comming if I
invoke ant from /u/kumari/main/shailja/src/java/a/jsh/mm. what could be the
reason behind it? Even the output in verbose mode is not clear to say what
ant1.8 is doing. Why the behavior is changed with parent level as it works
fine from lower level. 




SHAILJA wrote:
> 
> Hi All,
> 
> I used ant1.8.0 to build my project. In build.xml I have following lines
> of code. I am putting snippet of code as  only copy section gives me
> error.
> 
>         <mkdir dir="${TOPDIR}/${SCRIPT_DEST}" />
>         <copy todir="${TOPDIR}/${SCRIPT_DEST}" 
>             failonerror="true" flatten="true" >
>             <fileset 
>                 dir="${basedir}"  
>                 id="script.srcs" 
>                 includes="${SCRIPT_SRCS}" />
>         </copy>
> 
> 
> When I  use ant1.8.0, it gives error like this
> 
> Failed to copy /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl to
> /u/kumari/main/base/bin/share/run_m.pl due to
> java.io.FileNotFoundException /u/kumari/main/shailja/bin/share/run_m.pl
> (Permission denied)
> 
> But I have file /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl
> with correct permission.
> 
> Note: The above error is not comming with ant1.7.1
> 
> 
> Is it a bug in ant1.8.0 or somewhere I am doing wrong here ?
> 
> 
> 
>                 
> 

-- 
View this message in context: http://old.nabble.com/Ant1.8-copy-task-gives-error-%22Failed-to-copy%22-with-%22Permission-denied%22-tp28179282p28214094.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org