Tuesday, February 5, 2019

TIBCO BW (BusinessWorks) and BE (BusinessEvents) Code Review Automation

As part of setting up DevOps pipeline for Continuous Integration / Continuous Deployment (CI – CD) for TIBCO BW (BusinessWorks) and BE (BusinessEvents), we used the BW Code Scanner and BE Code Scanner products from https://bwcodescanner.com. They are very comprehensive from code review perspective with 100+ rules for BW Code review and 75+ rules for BE Code Review. Automating this as part of DevOps pipeline helped us to focus the manual code reviews on Design and functional gaps.

BW Code Scanner and BE Code Scanner perform the static code review analysis for hard coded configurations, adherence to best practices, optimization opportunities and known patterns of defects. One interesting part about them is that they are very in-depth. BW Code Scanner, for example, traverses all the paths from each activity node in a process instance and evaluates the transitional conditions in all paths from Start to End while evaluating for missed configurations and missing transitions. In our case, we had a JMS Queue Receiver in client acknowledgment mode and it highlighted all the success and error paths from Start to End where there was no message confirmation. This helps to ensure that the message doesn’t end up in an infinite loop. In addition to this, it was doing dynamic global variable mapping, so, in the above case, even if the acknowledgment mode was configured as Global variable, it was able to detect based on value and highlight the paths where message confirmation is missing. Pretty comprehensive indeed.

Another interesting feature is SonarQube plugins for TIBCO BW 5.x, 6.x and BE. You can copy these plugins in the extensions folder of SonarQube and the code review results are pushed into SonarQube so that you can assign, track, add comments – all the niceties associated with SonarQube platform. In addition to these, they provide an override platform to customize the output report. This helped us reduce the severity of some of the rules, and ignore the rules that we did not agree with.

How to automate TIBCO BW Code Review with Jenkins and SonarQube – The steps
  1. We setup the command-line version of BWCodeScanner and BECodeScanner in one of the Jenkins slave nodes. This setup is needed to break the build.
  2. Copy the BW SonarQube plugin into extensions directory on Sonarqube server
  3. Install Sonarqube Scanner plugin for Jenkins
  4. In the Jenkins job, under Execute Sonarqube Scanner, configure the Analysis properties to configure Sonarqube server, any BW Code Scanner specific properties like license, override file path etc.
  5. We created the build parameters for source location, reports location etc. and added Build step to execute BW Code Scanner command line. They showed us similar configuration for the Enterprise Cloud version too, but we went with command line version.
  6. As part of the build setup, we piped these steps, so that SonarQube execution happens, pushing the results to Sonarqube server, then based on the parameter that we pass, the build is broken in command line execution for a specific threshold. For example, we configured BW Code Scanner command line to break the build whenever it finds a code violation of severity – Critical or above.
  7. As part of the DevOps pipeline, this would run code review analysis on the BW and BE projects, push the results to SonarQube, break the build if the code has any critical violations (customized by us) from the developers, and emails the code review report as excel sheet. Pretty nifty right !
  8. One interesting thing to note is that BW Code Scanner and BE Code Scanner support multiple projects even with Sonarqube plugin. So, for certain SVN repositories, we setup one job that would do a complete code review analysis across multiple projects in the repository and send one consolidated report as email.
  9. Enterprise on-premise version came with web version in addition to command line and we could just drop the WAR file in Tomcat and have a functional website where someone could just review the Source zip file or EAR files manually to get a consolidated Excel or PDF report.
Sample Report - Excel Project Details






Sample Report – Sonarqube Issues Report



References

Friday, May 6, 2016

My dear daughter - my princess

She opens her eyes,
and looks at me for the first time..
And I know instantly that,
she is my everything and everything I have is hers
She smiles at me for the first time,
brightens my life like never before
I hold her in my arms,
and I promise myself to get the world at her feet
When she takes her first steps towards me,
I experience the most significant achievement

I know that if I truly love her,
I have to let her go some day,
I have to let her live,
explore the world and discover herself
I know it's a long time away,
but the mere thought makes me sour
For now, I have nothing to fear,
as she puts her arms around me and sleeps on my shoulder

My little darling, my princess Medha,
I hope you realize that,
I will always love you unconditionally,
and always want the best for you, now and ever

Monday, May 2, 2016

Mapping Google App engine application to Namesilo domain

I just finished mapping a Google App engine application to a domain purchased from NameSilo.com. Needless to say, it was NOT an easy experience. Jotting down the steps in case, any one else plans to do the same and hopefully I can save you time.


  1. Go to AppEngine Dashboard and go to Settings page on left-hand side.
  2. Select Custom Domains page on the right hand page and click on Add Custom domain
  3. Under Add a New custom domain, in Step 1, give your domain name and click on Verify.
  4. This takes you to google webmasters page with link starting with https://www.google.com/webmasters/verification/verification?
  5. In Select your domain dropdown, select Other (last Option).
  6. Under Step 1 "Add the TXT record below to the DNS configuration for" copy the whole link starting with google-site-verification=xxxx. Keep this page open.
  7. Now, go to Namesilo domain manager and in the middle find "Add TXT/SPF" record link and paste the value in TEXT field. Leave HOSTNAME field blank. This is critical step and it took me a while to figure it out.
  8. Now go back to web master tools page and click Verify. Depending on your stars, it might take about 5 minutes for this to work and it might show error or unable to verify.
  9. Once this is done, go back to App Engine cloud console page. Sign out and sign back in. You should see that verification is done and the domain shows up under step 2.
  10. Under Step 2, select the domain in http://myDomainName.com. Under 3. it shows a bunch of A and AAAA records.
  11. Go back to Domain manager page on Namesilo and click on A and AAAA records and create these 8 entries. For each, even though google says host as @, leave it as blank as Namesilo rejects it. This also took me a while to figure out.
  12. Now you are all set. Type your domain name in new browser and it should work. If using chrome open incognito tab and type your domain name. It should now work since chrome caches and you probably tried in between when it was not working.
Forwarding www.myDomainName.com
  1. In App Engine settings page Under Step, there is sub-domain mapping link. Add www and click on Add. It shows CNAME record to be added. Now go to Namesilo and add this record there as is. CNAME as WWW and value as shown in the App Engine settings page. This did not work after creating this record for me, so I am not sure if this step is required.
  2. Now go back to Domain manager page, select the check box in front of domain, and click on Forward Domains above that gets activated on selecting check box.
  3. Now, scroll down and under forwarding address, fill as www.myDomainName.com and choose http in dropdown before.
  4. Select Forwarding method as permanent forwarding and Path Forwarding as Yes and click Submit.
Congratulations!! Now you are all set to access your app engine application at http://myDomainName.com and www.myDomainName.com

Update

It turns out the above forwarding for www broke the Entire thing, since I started getting Error 301, too many redirects. What happened was that NameSilo removed A entries and CNAME entry from above steps with their own copies. I had to delete those entries and recreate those entries for this work. I could not find a way to remove the forwarding to www.myDomainName.com but I see from NameSilo pages that when you edit DNS entries, forwarding is disabled automatically even though I see the Domain forwarding page with entry to www.myDomainName.com. I am getting mixed results with forwarding based on browser cache, but it is finally working both for naked domain - http://myDomainName.com and www.myDomainName.com, so I am all set.





Friday, June 6, 2014

Google App engine application with godaddy domain mapping issue

Recently, I had an issue with mapping a domain to the Google App engine application that I had built. 
I bought a domain - cinemahunter.com and setup forwarding on godaddy to redirect from http://cinemahunter.com to http://www.cinemahunter.com
In Google App Engine, I clicked on settings, and then Add Domain. It asked me for Google Apps, gave my domain name, it asked me to login to godaddy.com, I logged in successfully with the credentials and it was good. At this point, there are 2 steps outlined.
  1. Change how your naked domain (cinemahunter.com) is redirected. I have www in the textbox between http:// and .cinemahunter.com. It also said - You must change the A-record at your domain host for this change to take effect. I am assuming this is the forwarding that I setup in Godaddy. I clicked on continue
  2. Now it said to create a A record in DNS management page. I went to Godaddy and under A (host) I deleted the entry with IP - 50.63.202.22 and created 4 records with the following as specified in Google apps for Host @ points to 216.239.32.21, 216.239.34.21, 216.239.36.21, 216.239.38.21
I saved the changes twice in Godaddy. Also, I verified that under CName(Alias) www points to @.
At this point, I clicked on I completed the steps on Google Apps website. But when I try to access my website by typing www.cinemahunter.com or http://cinemahunter.com, I get the following error.
Google
  1. That’s an error.
The requested URL / was not found on this server. That’s all we know.
After hours of going round and round with several links from google searches, I figured out that most of the documentation was outdated for the domain mapping.
So for anyone else, having this issue, here is the resolution.
Google Apps is no longer free. You have to pay about $60 a year for the service. For Google App engine users, google started giving $50 upto maximum of 3 because of this issue. They stopped it after having a fix for directly mapping Google app engine to domain. Now you no longer need Google Apps and what you need to do is to go to https://console.developers.google.com and select your application. On the left hand side, click under App Engine --> settings. This will give you three steps
  1. If you haven't already, verify that you own the domain. It will then be added to the list in step 2. --> Give your domain name here and verify. Now it will take you to godaddy login page and you sign in with your credentials.
  2. Select the domain you want to point to. This will show nodomain even after domain is verified in step 1 below. This confused me. But I logged out and logged in and I saw the domain cinemahunter.com in the dropdown. There are two options here either the main domain or the sub-domain with www. I chose the sub-domain since I had forwarding setup in godaddy.
  3. Go to godaddy and under CName, under www change points to ghs.googlehosted.com.
Thats it!! It worked like a charm within a minute. Google makes it so difficult with all these changes. All the search results for mapping GAE to godaddy were old instructions which led to nowhere and the info on these changes were to be found only after digging deeply. Hopefully this will help someone without wasting some 8 hours like for me. Good luck !!

Wednesday, January 6, 2010

Migrating Firefox Profile from one computer to another

Recently, I had to get a new laptop at work since the lease on my old laptop had expired and it was acting weird. I transferred the data swiftly using this cord. But Firefox was a big deal since I stored a lot of bookmarks and passwords for some sites on the Firefox. First I tried copying the profiles folder directly but it didn't work and Firefox was giving me the message "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system." Here is how I got it working.

Lets say you want to transfer bookmarks, history, passwords from Computer A to Computer B. Firefox calls it profiles.

On Computer B, install firefox. Go to Windows Run, and type firefox -P. In the next screen click Create New profile, and give a name of your choice. Now go to (C or D drvive):\Documents and Settings\(your user id)\Application Data\Mozilla\Firefox\Profiles. Identify the profile you just created. You need to be able to see hidden folders to see this folder.

On Computer A go to the same location and the contents of your profile to a Flash drive and copy the contents. On Computer B, replace the contents of the profile folder you just created with the contents from the flash drive. Do this when Firefox is closed and you checked in Task Manager that its not running. That's all there is to it. Open firefox on Computer B and its exactly the same as Computer A with bookmarks, passwords and Master password too.

Friday, January 1, 2010

3 idiots - emphasizing the need to follow your passion

Saari umar hum mar marke jee liye,
ik pal tho ab hamein jeene dho jeene dho .....

Saari umar hum mar marke jee liye,
ik pal tho ab hamein jeene dho jeene dho .....

(All our life, we have been dead while we were alive, at least for a moment let us live, let us live..)

Give me some sunshine,
give me some rain,
Give me another chance,
I wanna grow up once again ...

The song above pretty much sums up the entire movie from a student's perspective. The pain in Joy Lobo when he just doesnt get another chance to follow up his passion and commits a suicide, haunts you long after you leave the movie theater. As Aamir puts it, Education is supposed to be about learning and growing wiser and not about cramming some lines from a textbook for an exam. In our search for riches and society-defined comfortable life, we lose the emphasis in following our passion, the passion that defines a meaning to our life. And yet, we put our children in the same path thinking about what Mr. Kapoors' and the like would think of our children if they don't become doctors or engineers. And the cycle never ends.

An excellent movie with an excellent emotional and comic mix, 3 idiots touches your heart though it takes some cinematic liberties. At the end of the day, "All izz well"

Do yourself a favor and watch it. If it doesn't make you change your lifestyle and the way of thinking, it will atleast make you think for some time about what your passion is and the meaning of life for you is. It will define the importance of following your passion which would be followed by success and not the vice-versa.

At the outset, I think it's a great move by my friend who chose to leave a society-defined great job and comfortable life style in USA to follow his passion through to India. I sincerely wish him all the very best in his endeavors...

And by the way Happy New year 2010 everyone...

Friday, December 18, 2009

Creating a routed queue between two Tibco EMS Servers with Authorization enabled

Imagine a scenario of creating a routed queue between two Tibco EMS servers A and B with home queue on B. Pretty simple right,

On server A, just define

create queue Q1@B secure, failsafe, global

Not so simple with Authorization enabled on the two servers. For messages to flow on routed queue, ServerA has to have ServerB as an authorized user to receive and ServerB has to have ServerA as an authorized user to send. So to setup the route properly with Authorization enabled the following has to be worked upon. This assumes that the route is already in place and the user ServerB is created on ServerA and the user ServerA is created on ServerB and Q1 is setup as a global queue on Server B.

Routing between two servers A and B

Q1 is on B (home queue) and we need to create a routed queue on A and send to B

On server A

create queue Q1@B secure, failsafe, global
grant queue Q1 user=ServerB receive

On Server B

grant queue Q1 user=ServerA send

Saturday, August 15, 2009

Conquering Gravity Master

Rads from Tunneling Thru posted about this game Gravity Master and I read her post on Friday evening. The game is simple yet complex in its own way but pretty interesting though. Involves Physics and common sense. Most levels were a breeze but some levels were indeed tricky. Finally I finished the game today, Saturday afternoon after spending like 2-3 hours in total. No googling, no cheating. Man, I was so happy after finishing it :) Here are the screenshots for those who are looking for proofs. I did not care about total score though since I was looking to finish the levels. If I have enough time someday, may be I will work on maximizing the scores :) Try it when you have time, its fun...


Saturday, February 14, 2009

Love or something like it...



One fine morning I saw you.
Oh God, I could not believe my eyes nor could my eyes believe me.
You saw me, approached me and gave me a gentle smile,
to give me a live canvas of Monalisa's smile.
You spoke to me, your words coming out like that of a gentle dew,
yet bringing into bloom the fairest thoughts of the world.
And then we became great friends,
You encouraged me to leave my hesitation,
You enchanted me to get my determination,
You enlightened the path from which I drew my inspiration,
You made me stand ahead of others in great position.
But by the time I came to tell you, how much
I love you, it was too late, for, you went away.
Leaving behind memories to stay.
Your memories still linger in my mind,
Your gracious picture spread over my heart,
and I put my thoughts into words to tell you
that I love you forever and ever and ever...


Tuesday, February 3, 2009

Configuring JDBC Datasource in Tomcat 5.0.28 in Eclipse WTP

I use Eclipse WTP for developing Web applications. In my previous post I mentioned that I changed the Database connection pool to use the Weblogic connection pool. The configuration in Weblogic was straightforward and simple, but it posed an issue for me during development because I was not able to configure the Datasource in the Installed Server Runtime in my Eclipse WTP. Either I had to use Reflection to supply the class and modify it between Environment deployments and local deployments or needed to fix the issue with Tomcat Datasource. The error that I was constantly getting was


ERROR DatabaseManager.getConnection - org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at com.pepsi.bdb.connections.DatabaseManager.getConnection(DatabaseManager.java:36)


Googling the error wasn't very fruitful because it mostly dealt with configuring Datasource in Tomcat directly, but not much information was available on configuring with Eclipse WTP. Also, there were several ways of configuring it mentioned in Serverside website and none seem to work for me. Finally I figured it out today and here is how I did

In Eclipse WTP, expand the configured Server under Servers, you will see a file server.xml. This is a copy of the server.xml file that Eclipse creates for you, but uses the libs from the Tomcat folder you configured. In this file add your Datasource under the tag <GlobalNamingResources> as shown below:


<GlobalNamingResources>
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<Resource auth="Container" description="User database that can be updated and saved" name="UserDatabase" type="org.apache.catalina.UserDatabase"/>
<Resource name="myDbPool" type="javax.sql.DataSource"/>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
<ResourceParams name="myDbPool">
<parameter>
<name>validationQuery</name>
<value>select * from dual</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>4</value>
</parameter>
<parameter>
<name>password</name>
<value>(password)</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@(servername):(portNum):(SID)</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>2</value>
</parameter>
<parameter>
<name>username</name>
<value>(username)</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>


Go to the folder where your server is actually located and place the jar file ojdbc14.jar (for Java 1.4, for lower versions, uses classes12.jar) in the folder %TOMCAT_HOME%\common\lib.

In the server.xml on the Eclipse, place an entry inside the <Context> element of your application that is inside the <Host> element as below:


<Context docBase="myApp" path="/myApp" reloadable="true" source="org.eclipse.jst.j2ee.server:myApp">
<ResourceLink name="myDbPool" global="myDbPool" type="javax.sql.DataSource"/>
</Context>


That is it. This did the trick for me. For the web.xml entry inside your web application and Java code, refer to my previous post.