无法从自定义WCC Java服务调用DOC_INFO_BY_NAME

时间:2016-08-01 17:49:54

标签: java java-6 oracle-ucm

我正在为创建自定义Java组件,以便根据传入的Excel文件进​​行一些处理。这些文件是 Content ID 的关键字。 阅读excel文件后应用程序执行的第一件事就是调用 DOC_INFO_BY_NAME

简而言之:为什么 DOC_INFO_BY_NAME 按名称查找dProcessingState,我该如何解决?

以下详细信息

但是,当我这样做时,我收到以下错误消息:

获取' LOCALHOST16200000001'的DOC_INFO时出错。无法检索' LOCALHOST16200000001'的信息。无法检索文件格式信息。找不到参数' dProcessingState'。 [详情]

发生了错误。下面的堆栈跟踪显示了更多信息。

!$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

我尝试了多种方式来拨打附加服务 目前我正在使用:

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
  }
}

那么为什么WCC找不到dProcessingState,我该如何解决呢?

3 个答案:

答案 0 :(得分:0)

您拨打该服务的方式相当标准,我不认为这就是原因。我的第一个猜测是,您的其他代码干扰了您对DOC_INFO_BY_NAME的调用。如果您禁用所有其他自定义代码(可能说起来容易做起来难得)并在一个干净的组件中调用该服务,那么我认为它会起作用。第二个候选人是重新考虑您的自定义服务是否真的应该是FileService。不确定这是否会影响结果,但也许值得一试。

答案 1 :(得分:0)

这对我来说几乎是个错误。

getProcessingState()是从 getDocFormats()调用的,它是从DOC_INFO *服务调用的。

getProcessingState()的代码首先检索 dProcessingState

 String curProcState = this.m_binder.get("dProcessingState");

然后,它检查这是否为空:

if (curProcState != null)

然而,它永远不会进行空检查。这是因为 DataBinder.get()要求传入的任何键的值(在本例中为 dProcessingState 。)

在调用服务之前,尝试将 dProcessingState 设置为DataBinder中的值。

binder.setLocal("dProcessingState", "ignore");

答案 2 :(得分:0)

问题完全是我的错。我曾尝试过想象,并扩展Databinder以便我更容易使用。事实证明我的扩展是错误的。 回滚到默认值并仔细检查我在绑定器中的数据。