Getting InsufficientPermissionOnFileException while copying a list of files using XADiskCOnnection

102 views
Skip to first unread message

Kannan Vairavan

unread,
Jan 13, 2012, 3:22:40 PM1/13/12
to XADisk
Hi,
I'm getting InsufficientPermissionOnFileException while copying a list
of files using XADiskCOnnection.
This is happening only in case of 1 directory - "/home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data".
The other directory - "/home/iframe/repo/content/jobfile/master/
CLS_450K_publish/recipe" goes through fine. When I check on the
directory permissions - it is same for both the directories. What
could be the reason behind this exception? I have pasted the stack
trace below.

Thanks,
Kannan Vairavan

13 Jan 2012 12:16:20,972 INFO - System::The following job files are
included as part of publishID : 1 messageID : 1306434721521_IS09
13 Jan 2012 12:16:20,973 INFO - System::/CLS_450K_publish
13 Jan 2012 12:16:33,038 INFO - System::Beginning checkin at 12:16:33
13 Jan 2012 12:16:33,105 INFO - System::Dest File Path : /home/iframe/
repo/content/jobfile/master/CLS_450K_publish/recipe/RECIPE_2_3_3_1.txt
13 Jan 2012 12:16:33,145 INFO - System::Dest File Path : /home/iframe/
repo/content/jobfile/version/1.0/CLS_450K_publish/recipe/
RECIPE_2_3_3_1.txt
13 Jan 2012 12:16:33,146 INFO - System::Dest File Path : /home/iframe/
repo/content/jobfile/master/CLS_450K_publish/data.rec
13 Jan 2012 12:16:33,183 INFO - System::Dest File Path : /home/iframe/
repo/content/jobfile/version/1.0/CLS_450K_publish/data.rec
13 Jan 2012 12:16:33,196 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/
IDW_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:33,246 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data/
IDW_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:33,252 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:33,346 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:33,347 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:33,404 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:33,410 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1/.IMMP0001.jpeg:WRITE_DIRECTORY
13 Jan 2012 12:16:33,507 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1/.IMMP0001.jpeg:WRITE_DIRECTORY
13 Jan 2012 12:16:33,520 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1/.I2MP0001.jpeg:WRITE_DIRECTORY
13 Jan 2012 12:16:33,768 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1/.I2MP0001.jpeg:WRITE_DIRECTORY
13 Jan 2012 12:16:33,769 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:33,898 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:33,899 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:33,930 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:33,931 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:33,968 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:33,969 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:34,065 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:34,066 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:34,105 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:34,106 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:34,171 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:34,176 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1/.IMAP0001.jpeg:WRITE_DIRECTORY
13 Jan 2012 12:16:34,206 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1/.IMAP0001.jpeg:WRITE_DIRECTORY
13 Jan 2012 12:16:34,207 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:34,245 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data/IDW_2_3_3_1/
IDP_2_3_3_1:WRITE_DIRECTORY
13 Jan 2012 12:16:34,246 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data:WRITE_DIRECTORY
13 Jan 2012 12:16:34,282 ERROR -
System::InsufficientPermissionOnFileException : /home/iframe/repo/
content/jobfile/version/1.0/CLS_450K_publish/data:WRITE_DIRECTORY
13 Jan 2012 12:16:34,283 INFO - System::Dest File Path : /home/iframe/
repo/content/jobfile/master/CLS_450K_publish/data2.rec
13 Jan 2012 12:16:34,353 INFO - System::Dest File Path : /home/iframe/
repo/content/jobfile/version/1.0/CLS_450K_publish/data2.rec
13 Jan 2012 12:16:34,353 INFO - System::Finished checkin at 12:16:34

Nitin Verma

unread,
Jan 14, 2012, 4:32:34 AM1/14/12
to XADisk
Hi Kannan,

As the above trace is more of a customized one instead of a java stack-
trace, this is how I tried to interpret it: you are logging the 2
fields of the InsufficientPermissionOnFileException:
1. "WRITE_DIRECTORY" - the permission type required, 2. the path - on
which the permission is not available.

Let's pick "/home/iframe/repo/content/jobfile/master/CLS_450K_publish/
data/IDW_2_3_3_1/IDP_2_3_3_1:WRITE_DIRECTORY". It is telling that you
need to have a write permission over the directory /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/IDP_2_3_3_1.
As you said you are doing a sequence of copyFile operations, it means
you were seemingly trying to copy a file "f" from some directory to
this "IDP_2_3_3_1" directory.

The reason behind an InsufficientPermissionOnFileException over a
directory D could be any of these:
1) the directory D is not writable, or 2) the directory D does not
exist at all. (so, the name "InsufficientPermissionOnFileException "
could be misleading sometimes.)

Please check whether the target directories (e.g. /home/iframe/repo/
content/jobfile/master/CLS_450K_publish/data/IDW_2_3_3_1/IDP_2_3_3_1)
in your case meets the above requirements. Please note that the
copyFile operation does not create the required parent directories by
itself.

Let me know if this could help, or you need more clarification.

Thanks,
Nitin

Kannan Vairavan

unread,
Jan 14, 2012, 9:52:04 PM1/14/12
to XADisk
Hi Nitin,
Thanks again for the response.

As you the said, the issue was missing dircetories. The original stack
trace was showing [WRITE_DIRECTORY] exception.
I was checking if the parent directory exists and creating the
directory if it is not present, before copying the file to the
destination.
It caused the issue.

When I traverse through the entire detination directory path and
create all the missing directories,
the method worked fine.

Thanks,
Kannan

Kannan Vairavan

unread,
Jan 15, 2012, 11:49:01 AM1/15/12
to xad...@googlegroups.com, XADisk
Hi Nitin,
How can we overwrite an existing file using XADiskConnection. I'm getting FileAlreadyExistsException.
If I try to delete and do copy, I'm getting an error while commiting the transaction. Is there a way to overwrite a file?

Thanks,
Kannan Vairavan

> --
> You received this message because you are subscribed to the Google Groups "XADisk" group.
> To post to this group, send email to xad...@googlegroups.com.
> To unsubscribe from this group, send email to xadisk+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/xadisk?hl=en.
>

Kannan Vairavan

unread,
Jan 15, 2012, 12:35:53 PM1/15/12
to XADisk
Hi Nitin,
When I stopped the server and restarted again, delete and copy worked
fine. I have pasted the exception I was getting earlier.
Is deleting and copying, the write way to overwrite an existing file?

Thanks,
Kannan Vairavan

This is the exception stack trace I got when trying to delete and
recreate the file.
15 Jan 2012 00:18:20,850 ERROR -
System::CLASS:com.hhta.iframe.db.TransactionManager::METHOD:commit(boolean
rollback)::Error in commit transaction
javax.transaction.SystemException: org.omg.CORBA.INTERNAL: JTS5031:
Exception [org.omg.CORBA.INTERNAL: vmcid: 0x0 minor code: 0
completed: Maybe] on Resource [commit] operation. vmcid: 0x0 minor
code: 0 completed: No
at
com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:
330)
at
com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate.commitDistributedTransaction(JavaEETransactionManagerJTSDelegate.java:
169)
at
com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.commit(JavaEETransactionManagerSimplified.java:
843)
at
com.sun.enterprise.transaction.UserTransactionImpl.commit(UserTransactionImpl.java:
201)
at
com.hhta.iframe.db.TransactionManager.commit(TransactionManager.java:
71)
at
com.hhta.irecipe.distribution.process.handler.JobFileProcessDataTypeHandler.initializeProcess(JobFileProcessDataTypeHandler.java:
211)
at
com.hhta.irecipe.distribution.process.service.JobFileProcessHandlerWS.initializeProcess(JobFileProcessHandlerWS.java:
70)
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:597)
at com.sun.xml.ws.api.server.InstanceResolver
$1.invoke(InstanceResolver.java:246)
at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:
146)
at
com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:
257)
at
com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:
95)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:629)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
at com.sun.xml.ws.server.WSEndpointImpl
$2.process(WSEndpointImpl.java:295)
at com.sun.xml.ws.transport.http.HttpAdapter
$HttpToolkit.handle(HttpAdapter.java:515)
at
com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:285)

On Jan 15, 8:49 am, Kannan Vairavan <vka...@gmail.com> wrote:
> Hi Nitin,
> How can we overwrite an existing file using XADiskConnection. I'm getting FileAlreadyExistsException.
> If I try to delete and do copy, I'm getting an error while commiting the transaction. Is there a way to overwrite a file?
>
> Thanks,
> Kannan Vairavan
>
> > For more options, visit this group athttp://groups.google.com/group/xadisk?hl=en.- Hide quoted text -
>
> - Show quoted text -

Nitin Verma

unread,
Jan 16, 2012, 12:31:35 PM1/16/12
to XADisk
Hi Kanna,

Regarding overwriting a file. Yes, delete followed by copy should work
(there is no direct way to overwrite a file). The stacktrace which you
have posted does not seem to come from either of delete or copy
methods, I guess something else went messy somewhere. Anyways, if it
reoccurs, it would be great if you can gather some debug info around
that and let me know if I can help.

Thanks,
Nitin
Reply all
Reply to author
Forward
0 new messages