Thursday, January 8, 2015

They stole my idea...

... but I am happy :)

Many years back I used to dream of a small pocket size PC with a USB/video port that you could plug to any screen or better even to any other computer (laptop/desktop) etc

No need to carry bulky laptops etc. Just carry what you need, rest of the heavy stuff like display, more processing power, electricity etc can be provided by the host machine.
In 2015 CES Intel came up with something similar and boy I like it.


Thursday, November 27, 2014

Jenkins (Hudson) - Easier than thought...


I always had fascination for automated build systems. For me it was always some magic happening behind those web pages.
Recently I got a chance to unravel the magic by doing a Jenkins install. To be honest it was really really simple; easier than configuring tomcat. Below steps are just high level view to let you know how simple it is, for proper steps please refer the Jenkins site

High level steps:
  1. Download Jenkins WAR
  2. Run with Java (Java -jar jenkins.war). Jenkins war comes with inbuilt jetty, so no need to have a separate container
  3. Configure few properties in the Jenkins web page like JAVA_HOME, ANT you want to use.
  4. Configure the Job (Project)
    1. Specify the source control tool: For us it was perforce, with a very easy to use Jenkins Perforce plug-in the config was simple. Just create a separate perforce work-space that Jenkins will use to sync the code, provide user id etc.
    2. Specify the build file (for us ANT), targets etc.
    3. Specify the polling interval.
That’s it.

Fired some build manually to check if everything was working fine.
Next morning the build ran as per the schedule, it even synced the code taking latest change lists.
Still looks like magic ... :)

Pitfalls:
  1. Initially whole build was OK, but the Dojo part was failing with errors giving hint that there is some path issue. After losing one day, realized that dojo build fails if the path contains a “.”. Jenkins by default creates a home directory by name “.Jenkins” in the user directory and all project, job etc are synced there only. So to avoid any such issue, before you start Jenkins for the first time: Create a system variable by the name of “JENKINS_HOME”, and give a path of your choice.
  2. First time also faced some issue where build was not able to create / update some files. Had to manually set the source folders/files writeable. 

Wednesday, November 5, 2014

Profiling WebSphere Liberty


Took up the job to profile the application I am working on. As WAS Liberty is my favourite app server, wanted to do the profiling on that only.
Tried various tools like VisualVM, JProfiler etc. But even after lot of search couldn't find a good page describing how to enable the application for profiling. Looks like some JMX port configuration is required, didn't check further.

Then tried IBM Heath Center. Initially I was bit sceptical as a related IBM tool - 'Support assistant' is very heavy and had bad experience with it in the past.

But I was pleasantly surprised the way IHC was so easy to install and configure. And good thing, it works with IBM JDK out of the box :)

So below are the steps:

1) Install 'Health Center'

2) Enable the application we need to profile, in our case the Liberty server.
In the Eclipse Liberty Server project, edit the jvm.options file, add following lines:
-Xhealthcenter:port=1973
-agentlib:healthcenter

Start the server. In the startup log you should see:  
INFO: Health Center agent started on port 1973

Port can vary as per your setup

3) Connect the health center
Open the HC perspective: Window -> Open Perspective > Health Center Status Summary
File -> New Connection...' . Specify the port mentioned in the log.
Start using the application and the agent will start collecting the information and display in neat interface.

Thursday, October 9, 2014

Lets FACE it...

Looks like my escapade with App Servers has not finished.

After finishing the work on WAS Liberty, I realized that we were at old servlet api version 2.4. Though wanted to move to 3.0, but Weblogic 11GR1 does not support that. So bumped up the version to 2.5. Everything seemed like working until people using weblogic in the team faced issues in deployment itself.
The application failed to even deploy on Weblogic with error : java.lang.ClassNotFoundException: javax.faces.webapp.UIComponentTag.

Surprisingly we don't even use JSF or any faces implementation. Went back to my old friend 'google' and found that internet filled with posts from poor souls like me. After going through lots of pages finally found a page which solved the issue.

In struts libraries there is a jar → struts-faces.jar. If this jar is present in your lib folder, weblogic seems to look for faces related libs and hence the issue.

But funny part is - its all working well with servlet 2.4 declaration in web.xml. Its also working well with 2.5 version declaration in WAS. grrrrr....


Tuesday, September 30, 2014

Eclipse debugger out of sync

Recently faced an issue where while debugging a project (Eclipse, WAS Liberty, RHEL 6.5), I faced the common issue of 'Code not in sync' with the break point.
Checked all the usual suspects - Project clean, server restart, even restarted  Eclipse. No use.
Then I checked the Liberty deploy folder. I was using the "Run from Workspace" option in Eclipse/WAS Liberty. In this Liberty will simply create an XML file at WASInstallDIR//usr/servers/defaultServer/apps, with the name of your-project.xml

Checked the file and wallah found it.

I had recently duplicated my dev environment, one for checkins, and one for checking out large changes before actually making them part of source control. During this copy-paste, project-name.xml was also copied along with Liberty. And Surprisingly, even though I added and removed the project from the Liberty Server multiple times, Liberty was still using the old XML and hence pointing to my old project.
Hufff... Hours lost but lessons learned.