[ 
https://issues.apache.org/jira/browse/OODT-781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14981449#comment-14981449
 ] 

Sean Hardman commented on OODT-781:
-----------------------------------

Hyun Lee from JPL has also been doing some research on this issue for the 
Planetary Data System and came up with the following:

The removeFile() method of XmlRpcFileManager class had been modified in 0.7. 
This method deletes by product not file (in 0.6) so it throws exception 
(java.lang.Exception: java.lang.IllegalArgumentException: URI is not absolute). 
A fix can be done in the OODT filemgr package:

1. Change deleteProduct() method of LocalDataTransferer and 
InPlaceDataTransferer classes, from:
{code} 
File dataFile = new 
File(URI.create(ref.getDataStoreReference()).toURL().getPath());
{code}
To:
{code}
File dataFile = new File(ref.getDataStoreReference());
{code}

2. Revert back the change to removeFile() method in XmlRpcFileManager class to 
0.6, from:
{code}
public boolean removeFile(String filePath) throws DataTransferException, 
IOException {
  // TODO(bfoster): Clean this up so that it deletes by product not file. 
  Product product = new Product();
  Reference r = new Reference();
  r.setDataStoreReference(filePath);
  product.setProductReferences(Lists.newArrayList(r));
  dataTransfer.deleteProduct(product); 
  return true;
}
{code}
To:
{code}
public boolean removeFile(String filePath) throws DataTransferException, 
IOException {
  return new File(filePath).delete();
}
{code}

With respect to the above suggestions, it is not clear whether these may cause 
new problems elsewhere since it is not exactly clear why the change was made in 
0.7 in the first place.

> IllegalArgumentException: RADiX filemgr-client script cannot delete product 
> by id or name
> -----------------------------------------------------------------------------------------
>
>                 Key: OODT-781
>                 URL: https://issues.apache.org/jira/browse/OODT-781
>             Project: OODT
>          Issue Type: Bug
>          Components: file manager
>    Affects Versions: 0.7
>         Environment: Mac OS X 10.9.2
> java version "1.7.0_51"
> Apache Maven 2.2.1
>            Reporter: Mengying Wang
>            Priority: Minor
>             Fix For: 0.11
>
>
> I am trying to delete some product in the OODT File Manager using the product 
> id or name. However, the system raises "java.lang.IllegalArgumentException: 
> URI is not absolute" error. 
> Below are my commands: 
> ./filemgr-client --op --dbyid --productId 
> 2b0e7582-6077-11e4-ac24-8d456d2e5b9b --url http://localhost:9000
> ./filemgr-client -op --deleteProductByName --productName test.txt --url 
> http://localhost:9000
> Part of the file manager logs is shown here: 
> ......
> Oct 30, 2014 2:56:21 PM 
> org.springframework.beans.factory.support.AbstractBeanFactory doGetBean
> FINE: Returning cached instance of singleton bean 'sqlQuery'
> Oct 30, 2014 2:56:21 PM 
> org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient <init>
> INFO: Loading File Manager Configuration Properties from: 
> [/Users/AngelaWang/Documents/programs/oodt-0.7/filemgr/etc/filemgr.properties]
> Oct 30, 2014 2:56:21 PM 
> org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient <init>
> INFO: Loading File Manager Configuration Properties from: 
> [/Users/AngelaWang/Documents/programs/oodt-0.7/filemgr/etc/filemgr.properties]
> ERROR: Failed to delete product 
> 'org.apache.oodt.cas.filemgr.structs.Product@5433d17' : java.lang.Exception: 
> java.lang.IllegalArgumentException: URI is not absolute



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to