1. OODT
  2. OODT-433

filemgr.getProductByName returns empty product references which results in a bug in --retrieveFilesByName and --retrieveFilesById


    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.4
    • Fix Version/s: 0.4
    • Component/s: file manager
    • Labels:


      --retrieveFilesByName and --retrieveFilesById have a bug.

      Sequence of events:

      Here's the command that I ran:

      filemgr-client --url http://localhost:9101 --operation --retrieveFilesByName --productName 1332838758.h5 --destination /home/kat/ --transferer org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferFactory

      So, the --retrieveFilesByName calls an XML-RPC "filemgr.getProductByName" to get the product details. However on the File Manager side in org.apache.oodt.cas.filemgr.catalog.LuceneCatalog.java line 412 and 415:

      return getProductByName(productName, false) /where the call signature is (defined on line 415 of the same file)/

      getProductByName(String productName, boolean getRefs)

      getRefs is now passed (as false) as a parameter to the toCompleteProduct(..) method, which seems to indicate that the product references should not be returned.

      This is then received by the filemgr client in the methodResponse with the references set as [] i.e. an empty list

      On the client side in org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferer.java line 358 and 359 of the copyFilesToDir() method:

      List<Reference> refs = product.getProductReferences();
      for (Iterator<Reference> i = refs.iterator(); i.hasNext()

      Since refs is empty the for loop loops zero times.

      Then a bit further up the call chain in org.apache.oodt.cas.filemgr.cli.action.RetrieveFilesCliAction.java line 55 to 60:

      if (product != null)

      { dt.retrieveProduct(product, destination); }


      { throw new Exception("Product was not found"); }

      dt.retrieveProduct(product, destination);

      It appears that dt.retrieveProduct is called a second time outside the if / else statement.


        Thomas Bennett created issue -
        Thomas Bennett made changes -
        Field Original Value New Value
        Comment [ Hey Brian,

        +1 from me to. Excellent idea! Thats a really neat solution and makes perfect sense. ]
        Thomas Bennett made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Thomas Bennett made changes -
        Status Resolved [ 5 ] Closed [ 6 ]


          • Assignee:
            Thomas Bennett
            Thomas Bennett
          • Votes:
            1 Vote for this issue
            1 Start watching this issue


            • Created: