This discussion is archived
1 2 Previous Next 28 Replies Latest reply: Oct 29, 2013 1:31 AM by kittu_3002 RSS

Unable to download Document using the GET_FILE service

user1175496 Newbie
Currently Being Moderated
Hi,
I have a custom component-custom service being called from a workflow,which downloads the file to an external folder every time a check in is performed with parameters matching the criteria of the workflow.
Now the issue is every time the file is checked in for the first time,the file which gets downloaded only has the binder information with the status message as:
"StatusMessage=Unable to download 'ABC022257'.Unable to find latest revision for item 'ABC022257'."
Can anyone point out to probable causes??
  • 1. Re: Unable to download Document using the GET_FILE service
    958148 Newbie
    Currently Being Moderated
    Hi,

    If you can send the URL of the service which you are calling, might be you are not using the latest did for the file to download.
  • 2. Re: Unable to download Document using the GET_FILE service
    user1175496 Newbie
    Currently Being Moderated
    I'm using the following piece of code to download the file :

                   IdcClient client = getClient();
                   IdcContext IdcContext = getUserContext();
                   
                   DataBinder dataBinder = client.createBinder();
                   SystemUtils.trace("system", "dID in getFile>>>>>>>>>>" + dID);

                   
                   dataBinder.putLocal("IdcService", "GET_FILE");
                   dataBinder.putLocal("dID", dID);
                   dataBinder.putLocal("dDocName", contentID);
         ServiceResponse response = client.sendRequest(IdcContext, dataBinder);
         stream = response.getResponseStream();
    File f = new File(fileSaveLocation);
                        OutputStream out = new FileOutputStream(f);
                        byte buf[] = new byte[1024];
                        int len;
                        while ((len = stream.read(buf)) > 0)
                        out.write(buf, 0, len);
                        out.close();


    Also,I'm getting following error in the logs,although i did a fresh check in:
    !csUserEventMessage,weblogic,CIS!$ intradoc.common.ServiceException: !csUnableToDownload,ABC003803
    services/3     05.24 12:32:38.460     IdcServer-213     *ScriptStack GET_FILE
    services/3     05.24 12:32:38.460     IdcServer-213     3:computeDocID,dID=3018,dDocName=ABC003803
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.ServiceRequestImplementor.buildServiceException(ServiceRequestImplementor.java:2115)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.Service.buildServiceException(Service.java:2326)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.Service.createServiceExceptionEx(Service.java:2320)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.Service.createServiceException(Service.java:2315)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.FileService.computeDocID(FileService.java:423)
    services/3     05.24 12:32:38.460     IdcServer-213     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    services/3     05.24 12:32:38.460     IdcServer-213     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    services/3     05.24 12:32:38.460     IdcServer-213     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    services/3     05.24 12:32:38.460     IdcServer-213     at java.lang.reflect.Method.invoke(Method.java:597)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:86)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.common.ClassHelperUtils.executeMethodEx(ClassHelperUtils.java:310)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.common.ClassHelperUtils.executeMethod(ClassHelperUtils.java:295)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.Service.doCodeEx(Service.java:620)
    services/3     05.24 12:32:38.460     IdcServer-213     at ziprenditions.ZipRenditionsHandler.callMethodRecursively(ZipRenditionsHandler.java:1703)
    services/3     05.24 12:32:38.460     IdcServer-213     at ziprenditions.ZipRenditionsHandler.computeDocID(ZipRenditionsHandler.java:699)
    services/3     05.24 12:32:38.460     IdcServer-213     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    services/3     05.24 12:32:38.460     IdcServer-213     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    services/3     05.24 12:32:38.460     IdcServer-213     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    services/3     05.24 12:32:38.460     IdcServer-213     at java.lang.reflect.Method.invoke(Method.java:597)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:86)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.common.ClassHelperUtils.executeMethodReportStatus(ClassHelperUtils.java:324)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.ServiceHandler.executeAction(ServiceHandler.java:79)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.Service.doCodeEx(Service.java:603)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.Service.doCode(Service.java:575)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1643)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.Service.doAction(Service.java:547)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1458)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.Service.doActions(Service.java:542)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1391)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.Service.executeActions(Service.java:528)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:737)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.Service.doRequest(Service.java:1956)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.ServiceManager.processCommand(ServiceManager.java:437)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.IdcServerThread.processRequest(IdcServerThread.java:265)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.IdcServerThread.run(IdcServerThread.java:160)
    services/3     05.24 12:32:38.460     IdcServer-213     at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
    services/3     05.24 12:32:38.460     IdcServer-213     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    services/3     05.24 12:32:38.460     IdcServer-213     at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    services/3     05.24 12:32:38.460     IdcServer-213     Caused by: intradoc.common.ServiceException: !csItemNoLongerInSystem2,ABC003803,3018
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.utils.FileRevisionSelectionUtils.computeDocumentRevisionInfo(FileRevisionSelectionUtils.java:487)
    services/3     05.24 12:32:38.460     IdcServer-213     at intradoc.server.FileService.computeDocID(FileService.java:418)
    services/3     05.24 12:32:38.460     IdcServer-213     ... 33 more

    Edited by: user1175496 on May 24, 2013 12:04 AM
  • 3. Re: Unable to download Document using the GET_FILE service
    jiri.machotka Guru
    Currently Being Moderated
    See the description of the service's parameters: http://docs.oracle.com/cd/E23943_01/doc.1111/e11011/c04_core.htm#BABFDEFH

    Namely, RevisionSelectionMethod: The revision selection method.

    If present, dDocName must be present. The value of this variable is the method used to compute a dID from the specified dDocName. Its value can be Specific, Latest, or LatestReleased.

    If the value is Specific, the dDocName is ignored, and dID is required and is used to get a rendition. If the value is Latest, the latest revision of the content item is used to compute the dID. If the value is LatestReleased, the latest released revision of the content item is used to compute the dID.


    Since you mentioned that
    custom service being called from a workflow
    and
    the issue is every time the file is checked in for the first time
    you probably can't use LatestReleased. Therefore, I'd try if Specific with dID, or Latest with dDocName will work.

    It is also possible that your service is called too early (during checkin of the first revision of an item that will end up in a workflow). Would you mind adding a description what you want to achieve and when/how your service is called?
  • 4. Re: Unable to download Document using the GET_FILE service
    user1175496 Newbie
    Currently Being Moderated
    jiri.machotka wrote:
    See the description of the service's parameters: http://docs.oracle.com/cd/E23943_01/doc.1111/e11011/c04_core.htm#BABFDEFH

    Namely, RevisionSelectionMethod: The revision selection method.

    If present, dDocName must be present. The value of this variable is the method used to compute a dID from the specified dDocName. Its value can be Specific, Latest, or LatestReleased.

    If the value is Specific, the dDocName is ignored, and dID is required and is used to get a rendition. If the value is Latest, the latest revision of the content item is used to compute the dID. If the value is LatestReleased, the latest released revision of the content item is used to compute the dID.


    Since you mentioned that
    custom service being called from a workflow
    and
    the issue is every time the file is checked in for the first time
    you probably can't use LatestReleased. Therefore, I'd try if Specific with dID, or Latest with dDocName will work.

    It is also possible that your service is called too early (during checkin of the first revision of an item that will end up in a workflow). Would you mind adding a description what you want to achieve and when/how your service is called?
    I tried using all the permutations and combinations,but it does not seem to work for any of them.
    The scenario is : As soon as the file is checked in the content server and moved to workflow,the custom service should be called to download the file to an external folder,also the download service is called from the exit step of the workflow.
    When you mentioned that the service is called too early ,will changing the load order of the service will solve the problem??

    Edited by: user1175496 on May 24, 2013 2:44 AM
  • 5. Re: Unable to download Document using the GET_FILE service
    jiri.machotka Guru
    Currently Being Moderated
    LoadOrder will not help here - it defines the order in which resources such as service, or includes definition are loaded (so that you can use the super tag, or override the service).

    You should describe details how your service is called. And perhaps also, why have you decided for a service (and not a filter, for instance)?
  • 6. Re: Unable to download Document using the GET_FILE service
    user1175496 Newbie
    Currently Being Moderated
    I'm calling the service in the exit step of the workflow using the Idoc <$executeService("DOWNLOAD_DOCUMENT")$>
    and this service has a service handler which downloads the document to an external folder.
    We decided to go with the workflow as we need to send out email notifications and also in future if need to add reviewers we can easily define reviewers for this step.
  • 7. Re: Unable to download Document using the GET_FILE service
    jiri.machotka Guru
    Currently Being Moderated
    OK.

    At this level, you should be able to call GET_FILE with no issues.

    The only logical explanation I can find is that the identifier you provide is not correct. You can verify it quite easily from GUI

    - check-in a new item
    - from workflow revision, navigate to Content Information
    - get Content ID (dDocName)
    - in the browser change the URL to something like ?IdcService=GET_FILE&dDocName=gotten dDocName&RevisionSelectionMethod=Latest
    - and it should work (at least it worked for me)

    If you change the dDocName (e.g. delete few characters), you will get the error.
  • 8. Re: Unable to download Document using the GET_FILE service
    user1175496 Newbie
    Currently Being Moderated
    jiri.machotka wrote:
    OK.

    At this level, you should be able to call GET_FILE with no issues.

    The only logical explanation I can find is that the identifier you provide is not correct. You can verify it quite easily from GUI

    - check-in a new item
    - from workflow revision, navigate to Content Information
    - get Content ID (dDocName)
    - in the browser change the URL to something like ?IdcService=GET_FILE&dDocName=gotten dDocName&RevisionSelectionMethod=Latest
    - and it should work (at least it worked for me)

    If you change the dDocName (e.g. delete few characters), you will get the error.
    Thanks Jiri,
    The point here is ,currently there are 0 reviewers defined for this workflow currently.After the document is checked in its moved to workflow and custom service is called and the document is downloaded so i will not be able to navigate to the workflow step or the item will not be in the workflow list.
    I can try normally from the browser and post the results in a while.
  • 9. Re: Unable to download Document using the GET_FILE service
    jiri.machotka Guru
    Currently Being Moderated
    The point here is ,currently there are 0 reviewers defined for this workflow currently
    It means you have no items in an active workflow. Therefore, it should be no big deal to add a user like 'weblogic' as the only reviewer for a while :-)
  • 10. Re: Unable to download Document using the GET_FILE service
    user1175496 Newbie
    Currently Being Moderated
    jiri.machotka wrote:
    The point here is ,currently there are 0 reviewers defined for this workflow currently
    It means you have no items in an active workflow. Therefore, it should be no big deal to add a user like 'weblogic' as the only reviewer for a while :-)
    Jiri,
    I 'm able to download the file as per the steps mentioned by you ..the file that is getting downloaded is perfectly fine in this case.So now what do you suggest me to do , as I'm passing the same parameters in the custom service as well...but it is not working :(:(
  • 11. Re: Unable to download Document using the GET_FILE service
    jiri.machotka Guru
    Currently Being Moderated
    So, you are stating that if you execute the GET_FILE service via a http request, it works, but if you do it from your custom service, with the exactly same parameters, it fails with the error mentioned earlier. Just to eliminate another obvious cause: are you sure that a user you use the other time is authorized to read the item?

    Otherwise, it looks very, very strange.

    The only other thing I can think of that there is something in the binder, what causes the other call to fail. Could you verify values in the binder? One helpful article how to do that can be found here: https://blogs.oracle.com/kyle/entry/page_debugging_easier_in_ucm_11g
  • 12. Re: Unable to download Document using the GET_FILE service
    user1175496 Newbie
    Currently Being Moderated
    jiri.machotka wrote:
    So, you are stating that if you execute the GET_FILE service via a http request, it works, but if you do it from your custom service, with the exactly same parameters, it fails with the error mentioned earlier. Just to eliminate another obvious cause: are you sure that a user you use the other time is authorized to read the item?

    Otherwise, it looks very, very strange.

    The only other thing I can think of that there is something in the binder, what causes the other call to fail. Could you verify values in the binder? One helpful article how to do that can be found here: https://blogs.oracle.com/kyle/entry/page_debugging_easier_in_ucm_11g
    Regarding the user permissions,I'm trying with the UCM admin user only so permissions should not be an issue.I'm not able to understand why the revision is not getting downloaded to the external folder when the same parameters are being passed from the Java Code.

    The logs say that the content item does not exist in the system while downloading the document from the service:
    Caused by: intradoc.common.ServiceException: !csItemNoLongerInSystem2,ABC003817,3035
    services/3     05.27 13:42:15.630     IdcServer-20     at intradoc.server.utils.FileRevisionSelectionUtils.computeDocumentRevisionInfo(FileRevisionSelectionUtils.java:487)
    services/3     05.27 13:42:15.630     IdcServer-20     at intradoc.server.FileService.computeDocID(FileService.java:418)


    What can be the probable cause of this???

    Edited by: user1175496 on May 27, 2013 3:21 AM
  • 13. Re: Unable to download Document using the GET_FILE service
    jiri.machotka Guru
    Currently Being Moderated
    Would you mind sharing the whole code as it looks now? From the excerpt it is not clear where from dID/dDocName is coming.
  • 14. Re: Unable to download Document using the GET_FILE service
    user1175496 Newbie
    Currently Being Moderated
    Can you please share your mail id so that i can mail you the source code.
1 2 Previous Next