Thursday, February 28, 2013

UCM content access issue

When user logged into UCM,  the content will be displayed accordingly based on roles assigned to user.

If we are trying to map, weblogic AD user groups with UCM roles, we need to create a credential map and refer it in JPS provider configuration.

In case, if user is still not able to view the content (even though proper groups assigned in AD), try below steps.

1. Log into UCM console as admin and Enable jpslog
2. Login to UCM console using user credentials
3. Parellelly monitor jpslog and check whether groups fetching from weblogic AD or not.
4. If not, re-order the weblogic AD groups and test the scenario
    If still not working, delete and re-create weblogic AD groups and check the logs. Make sure the admin & managed servers restarted.

Checking for Match values in XSLT

XSLT Sheet:
----------------------------------------------------

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
    <xsl:variable name="value">
        <xsl:choose>
            <xsl:when test="/root[not(n1 != 'PROCESSED')]">
                <xsl:value-of select="'PROCESSED'"/>
            </xsl:when>
            <xsl:when test="/root[not(n1[. != 'FAILED' and . != 'ERROR'])]">
                <xsl:value-of select="'ERROR'"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="'NEW'"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>
    <xsl:text>$value = </xsl:text>
    <xsl:value-of select="$value"/>
</xsl:template>
</xsl:stylesheet>

Input:

<root>
    <n1>PROCESSED</n1>
    <n1>PROCESSED</n1>
    <n1>PROCESSED</n1>
</root>
Output:
$value = PROCESSED

Input:
<root>
    <n1>FAILED</n1>
    <n1>ERROR</n1>
    <n1>FAILED</n1>
</root>
or
<root>
    <n1>FAILED</n1>
    <n1>FAILED</n1>
    <n1>FAILED</n1>
</root>
Output:
$value = ERROR

Input:
<root>
    <n1>FAILED</n1>
    <n1>ERROR</n1>
    <n1>PROCESSED</n1>
</root>
Output:
$value = NEW

Query to return NULL values LAST


select distinct ibh.HEADER_NAME,MAX(ibd.LAST_UPDATE_DATE)
from HEADER_TABLE ibh,DETAILS_TABLE ibd
where ibh.USER_ID =#user_id
and ibh.HEADER_ID = ibd.HEADER_ID (+)
group by ibh.HEADER_NAME
order by MAX(ibd.LAST_UPDATE_DATE)
desc NULLS LAST

Error while raising Business Events

If we get following error, while raising events in ADF/SOA layer, make sure that, EDN data source pointed to respective managed servers.

In case EDN data source configured as multi data source, make sure that, the RAC data sources pointing to respective managed servers.

Error:

Caused By: oracle.fabric.common.FabricException: Error enqueueing event: weblogic.common.ResourceException: No good connections available.
                at oracle.integration.platform.blocks.event.saq.SAQRemoteBusinessEventConnection.enqueueEvent(SAQRemoteBusinessEventConnection.java:85)
                at oracle.integration.platform.blocks.event.saq.SAQRemoteBusinessEventConnection.publishEvent(SAQRemoteBusinessEventConnection.java:55)
                at oracle.jbo.server.EventInvocation.raiseEvent(EventInvocation.java:549)
                at oracle.jbo.server.EntityImpl.raiseEvents(EntityImpl.java:7946)
                at oracle.jbo.server.EntityImpl.afterCommit(EntityImpl.java:7526)
                at oracle.jbo.server.DBTransactionImpl.doAfterCommit(DBTransactionImpl.java:2294)
                at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2185)
                at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2378)

Invalidate Cache in WebCenter

import oracle.webcenter.portalframework.sitestructure.SiteStructureContext;
import oracle.adf.controller.v2.lifecycle.PagePhaseEvent;
import oracle.adf.controller.v2.lifecycle.PagePhaseListener;
import oracle.adf.controller.v2.lifecycle.Lifecycle;

public final class CustomPhaseListener implements PagePhaseListener {

public void afterPhase(PagePhaseEvent pagePhaseEvent) {

if (pagePhaseEvent.getPhaseId() == Lifecycle.PREPARE_RENDER_ID) {
          try {

                SiteStructureContext ctx =
                SiteStructureContext.getInstance();


                ctx.getNavigationModel("/oracle/webcenter/portalapp/navigations/default-navigation-  model.xml").invalidateCache();
                } catch (ResourceNotFoundException ex) {
                   ex.printStackTrace();
                }
            }
       }



Script to Recover stale composite instances


declare 
  -- Script Parameters:
  
  -- Composite Name
  cmpstName VARCHAR2(200) := 'TestZComposite';
  -- Composite Version
  cmpstVersion VARCHAR(20) := '1.2';
  
  -- Composite old distinguished name
  old_composite_dn VARCHAR2(500) := 'default/TestZComposite!1.2*soa_87ad6db9-5a3e-4e9a-8940-f9b2885121b4';
  -- Composite new distinguished name (new mds label => soa_51ea029f-6b84-40b1-af8d-ba9a0fa22a97)
  new_composite_dn VARCHAR2(500) := 'default/TestZComposite!1.2*soa_51ea029f-6b84-40b1-af8d-ba9a0fa22a97';
  -- Composite new MDS label
  new_mds_label VARCHAR2(200) := 'soa_51ea029f-6b84-40b1-af8d-ba9a0fa22a97';  
  
begin
  -- Step 1
  -- update compositedn (new mds label) and reactivate stale composites 
  -- (state 64 = stale, state 0 = running)
  update composite_instance ci
  set ci.composite_dn = new_composite_dn,
      ci.state = CASE
                   WHEN (ci.state is not null and ci.state = 64) 
                     THEN 0
                     ELSE ci.state                    
                 END
  where ci.composite_dn = old_composite_dn; 
  
  -- Step 2
  -- update mds label and compositedn in triggered messages
  update dlv_message dlvm
    set dlvm.composite_label = new_mds_label,
        dlvm.res_subscriber = CASE
                                 WHEN dlvm.res_subscriber IS NOT NULL 
                                     THEN replace(dlvm.res_subscriber, 
                                                  old_composite_dn, 
                                                  new_composite_dn)
                                     ELSE dlvm.res_subscriber                            
                               END
  where dlvm.composite_name = cmpstName and 
        dlvm.composite_revision = cmpstVersion;
  
  -- Step 3
  -- reactivate callbacks and update mds label and compositedn 
  -- (state 3 = stale/cancelled, state 0 = unresolved)
  update dlv_subscription dlv 
  set dlv.composite_label = new_mds_label,
      dlv.subscriber_id = replace(dlv.subscriber_id, old_composite_dn, new_composite_dn),
      dlv.state = CASE
                   WHEN (dlv.state IS NOT NULL AND dlv.state = 3)
                       THEN 0
                       ELSE dlv.state             
                  END
  where dlv.composite_name = cmpstName and
        dlv.composite_revision = cmpstVersion;
  
  -- Step 4
  -- reactivate references and update compositedn 
  -- (state 0 = successful, state 6 = stale)
  update reference_instance t 
  set t.state = 0,
      t.composite_dn = new_composite_dn
  where t.composite_dn = old_composite_dn and t.state = 6;      
  
  -- Step 5
  -- reactivate bpel/bpmn processes and update compositedn 
  -- (state 1 = open running, state 9 = closed stale)
  update cube_instance cui 
  set   cui.composite_label = new_mds_label,
        cui.state = CASE
                       WHEN (cui.state IS NOT NULL AND cui.state = 9)
                           THEN 1
                           ELSE cui.state             
                     END
  where cui.composite_name = cmpstName and cui.composite_revision = cmpstVersion;
  
  -- Step 6
  -- reactivate human tasks and update compositedn
  UPDATE WFTASK TBL_NOTFS
    SET  TBL_NOTFS.STATE = CASE
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_INITIATED') 
                              THEN 'ASSIGNED'
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_WITHDRAWN') 
                              THEN 'WITHDRAWN'
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_REASSIGNED') 
                              THEN 'ASSIGNED'
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_ALERTED') 
                              THEN 'ALERTED'
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_SUSPENDED') 
                              THEN 'SUSPENDED'
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_ERROR') 
                              THEN 'ERRORED'
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_COMPLETED') 
                              THEN NULL
                         ELSE TBL_NOTFS.STATE                            
                       END,
         TBL_NOTFS.COMPOSITEDN = new_composite_dn,
         TBL_NOTFS.MDSLABEL = new_mds_label
   WHERE TBL_NOTFS.TASKDEFINITIONNAME is not null
     AND TBL_NOTFS.STATE = 'STALE'
     AND TBL_NOTFS.COMPOSITENAME= cmpstName
     and TBL_NOTFS.COMPOSITEVERSION = cmpstVersion;
  
end

Ref: 
http://middlewarebylink.wordpress.com/2012/10/29/how-to-recover-stale-composite-instances-and-their-components/
https://blogs.oracle.com/ateamsoab2b/entry/list_of_all_states_from

MDS Export & Import

While migrating SOA composites from one instance to another instance, we also need to update the target system MDS.

To make sure that, the target system is having proper MDS artifacts, we can use Export & Import option available in EM console.

Steps to perform MDS export & import:
1. Login to Source system weblogic EM console. Expand SOA and right click on soa-infra. And select Administration --> MDS Configuration.
2. Click on Export Button on MDS Configuration screen and wait for 5-10 minutes.
3. After 5-10 minutes, the server will prompt you to save a zip file. Click on Save to save it into local machine.
4. After completion of zip file download, go to the location that where the file has been saved.
5. Select the zip file and extract it. Wait till extraction gets completed.
6. After zip file get extracted, 3 folders named apps,deployed-composites & soa will be created in the same folder.
7. Delete deployed-composites & soa folders.
8. After deletion, rename the zip file. For Ex: soa-infra_metadata--bkp.zip
9. Select apps folder and create a zip file.
10. Rename the zip file to soa-infra_metadata.zip
11. Login to Target system Weblogic EM console. Expand SOA and right click on soa-infra. And select Administration --> MDS Configuration.
12. Click on Browse button available under Import Section. A window will be displayed to select the zip file. Select the zip file created in step 10 i.e. soa-infra_metadata and click Ok.
13. Click on Import button to start MDS import to Target SOA server.
14. Wait till Import operation get completed. A confirmation message will be displayed on screen.
15. Go to Jdeveloper and create a MDS connection to SOA database and verify MDS artifacts.

BPM: LDAP Connection Issue

While assigning tasks in BPM engine, sometimes we may get following error due to connectivity issue with LDAP server.

Error:
javax.naming.NamingException: No LDAP Connection available to process request for DN: CN=xx,OU=xxx,DC=xx,DC=xx

To resolve this error, increase the amount of LDAP pool connections. Steps to increase connection pool size.

  • Go to $domaindir/config/fmwconfig/ovd/default directory
  • edit adapter.os_xml file
  • update maxpool size to 100
  • Save and restart Admin & manageed servers.

Reference: Virtualization Error 1 : No Ldap Connection Available To Process Request For Dn: Svcportaltestsync. [ID 1400500.1]

File not found exception while testing SOA Composite after redeployment

Some times following error will be thrown in SOA server logs, when we try to test the SOA composite after redeployment.

Error Message:

javax.servlet.ServletException: java.io.FileNotFoundException: /app/oracle/admin/soadomain/mserver/soadomain/servers/WLS_SOA2/tmp/_WL_user/soa-infra/xdzoxt/war/WEB-INF/default/BOMService!1.0*soa_3ceeabad-abcf-491c-a177-b99c29899113/bomdetailsprocess_client_ep/FabricProviderServlettest_en.js (No such file or directory)

To handle this error, follow these steps:

  • Shutdown SOA Server
  • Clear tmp folder under SOA server installation
  • Start SOA server