12 feb 2013

NullPointerException in VCR_GET_CONTENT_TYPE service

Recently I was debugging an error in WebCenter Portal, that didn't allow the user to search over a content-server instance with a Content-Presenter TaskFlow.

In this case, we had 2 instances of UCM connected to WebCenter Portal application, the first one works without problems, but when we attached the second one, and you try to query over it, the page is refreshed and the content-presenter wizard is closed.



The Portal log shows this error:

Caused By: oracle.stellent.ridc.protocol.ServiceException: Could not load information about VCR content type. Unable to execute service method 'vcrGetContentTypeInfo'. The error was caused by an internally generated issue. The error has been logged.
 at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:135)
 at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:107)



And looking at UCM log this error is shown:

services/3 02.07 15:22:14.039 IdcServer-89 !csUserEventMessage,sysadmin,CIS!$ intradoc.common.ServiceException: !csVcrCouldNotLoadContentType!csUnableToExecMethod,vcrGetContentTypeInfo
 services/3 02.07 15:22:14.039 IdcServer-89 *ScriptStack VCR_GET_CONTENT_TYPE
 services/3 02.07 15:22:14.039 IdcServer-89 3:vcrGetContentTypeInfo,**no captured values**
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceRequestImplementor.buildServiceException(ServiceRequestImplementor.java:2115)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.buildServiceException(Service.java:2260)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.createServiceExceptionEx(Service.java:2254)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.createServiceException(Service.java:2249)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceHandler.executeAction(ServiceHandler.java:102)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.doCodeEx(Service.java:533)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.doCode(Service.java:505)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1643)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.doAction(Service.java:477)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1458)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.doActions(Service.java:472)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1391)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.executeActions(Service.java:458)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:737)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.Service.doRequest(Service.java:1890)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceManager.processCommand(ServiceManager.java:435)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.IdcServerThread.processRequest(IdcServerThread.java:265)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.IdcServerThread.run(IdcServerThread.java:160)
 services/3 02.07 15:22:14.039 IdcServer-89         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
 services/3 02.07 15:22:14.039 IdcServer-89         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
 services/3 02.07 15:22:14.039 IdcServer-89         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
 services/3 02.07 15:22:14.039 IdcServer-89 Caused by: java.lang.NullPointerException
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.vcr.VcrServiceHandler.addPropertyChoicesForFieldAndView(VcrServiceHandler.java:514)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.vcr.VcrServiceHandler.vcrGetContentTypeInfo(VcrServiceHandler.java:464)
 services/3 02.07 15:22:14.039 IdcServer-89         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 services/3 02.07 15:22:14.039 IdcServer-89         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 services/3 02.07 15:22:14.039 IdcServer-89         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 services/3 02.07 15:22:14.039 IdcServer-89         at java.lang.reflect.Method.invoke(Method.java:597)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:86)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.common.ClassHelperUtils.executeMethodReportStatus(ClassHelperUtils.java:324)
 services/3 02.07 15:22:14.039 IdcServer-89         at intradoc.server.ServiceHandler.executeAction(ServiceHandler.java:79)
 services/3 02.07 15:22:14.039 IdcServer-89         ... 16 more



After seeing that the problem resides at UCM service execution we see that the status-code returned is -32. (Any status-code lower than 0 means service execution error).

Looking at the dDocTypes all appears correctly, but after accessing to the "Check-in" form, some errors can give us an idea of the problem. When I access to check-in form, some alerts are showed to the user indicating that some of the metadata "views" seems corrupted.




To find out wich metadata is the one that uses that view, I've opened Firebug and look for that view on JS files.


The metadata called "xIsEditable" is using YesNoList view, its recommended to perform more search and see how many metadata fields are using that view.

The problem in this case was that the view was empty and didn't have any value, this causes the NPE (NullPointerException) in the execution of the service VCR_GET_CONTENT_TYPE.

After adding values to the view, and going back to check-in page, no more "alert" of view errors were shown.

Now the UCM is ready to be used again with content-presenter, and the problem solved.