Friday, September 19, 2008

JSF 1.2 and Websphere 6.1

Long time since blogged was busy at work; so lets get down to the business.

Our systems team told us that WAS 7.0 is still a distant reality and we'll be having WAS 6.1 (whichever approved patch) for the project we are working on. In the technical stack from the architecture team, we were recommended to use JSF 1.2 and Java EE 5 both not supported by WAS 6.1. If we use JSP as view, we would have an issue in making this combo work; there was a conflict in one of the classes (I don't remember exactly even after trying to make the application first class loader). This is where Facelets would come into picture; facelets with JSF 1.2 would work fine when we set the class loader priority as application first. More reasons to use Facelets are that it’s a viewhandler purely created for JSF and it’s faster than using with JSP because of the conflicting lifecycles of JSP and JSF.

If we want to use JSF 1.2, we would require setting the class loader as application first to overide the in-built JSF implementation available with WAS 6.1. AFAIK, this would work fine when we use Facelets. If we feel we need to stick to JSF1.1 to avoid this scenario, Facelets wouldn't work with the Sun RI's implementation of JSF 1.1 but it does with the MyFaces implementation of the same and as also with Sun RI of JSF1.2.

So we need to decide on the following:
1. WAS 6.1 + MyFaces JSF 1.1 + Facelets (this might also require a class loader as application first in WAS, not sure about it).
2. WAS 6.1 + MyFaces JSF 1.2 + Facelets (this requires a class loader as application first in WAS for sure)
3. WAS 6.1 + Sun JSF 1.1 + JSP + any other AJAX control framework like Richfaces/Icefaces. (I'm not comfortable with this combination especially after reading on the benefits of using Facelets).

Most likely, we might go with option 2 probably after a blessing from the architecture team.

Saturday, September 6, 2008

Once more... this time I will

Its been sometimes since I wanted to be a Sun Certified Java Programmer. Something or other I just kept pushing things off, but this time I'm going to give it a hard shot. And maybe its for the reason that I've also bought a hard-bound copy of the SCJP 6 prep book by Kathy Sierra and Bert Bates. Yes folks, thats what I wanted to tell - the book is released. I got it from amazon - http://www.amazon.com/SCJP-Certified-Programmer-Java-310-065/dp/0071591060

If you are also in the same boat as me, all the very best to that.

Friday, September 5, 2008

Sun and RIA

JavaFX is being actively developed and once completed, it'll be a good bet in the RIA market. Per their direction, it is not recommended for developing commercial applications at this time as the contents of the JavaFX platform are subject to change, based on internal development schedules and customer feedback. One more thing that's making this curious is the new JavaFX script which is claimed to be superior to JavaScript and ActionScript. To keep a tab on the latest developments in this area, please add this to your favorites - http://www.javafx.com/. I really wanted to try my hand on this; lets see if we get some time for the same. One more interesting link for the same: http://forums.sun.com/category.jspa?categoryID=132

Happy learning...

Thursday, September 4, 2008

Websphere Application Server V6.1.0.15 on AIX Issue

We were developing a web application using Richfaces and managing the beans using Springs Variable Resolver. Richfaces was chosen because the features it provided aligned with the business requirements including the file upload feature. The development was done in Tomcat 6.0 and since we had to use Richfaces 3.2.1 GA, we had to run against JSF 1.2, even had to use nightly build 10 for an issue which I'll mention in the coming days. The production and UAT environment was decided to be WAS as part of the corporate decision. However, WAS didn't release Version 7 supporting Java EE 5 and had a tough time by loading the parent classes at last in version 6.1.0.11. Finally, we decided to bring one version down and so was with JSF. In order to use the upload functionality, we used Tomahawk (MyFaces). After a small but tight struggle, we were able to meet the deadline. The corporate systems team also upgraded to WAS 6.1.0.15. Had this been done before, I wouldn't have had issues as a tweak would've done the trick to use JSF 1.2 and ultimately Richfaces 3.2.1.
In parallel to UAT, we planned to run a load test during the off hours. The sample 5-user test with one iteration ran fine and with high hopes started 20 users with continous iterations for 30 minutes. The server crashed the first time in 20 minutes, then again in 15 minutes, a total of 5 crashes. Since it was towards the end of the lifecyle, we almost peed in our pants.
The core dump gave the following details:
Could not create the Java virtual machine.
Unhandled exception
Type=Segmentation error vmState=0x00000000
J9Generic_Signal_Number=00000004 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000033
Handler1=F113E110 Handler2=F113814C
R0=00000188 R1=3DCE23E8 R2=F117A7C0 R3=35AB1558
R4=00002AA8 R5=35AB4000 R6=000000B0 R7=1015B07D
R8=0015B07D R9=00000000 R10=00000000 R11=00000000
R12=59005335 R13=359D6800 R14=36658ACC R15=59FEBDF0
......................
......................
FPR29 0000000000000000 (f: 0.000000, d: 0.000000e+00)
FPR30 0000000000000000 (f: 0.000000, d: 0.000000e+00)
FPR31 0000000000000000 (f: 0.000000, d: 0.000000e+00)
Target=2_30_20071004_14218_bHdSMR (AIX 5.3)
CPU=ppc (4 logical CPUs) (0x200000000 RAM)
JVMDUMP006I Processing Dump Event "gpf", detail "" - Please Wait.

Since nothing was very clear in the dump file, we started investigating all possible avenues. One pattern that we studied during the first two crashes was the log file rotation, but that turned out to be a false alarm instead as we tried simulating it.We tried monitoring the memory but didn't find anything suspicious either.
Then we took the native_stderr.log that was generating and also verbosed the gc collection to check if there's any abnormal GC activity, but all that was shown was within control. Before each of the crash, the server was taking a dump and the reason cited for the behavior like "Type=Segmentation error vmState=0x00000000". For only one crash, I'm seeing the "Type=Segmentation error vmState=0x00050000" issue with more information like "Method_being_compiled=javax/faces/component/html/HtmlPanelGrid.getOnkeypress()Ljava/lang/String;" This made us to believe that it was a problem in the Just-In-Time (JIT) compiler; a work around for this was to disable JIT compilation at runtime. However, IBM docs warn us of performance degradation if that's done. This made us to look into a little more detail and was able to lay my hands on this: http://www-01.ibm.com/support/docview.wss?rs=0&uid=swg24019205

A gist of the same, there were some changes that were introduced in Websphere 6.1.0.15 which made WAS to be vulnerable to crash easily identifiable during any stress/load testing. PK64529 resolves this issue and it is available in the 2nd link provided above. The fix is available with Fix Pack 6.1.0.17 released on 3-Jun-2008.


We didn't upgrade to build 17, but installed the patch and the load testing continued with no issues. In fact, no failures, no errors, JVM heap usage hovering around 250M   min heap was set at 512M, Process CPU usage about 6%, the response time was also satisfactory.


So, if you've installed WAS 6.1.0.15 on AIX 5.3, please make sure you have the patch installed as well.

Exodus

It all started one fine day when the market was growing after the dot-com bust and I received a letter from Infosys, a IT major in India. The funny thing once I completed my selection test, I got infected with chicken-pox. I was full-day at bed but had a nice time since World Cup cricket was live on TV. Once I got partially cured, whooommmm.... there's a selection mail in my Inbox. The posting was in Pune far from Chennai where I'm based. Imagine the plight of staying away from home when you just got cured but passed the bait to your mother and sister.
But it was a fun ride from there and so were the days in Chennai. Not to forget the life at PERF2, where I started off playing with VSS, but ended up with my name tag in most of the java classes. Struts, Weblogic, Oracle, JSF, Spring were some of the milestones in this journey. Hope to pass across some more on the way.

Genesis

Close to six years into the software field and not a blog on my own in the field I work. Well, this is a chance.
Not a major been there done that freak, but a geek at heart who tried some and wishing to learn new stuffs out. There's a race where people are way ahead. I don't intend to win it, but be a part of it and try complete the lap.
So, lets get started...

On your mark, get-set-go!!!