Sunday, September 22, 2013

Installing DSUI Application on MDM 10.1

This post will help you quickly install the DSUI EAR application provided as part of the MDM installable.
Prereq:
You should have MDM 10.1 ,installed and running .
I am using WAS 8.0.0.5 &  RSA 8.0.4.2

Step1 : Locating the DSUI App

MDM1010_WAS_AIX.tar ->MDM->WAS.jar->MDM->installableApps->
Take out the MDMDataStewardship.ear

Step2 : Dont jump into installing the ear , like I did :(
We have to make a few modifications before we could install this default app.
a)Set UserGroupImpl in mdmUIConfiguration.properites (you can find it in propertiesUI.jar) and re deploy
  1. When deployed on a IBM WebSphere use UserGroupImpl=com.ibm.mdm.ui.registry.WASUserGroupImpl
  2. When deployed on a BEA WebLogic use UserGroupImpl=com.ibm.mdm.ui.registry.BEAUserGroupImpl  
Error/Issue you can expect ,if you fail to set the above:
SystemOut O ERROR - Log_UserRoleUtil_FailGetUserGroup
java.lang.ClassNotFoundException:

b)Change the provider URL.
java.naming.provider.url=corbaloc:iiop: hostname:rmiport

Error/Issue you can expect ,if you fail to set the above:

The  drop downs in your DSUI will not be populated.(because DSUI was not able to connect to MDM to look up the code tables)

I used WinRAR for making the changes to the ear  ,you could use your favorite  application ,but make sure you have the changes reflected in the EAR.

Step3:Proceed to Install.
Install it as any normal web application manually.(Use Fast path with all defaults)

Step4:Configuring the JavaServer Faces (JSF) provider 

Login to  Administrative Console , choose Applications > Application Types > WebSphere enterprise applications > YourDSUIApplication> JSP and JSF options 
Select Sun RI1.2. from the drop down.
If you forget to set this , you will encounter the JSF- UI issue.

com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: Servlet Error-[/timeout.jsp]: java.lang.RuntimeException: FacesContext not found
at javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:324)
at javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:226)
at com.ibm._jsp._timeout._jspService(_timeout.java:122)


Step 5: Restart your WAS and try the DSUI URL.
eg:
http://localhost:9081/CustomerDataStewardshipWeb/

Step 6: Resolving UI display and link issues when deployed with security off(If you face any UI issues)

http://www-01.ibm.com/support/docview.wss?uid=swg21612969


If the following setting is unchecked, then the UI starts working as expected.  Use the following
steps.
1.  In WAS, go to  Servers > Server Types> WebSphere Application servers > >
session management > enable cookies > Restrict cookies to HTTPS sessions.
2.  Uncheck Restrict cookies to HTTPS sessions.
3.  Click OK, and then click Save.
4.  Synchronize the nodes.
5.  Restart the Application Server.
Step 7:Start using your DSUI App.


Saturday, April 13, 2013

Setting Up MDM Batch Processor in Windows Development Environment

One of my IBM collegue asked me for help in setting up a batch processor in his machine a while ago.
But I have never setup one in my local at that time and was not aware about  such a possility exist.

I was thinking I need to install cygwin or simulator to replicate the unix behaviour in windows.I came across a MDM Workbench blog which was quiet useful in setting it up.

It is quiet simple.
1)Set up/Install the MDMBatch.ear in your WAS along with your MDM.
2)Use the Batch Process client (windows bat) version to call the EJB located in the MDMBatch.ear
3)The EJB will internally invoke the DWLServiceController which is the entry point to the MDM.

The whole process will take less than 20mins , I am ready tos put money on the table :)

Assumption:
You already have MDM working in you machine.Nothing more.

1)Locate the MDMBatch.ear(eg: It may be in C:\MDM\UNPACK directory) - 30 secs
2)Install the EAR in WAS .Use Fast Path (No need for Detailed path) - 2mins
3)Save & Restart your WAS - 5 min
4)Copy the ClientBatchProcessor(Provided along  with the post in ) in  your C drive -10 sec
5)Locate runabtch.bat(under bin) and double check the following - 5 min
      a)set WAS_HOME="C:\IBM\SDP\runtimes\base_v7" - Edit as per your location
      b)set DWL_BATCH_HOME="C:\ClientBatchProcessor"

6)Open Batch.properties ,Edit
ServerConfiguration.provider_url = corbaloc:iiop:localhost:2813(Change the port as you wish)
ServerConfiguration.context_factory = com.ibm.websphere.naming.WsnInitialContextFactory
(Change the above propery if you are using Weblogic,else leave as such)
   
7) Create a Single Line XML - 3 min
              a)Use Notepad++  or any of your favourite editor
              b)If Notepad++(Plugins ->XMLTools->Linierise XML)
Install the XML Tools plugin in NP++ to easily perform Step 7 b.
For now I have provide you one under the bin(addOrgBatch.xml)

8)Keep the XML under bin -  10 sec
9)Execute runbatch.bat .xml  logs - 10 sec

where logs is the log file directory name , I have already kept that under bin for you.
The log folder will have your batchLoadFail.out ,batchLoadSuccess.out.

References:
a)MDM Workbench Blog

b)Information Center
http://pic.dhe.ibm.com/infocenter/mdm/v10r0m0/index.jsp?topic=%2Fcom.ibm.mdmhs.und.plan.doc%2Fc_Batch_Processing_of_Transactions_using_the_Batch_Framework_and_the_Batch_Transaction_Processor.html

c)http://www-01.ibm.com/support/docview.wss?uid=swg21574707


Client Batch Processor.zip
https://docs.google.com/file/d/0B3obvedGI1lvNVVnQmR4a0pTNlk/edit?usp=sharing





             
   




Tuesday, February 19, 2013

Enable SQL Logging for MDM Server Transaction

When ever somethings behave unexpectedly on the MDM side especially when the performance of a trasnaction is bad, we often start thinking about grabbing the sql of a transaction.

There are mutiple ways to do so ,but the easiest one for developers seems to be enabling the Websphere trace logging.


How to do that?

In the Admin console :
Logging and Tracing > server1 > Diagnostic trace service > Change log detail levels

Under Runtime :
*=info: RRA=all: EJBContainer=all: com.ibm.ws.database.*=all: com.ibm.ws.db2.*=all

The above setting will make the JDBC adapter which connects your WAS to the DB2 or any database to log the sqls.

This is totally a WAS config and has nothign to do with MDM.

Please execute one of the MDM transactions.

Look for the trace.log file
It will be located in the log folder of your profile

Eg:C:\IBM\SDP\runtimes\base_v7\profiles\AppSrv01\logs\server1

Open the file and search for "prepareStatement Entry "

Hope this helps!


Monday, September 24, 2012

Transaction Audit Information Log - TAIL



TAIL :


Transaction Audit Information Log is a component in MDM Server used to store the audit information associated with mdm server transactions.


This component will be helpful when we are tracking a particular transaction/particualr set of transaction for its behaviour.


For eg: how many times a custom BP is getting invoked,what all are the channels invoking it,what time we are having maximum load/request for a particular transaction etc.


From the name itself it says ,it is an inforamtion log ,so the information should be stored somewhere so that it can be retreived.


The main tables are TRANSACTIONLOG,TRANSACTIONLOGERR(i think it is there only from 9.0.x++) not sure about the lower version.
(A few more tables to log the keys like party id etc are availble pls refere the developer guide for them )
Then how do we retreive these info from the tables ?
Hey we got OOTB transactions like getTransactionLog to do so.
I will try to give a high level picture about the configurations required for enabling TAIL in MDM.


Global :
The TAIL feature is enabled by setting the following property in CONFIGELEMENT
/IBM/DWLCommonServices/TAIL/enabled to true.


By default it will be disbaled.
This configuration we call as the global tail configuration.
Now there are 2 flavours of TAIL.


Sync vs Asycn


I know you already guessed out the difference from the name.


The difference is ,for synchronus behaviour ,the TAIL information should gets lgged along with the transaction as a single unit of work.


i.e the transaction for eg:addPerson(for which we enabled TAIL) is complete only after the TAIL info is logged in the TAIL tables.


In the asychronus way the TAIL info are pushed to TAILQueue(hope u remember this queue-if u dont then have alook at the AdminConsole for the queue configurations) first.


But we cannot run our getTransactionLog txn against a data in the queue,hence what will we do ?


We should have our data some how in the table.Dont worry about that.There is an MDB(Message Driven Bean) TAILMDB which listens to the TAILQueue.


So when ever a message is placed in the tail queue the onMessage() of the MDB gets invoked and this function will call the addTransactionLog function and


write the data to our tables.Hence writing to the tables happens as a seperate unit of work and doesnt stops you transctions(say addPerson) from being complete.


Hence it is called asynchronus.
The configuration for this is /IBM/DWLCommonServices/TAIL/Asynchronous/enabled should be true to enable the same.


Now we need to define for which transaction the TAIL should be enabled.This is done at the CDBUSINESSTXTP with the LOG_IND.


Set this to Y for transactions you need to have the TAIL enabled.There is again a concept of external vs internal transaction which is clearly explained in the developer guide.


Now one behaviour of TAIL we observed is.Assume we have disabled TAIL for a composite transaction in CDBUSINESSTXTP.The global and async are enabled.
i.e
/IBM/DWLCommonServices/TAIL/enabled TRUE


/IBM/DWLCommonServices/TAIL/Asynchronous/enabled TRUE


addCustomer - CDBUSINESSTXTP N


When the transaction say addCustomer(say implemented as a BP) runs successfully nothing will be logged in the tables as we have disbaled tail in the CDBUSINESSTXTP.


But for failures in the transaction the details will be logged in the table.This is governed by another property


/IBM/DWLCommonServices/TAIL/LogNegativeCompositeTransaction/enabled.If the property is enabled I mean set to TRUE , it will log the failures and it will do it for composites only.Look for transactionlogerr table for the error reson code and the error message.

Consider the case where you want to enable TAIL for a custom business proxy ,say maintainCustomerBP(which add/updates).
Enable :
maintainCustomerBP - CDBUSINESSTXTP Y BUSINESS_TX_TP_CD (say 200000).
Also you want to log the party id which is getting add/updated in the EXTERNALLOGTXNKEY.
The transactions called from a BP will not get logged in the TRANSACTIONLOG.(i.e addPerson,addContract,updateParty etc
 called from the custom BP doesnt gets logged even if you enable them in CDBUSINESSTXTP).
To log the partyid,contract id you need to do the below config.
I have an extensio for both if you dont have just use Party or Contract.
INSERT INTO EXTERNALTXNKEY(EXTERN_TX_KEY_ID,BUSINESS_TX_TP_CD,APPLICATION,GROUP_NAME,ELEMENT_NAME,LAST_UPDATE_USER,LAST_UPDATE_DT)
  VALUES(PK1,200000,'TCRM','XPersonBObjExt','PartyId','cusadmin',CURRENT_TIMESTAMP);
 
  
  INSERT INTO EXTERNALTXNKEY(EXTERN_TX_KEY_ID,BUSINESS_TX_TP_CD,APPLICATION,GROUP_NAME,ELEMENT_NAME,LAST_UPDATE_USER,LAST_UPDATE_DT)
  VALUES(PK2,200000,'TCRM','XContractBObjExt','ContractIdPK','cusadmin',CURRENT_TIMESTAMP);
With the above config ,you will start seeing entries in your  EXTERNALLOGTXNKEY.





Tuesday, September 18, 2012

Exploring Websphere(WAS) default queues using WAS Admin Console

This is has got very less to do with MDM .

But it can come handy for people working on EM,Notifcaiotns etc and using the WAS default queue instead of a WMQ for their development works.
Most of the time I wondered about how easy it could have been if there is something like MQ explorer available with WMQ  in  WAS admin console to explore the default queues.

I noticed that it is available in WAS 7(may be even available with 6.1 ) .You can use the following path to explore the messages in the default queues.


Admin console Resources->JMS->Queues > Customer Tail(Your Queue) > Buses > MDM.SIB.server1 > Destinations > CUSTOMER.TAIL(Your Queue) > Queue points > CUSTOMER.TAIL@MDMNode01.server1-MDM.SIB.server1(Runtime) > Messages

You can view the Message body too along with other properties like when the message is placed at the queue etc