Opening Work Items Throws a Default Channel Not Found. No Channels Have Been Deployed Error

When trying to open any work item, a Default Channel not found. No channels have been deployed error displays. You may also see an exception.

The exception is similar to the one below:

06 Jun 2013 14:38:21,908 [httpConnector_37] [ERROR] com.tibco.n2.wp.core.services.ChannelBusServiceImpl - [ERROR] - {WPCORE_PROCESSWORKITEM_INTERNAL_SERVICE_FAULT} - Internal Service Fault ¬{componentClassName=`com.tibco.n2.wp.core.services.ChannelBusServiceImpl`, requestReceived=`Thu Jun 06 14:38:21 UTC 2013`, hostAddress=`16.201.136.99`, nodeName=`BPM_PRO_NODE_TIBBPMA_01`, eventType=`FAULT`, messageCategory=`CHANNEL`, componentId=`WPCORE`, stackTrace=`com.tibco.n2.wp.services.InternalServiceFault
    at com.tibco.n2.wp.core.services.ChannelBusServiceImpl.getPresentationChannel(ChannelBusServiceImpl.java:182)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    ...
    at com.tibco.n2.wp.extender.rest.WPRESTServlet.getBusinessServicePresentationType(WPRESTServlet.java:2590)
    at com.tibco.n2.wp.extender.rest.WPRESTServlet.processStartBizRequest(WPRESTServlet.java:1975)
    at com.tibco.n2.wp.extender.rest.WPRESTServlet.startBusinessService(WPRESTServlet.java:1849)
    ...
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
    at com.tibco.n2.wp.core.services.ChannelBusServiceImpl.buildBusinessServiceTypeArtifact(ChannelBusServiceImpl.java:402)
    at com.tibco.n2.wp.core.services.ChannelBusServiceImpl.buildPresentationChannel(ChannelBusServiceImpl.java:385)
    at com.tibco.n2.wp.core.services.ChannelBusServiceImpl.getPresentationChannel(ChannelBusServiceImpl.java:121)
    ... 90 more:

This is because worktypes have been removed from wp_work_types table but related presentation artefacts are not removed from the wp_presentation_artifact table. The BPM database could be left in this state due to a partially completed un-deployment, a failed BPM clean-up where an incorrect application/bundle was used, or some corruption in the BPM database.

Procedure

  1. Run the relevant (Oracle, MS-SQL or DB2) SQL script to determine whether there are any orphaned WP rows. The script returns no rows if no orphaned rows exist. If rows are returned then go through the following steps:
  2. Take a backup of the BPM database tables and the data.
  3. Stop the BPM node or implementation.wp component.
  4. Remove the offending records from the BPM database by executing the relevant (Oracle, MS-SQL or DB2) SQL script.
  5. Start the BPM Node or implementation.wp component.