javajava-6oracle-ucm

Unable to call DOC_INFO_BY_NAME from a Custom WCC Java Service


I'm creating a Custom Java Component for to do some processing based on passed in Excel Files. The files are keyed off of Content ID. one of the first things the application does after reading the excel file is call DOC_INFO_BY_NAME.

In short: Why can't DOC_INFO_BY_NAME by name find dProcessingState and how do I fix it?

Full Details Below


However, when I do I get the following Error Message:

Error getting DOC_INFO for 'LOCALHOST16200000001'. Unable to retrieve information for 'LOCALHOST16200000001'. Unable to retrieve file format information. Cannot find the parameter 'dProcessingState'. [ Details ]

An error has occurred. The stack trace below shows more information.

!$Error getting DOC_INFO for 'LOCALHOST16200000001'.!csUnableToGetRevInfo2,LOCALHOST16200000001!csUnableToGetFileFormatInfo!syParameterNotFound,dProcessingState
intradoc.common.ServiceException: !csUnableToGetRevInfo2,LOCALHOST16200000001!csUnableToGetFileFormatInfo
        at intradoc.server.ServiceRequestImplementor.buildServiceException(ServiceRequestImplementor.java:2176)
        at intradoc.server.Service.buildServiceException(Service.java:2404)
        at intradoc.server.Service.createServiceExceptionEx(Service.java:2398)
        at intradoc.server.Service.createServiceException(Service.java:2393)
        at intradoc.server.DocCommonHandler.getDocFormats(DocCommonHandler.java:271)
        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 intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:86)
        at intradoc.common.ClassHelperUtils.executeMethodReportStatus(ClassHelperUtils.java:324)
        at intradoc.server.ServiceHandler.executeAction(ServiceHandler.java:79)
        at intradoc.server.Service.doCodeEx(Service.java:622)
        at intradoc.server.Service.doCode(Service.java:594)
        at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1693)
        at intradoc.server.Service.doAction(Service.java:566)
        at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1483)
        at intradoc.server.Service.doActions(Service.java:561)
        at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1415)
        at intradoc.server.Service.executeActions(Service.java:547)
        at intradoc.server.ServiceRequestImplementor.doRequestInternalEx(ServiceRequestImplementor.java:958)
        at intradoc.server.ServiceRequestImplementor.executeServiceTopLevelSimple(ServiceRequestImplementor.java:1070)
        at com.lowes.content.edam.massMetaDataUpdate.service.types.ServicesWrapper.executeService(ServicesWrapper.java:139)
        at com.lowes.content.edam.massMetaDataUpdate.service.file.GetFileService.getDocInfo(GetFileService.java:478)
        at com.lowes.content.edam.massMetaDataUpdate.service.ServiceFieldMapper.getMappings(ServiceFieldMapper.java:76)
        at com.lowes.content.edam.massMetaDataUpdate.file.mapper.impl.FieldMapWorker.doInBackground(FieldMapWorker.java:107)
        at com.lowes.content.edam.massMetaDataUpdate.file.mapper.impl.FieldMapWorker.doInBackground(FieldMapWorker.java:37)
        at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at javax.swing.SwingWorker.run(SwingWorker.java:316)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        at java.lang.Thread.run(Thread.java:662)
Caused by: intradoc.data.DataException: !syParameterNotFound,dProcessingState
        at intradoc.data.DataBinder.getEx(DataBinder.java:1258)
        at intradoc.data.DataBinder.get(DataBinder.java:1057)
        at intradoc.server.DocCommonHandler.getProcessingState(DocCommonHandler.java:277)
        at intradoc.server.DocCommonHandler.getDocFormats(DocCommonHandler.java:184)
        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 intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:87)
        at intradoc.common.ClassHelperUtils.executeMethodReportStatus(ClassHelperUtils.java:324)
        at intradoc.server.ServiceHandler.executeAction(ServiceHandler.java:79)
        at intradoc.server.Service.doCodeEx(Service.java:622)
        at intradoc.server.Service.doCode(Service.java:595)
        ... 20 more

I've tried multiple ways of calling the additional service.
currently I'm using:

public DataBinder executeService(DataBinder binder, Workspace workspace) 
       throws DataException, ServiceException 
{  
  final String serviceName = binder.getLocal(Services.IdcService);

  //check for REMOTE_USER
  String username = binder.getEnvironmentValue("REMOTE_USER");

  if ( null == username || "".equals(username.trim()))         
  {
     log.warn("username not found, searching the binder.");
     try { username = binder.get("dUser"); }
     catch (DataException de) { log.error("Unable to get Username.", de); }
     if ( null != username && !"".equals(username.trim()))            
     { binder.setEnvironmentValue("REMOTE_USER", username); }
     else { throw new IllegalStateException("Username required!"); }
  }

  //clear idcToken
  binder.getLocalData().remove("idcToken");

  log.info("About to run '" + serviceName + "' as '" + username +"'");

  try 
  {
     log.info("Calling service " + serviceName + ": " 
             + binder.getLocalData().toString());
     // Execute service
     service.createRequestImplementor();
     service.getRequestImplementor()
            .executeServiceTopLevelSimple(binder, serviceName, 
                                          service.getUserData());
     log.info("Finished calling service");
     return service.getBinder();
  } 
  catch (DataException e) 
  {
     String msg = "Unexpected Failure executing service '"+serviceName+"'";
     log.info(msg, e);
     throw e; //log and duck
  }
}

So why can't WCC find dProcessingState, and how do I fix it?


Solution

  • Your way of calling the service is fairly standard and I don't think that is the reason. My first guess is that your other code is interfering with your call to DOC_INFO_BY_NAME. If you disable all your other custom code (perhaps easier said than done) and call the service in a clean component, then I think it'll work. Second candidate is to reconsider if your custom service really should be a FileService. Not sure if that affects the result, but perhaps worth a try.