Wednesday, July 24, 2013

UCM Error when searching repository with GET_SEARCH_RESULTS and folderChildren parameter

In my last UCM application I provided custom search module based on service GET_SEARCH_RESULTS:

  public static List<UcmDocument> getAllSearchResults(String query, int startRow, int count, long dFromPath, IdcClient idcClient, IdcContext userContext) throws Exception
  {
    List<UcmDocument> list = new ArrayList<UcmDocument>();
    DataBinder binder = idcClient.createBinder();
    binder.putLocal("IdcService", "GET_SEARCH_RESULTS");
    binder.putLocal("QueryText", query);
    binder.putLocal("SortSpec", "dInDate DESC");
    binder.putLocal("folderChildren",Long.toString(dFromPath));
    binder.putLocal("StartRow", String.valueOf(startRow));
    binder.putLocal("ResultCount", String.valueOf(count));
    ServiceResponse response = idcClient.sendRequest(userContext, binder);
    DataBinder serverBinder = response.getResponseAsBinder();
    DataResultSet resultSet = serverBinder.getResultSet("SearchResults");
    int resultCount = resultSet.getRows().size();

    /* and so on */ 

When everything was working properly in my machine with test instance of WebCenter Content, on production server I got exception:

!csUserEventMessage,weblogic,192.168.1.200:16200!$!csSearchUnableToReturnResults
intradoc.common.ServiceException: !csSearchUnableToReturnResults
*ScriptStack GET_SEARCH_RESULTS
3:getSearchResults,**no captured values**
        at intradoc.server.SearchManager.retrieveSearchInfoAsBinder(SearchManager.java:295)
        at intradoc.server.SearchService.retrieveSearchInfo(SearchService.java:1848)
        at intradoc.server.SearchService.doLocalSearch(SearchService.java:1377)
        at intradoc.server.SearchService.getSearchResults(SearchService.java:670)
        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.executeMethodEx(ClassHelperUtils.java:310)
        at intradoc.common.ClassHelperUtils.executeMethod(ClassHelperUtils.java:295)
        at intradoc.server.Service.doCodeEx(Service.java:620)
        at intradoc.server.Service.doCode(Service.java:575)
        at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1643)
        at intradoc.server.Service.doAction(Service.java:547)
        at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1458)
        at intradoc.server.Service.doActions(Service.java:542)
        at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1391)
        at intradoc.server.Service.executeActions(Service.java:528)
        at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:737)
        at intradoc.server.Service.doRequest(Service.java:1956)
        at intradoc.server.ServiceManager.processCommand(ServiceManager.java:437)
        at intradoc.server.IdcServerThread.processRequest(IdcServerThread.java:265)
        at intradoc.idcwls.IdcServletRequestUtils.doRequest(IdcServletRequestUtils.java:1354)
        at intradoc.idcwls.IdcServletRequestUtils.processFilterEvent(IdcServletRequestUtils.java:1731)
        at intradoc.idcwls.IdcIntegrateWrapper.processFilterEvent(IdcIntegrateWrapper.java:222)
        at sun.reflect.GeneratedMethodAccessor253.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at idcservlet.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:87)
        at idcservlet.common.ClassHelperUtils.executeMethodEx(ClassHelperUtils.java:305)
        at idcservlet.common.ClassHelperUtils.executeMethodWithArgs(ClassHelperUtils.java:278)
        at idcservlet.ServletUtils.executeContentServerIntegrateMethodOnConfig(ServletUtils.java:1704)
        at idcservlet.IdcFilter.doFilter(IdcFilter.java:457)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
        at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
        at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
        at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
        at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
        at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
        at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
        at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
        at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

Information provided by stack trace was worthless for me, so I decided to tune System Audit Information level of "problematic" UCM instance as shown below:

In tuned audit log I found following rows:

ORA-20000: Oracle Text error:
 search/6 07.24 13:03:01.602 IdcServer-509 DRG-10856: SDATA section xCollectionID does not exist
 search/6 07.24 13:03:01.602 IdcServer-509 
 search/6 07.24 13:03:01.602 IdcServer-509 ORA-06512: przy "CTXSYS.DRUE"\, linia 160
 search/6 07.24 13:03:01.602 IdcServer-509 ORA-06512: przy "CTXSYS.CTX_QUERY"\, linia 791
 search/6 07.24 13:03:01.602 IdcServer-509 ORA-06512: przy "MY_OCS.CONTENT_SEARCH"\, linia 125
 search/6 07.24 13:03:01.602 IdcServer-509 ORA-06512: przy "MY_OCS.CONTENT_SEARCH"\, linia 320
 search/6 07.24 13:03:01.602 IdcServer-509 ORA-06512: przy linia 1

Of course field xCollectionID exists in DOC_META table, so I started to analyze CONTENT_SEARCH package. My attention drew the fact that the search engine bases on indexed fields, so I should check if xCollectionID is marked as indexed.

To my surprise xCollectionID isn't indexed, so I marked is as indexed, next rebuilded a collection and an index, and tried to run my search procedure once again.

Now, as you can suppose, all works perfect.

No comments:

Post a Comment