Eclipse or SUNrise...

Eclipse or SUNrise...
...JAVA for sure

Thursday, December 27, 2012

IBM WebSphere Portal 8: Web Experience Factory and the Cloud by Packt book review

I just received a new nice, book titled IBM WebSphere Portal 8: Web Experience Factory and the Cloud. My personal experience with portal based solutions is that in most cases it is overrated piece of software. It has a great marketing and with fancy and colorful layouts it seems it can do everything a user could possibly ask for. However in the end it can bring more trouble than upsides... That is what my experience tells me. And since this book seems to be a hands-on, experience based publication it got my interest.

My interest with the book was also brought by the content of the foreword of the book, in which I read that "Portal can provide an integration and aggregation point for all of your existing systems...". Yeah, right! This is a role of some Broker platform, something that I would call ESB, not a front-end platform like Portal. From the other hand, I read "...These types of large projects [portal projects] can bring out the best and the worst of company’s internal processes and systems. In some ways, they can be the most challenging projects on the planning board.". Beautifully said! Totally agree on that one!

With that said, I’ll go through the book to find out the authors experience and approach to Portal problems. I will post my review of the book in my future posts.

You can find the book here.

Saturday, November 10, 2012

Liberty Profile uConference in Warsaw

If you're interested with Liberty and want to learn about this new and fresh technology, I invite you to a short conference where me and my colegues (Jacek Laskowski will be one of the speakers) will talk about the Liberty Profile diffrent aspects all within maximum of 4 hours:

  • Introdution to Liberty Profile concepts
  • Working with Liberty Profile (installation, configuration, etc.)
  • Writing JEE applications (integration with LDAP sample)
  • Working with Liberty Profile and the WebSphere eXtreme Scale
  • Administration of the Liberty Profile

Here is the flayer and the main info of the event:

It will be held on 14 November 2012 in Warsaw in IBM's Poland facility (the address is 1 Sieprnia 8, building A, room A).

Thursday, September 20, 2012

Liberty profile locale setting

While working on the new RedBook for WebSphere Application Server V8.5 (you can download a draft version here) I didn't add any example of configuring the servers locale. Since I often work with many environments that use non-English locale, I often suffer from the logs written by the servers or Java runtime that are produced in Polish language. And even if it is my native language, the translation makes them totally incomprehensible... trust me ;-). My rule of the thumb in this matter is to always use English at least for the environment logs. This way it will be much easier to find a solution and if the environment has some sort of support, most of the times, the support will require us to gather the logs in English. This is what you will see if you start the Liberty profile server using Java with a default Polish locale:
Uruchamianie serwera server2 (wlp-1.0.0.20120428-1251/websphere-kernel_1.0.0)
w Java HotSpot(TM) Client VM, wersja 1.6.0_21-b07 (pl_PL) [AUDIT ] CWWKE0001I: Serwer server2 został uruchomiony. [AUDIT ] J2CA8004I: Zasób dataSource MyDataSource jest dostępny jako
jdbc/MyDataSource. [AUDIT ] J2CA8000I: Zasób jdbcDriver DerbyEmbedded jest dostępny. [AUDIT ] CWWKZ0058I: Monitorowanie aplikacji w katalogu dropins. [AUDIT ] CWWKT0016I: Dostępna aplikacja WWW (default_host):
http://localhost:9081/ITSOWebCustomerCredit/* [AUDIT ] CWWKZ0001I: Aplikacja ITSOWebCustomerCredit2 została
uruchomiona w ciągu 1.391 sek. [AUDIT ] CWWKF0011I: Serwer server2 jest gotowy do działania w
trybie Mądrzejszy Świat
Notice the pl_PL locale. To change it, just put this line into a jvm.options file (you will require to create this file - it is not generated by default).
-Duser.language=en
Now you have two options - if you want to make this change global for all servers, put it in the etc directory (it is also not generated by default) in main Liberty profile folder. If you want to just make this change to a given server, put this file next to the main server.xml configuration file. Remember that if you put it there, it will override the global settings from the etc directory. Now this is the new log produced by the server - the locale is en_PL, which means language is English, but country is Poland.
Launching server2 (wlp-1.0.0.20120428-1251/websphere-kernel_1.0.0) 
on Java HotSpot(TM) Client VM, version 1.6.0_21-b07 (en_PL) [AUDIT ] CWWKE0001I: The server server2 has been launched. [AUDIT ] J2CA8004I: The dataSource MyDataSource is available as
jdbc/MyDataSource. [AUDIT ] J2CA8000I: The jdbcDriver DerbyEmbedded is available. [AUDIT ] CWWKZ0058I: Monitoring dropins for applications. [AUDIT ] CWWKT0016I: Web application available (default_host):
http://localhost:9081/ITSOWebCustomerCredit/* [AUDIT ] CWWKZ0001I: Application ITSOWebCustomerCredit2 started in
1.109 seconds. [AUDIT ] CWWKF0011I: The server server2 is ready to run a smarter planet.
To learn more about the Liberty profile directory structure, the configuration files and a lot more I encourage you to check out the chapter 6 Liberty Profile from the WAS v8.5 RedBook. Hope you like it ;-)

Wednesday, January 25, 2012

IBMs WAIT analysis tool

Today I would like to write a few words about a tool, that can be very helpful in performing JVM analysis. It is called WAIT which means Whole-system Analysis of Idle Time. The tool is exposed by IBM in the Internet and the good news is that it is free! There is also another good news, it can analyze not only IBM's JVM, but also other vendors so Open Source is welcome (yay!!).

There are however couple of problems with it, but I'll leave them for later. Now, what can it do and how it works...

First of all, this tool analyze the standard memory and thread dumps, that are generated by JVM so it can see what is utilized (for example I/O operations or HTTP traffic), so it won't tell us more than a usual, also free tool from IBM (Support Assistant) can tell us. But the great thing about WAIT is, that it will process multiple heap files at once and create a report from all of them lined up with a time-line, so we can see how the JVM load looked like over a time. To be honest, I never liked the ISA tool. In my opinion it is buggy, slow and unstable. It can drill in the analyzed files really deep, but it is not easy to use. The WAIT won't show you as much as ISA, but in most of the cases you are interested in overall performance and the bottlenecks, so lets see how WAIT works.

In order to allow this tool to analyze multiple files, there is a simple script for each platform (Linux/AIX, Windows and z/OS) that you have to download and copy to your environment. Then, you just run it against a PID of your JVM process, it will start grabbing the JVM dumps (it will do it with kill -3 command). When you think, the script gather enough files you simply hit ctrl+c to terminate it. The script is prepared for this interruption so when it will receive such signal, it will compress all the gathered files into a single archive. Bellow there is a sample script run, the 290990 327682 and 376870 are the pids of my JVM processes:

./waitDataCollector.sh 290990 327682 376870
Switching to bash

WAIT data collector!
-------------------
Collector version 7.0
Collecting data for PIDs: 290990 327682 376870
Sleep time between java cores: 30
Number of iterations to collect: 300
Sleep time between ps invocations: 8
Raw data being stored in is in /tmp/waitCollectionData.CollectorPid_405602

Found websphere log directory for PID 290990: [/ibm/WebSphere/AppServer/profiles/xxx/logs/xxx_Srv01]

Found websphere log directory for PID 327682: [/ibm/WebSphere/AppServer/profiles/xxx/logs/nodeagent]

Press CTRL-C to stop collection and gather data


Triggering snapshot 1: ( 20120118 13:21:35:%N GMT)
Triggering kill -3 for 290990
Triggering kill -3 for 327682
Triggering kill -3 for 376870

Triggering snapshot 2: ( 20120118 13:22:09:%N GMT)
Triggering kill -3 for 290990
Triggering kill -3 for 327682
Triggering kill -3 for 376870
Collected 3 IBM javacores

Triggering snapshot 3: ( 20120118 13:22:42:%N GMT)
Triggering kill -3 for 290990
Triggering kill -3 for 327682
Triggering kill -3 for 376870
Collected 3 IBM javacores

Triggering snapshot 4: ( 20120118 13:23:15:%N GMT)
Triggering kill -3 for 290990
Triggering kill -3 for 327682
Triggering kill -3 for 376870
Collected 3 IBM javacores

Triggering snapshot 5: ( 20120118 13:23:47:%N GMT)
Triggering kill -3 for 290990
Triggering kill -3 for 327682
Triggering kill -3 for 376870
Collected 3 IBM javacores

Triggering snapshot 6: ( 20120118 13:24:20:%N GMT)
Triggering kill -3 for 290990
Triggering kill -3 for 327682
Triggering kill -3 for 376870
Collected 3 IBM javacores

Triggering snapshot 7: ( 20120118 13:24:53:%N GMT)
Triggering kill -3 for 290990
Triggering kill -3 for 327682
Triggering kill -3 for 376870
Collected 3 IBM javacores

Triggering snapshot 8: ( 20120118 13:25:25:%N GMT)
Triggering kill -3 for 290990
Triggering kill -3 for 327682
Triggering kill -3 for 376870
Collected 3 IBM javacores

Triggering snapshot 9: ( 20120118 13:25:58:%N GMT)
Triggering kill -3 for 290990
Triggering kill -3 for 327682
Triggering kill -3 for 376870
Collected 3 IBM javacores

Triggering snapshot 10: ( 20120118 13:26:31:%N GMT)
Triggering kill -3 for 290990
Triggering kill -3 for 327682
Triggering kill -3 for 376870
^CCollected 3 IBM javacores

Zipping up wait data found in /tmp/waitCollectionData.CollectorPid_405602
Trying gzip
Collected data stored in waitData.tar.gz
Collected 30 javacores total
Cleaning up raw data dir from [/tmp/waitCollectionData.CollectorPid_405602]

Please submit waitData.tar.gz to the wait server to see a WAIT report

Simple? Sure it is, and it should be! It is great that, you don't have to install any additional software on your machines. I tried it on AIX system and I got no problems. Now all you have to do is to upload the file to the WAIT site.

Ok, so how the analysis look like? Here is an example of my work. I configured my script to grab a snapshot every 10 seconds and I left it to run for 5 minutes to have a better overall overview. It was a WebSphere Process Server JVM version 5. After uploading you will see a dynamic view of this kind:

As you can see, there are 3 graphs with a common time-line, first show the CPU utilization, second shows the number of running threads in the JVM and the last one is showing how the threads are utilized (for example if the are working or waiting). Bellow the graphs you have additional panels that drill deeper in other aspect - if you click on the chart they will display what is going on at that moment. The second image shows you this panel:

I don't want to drill in the analysis stuff in this post, I just marked the interesting stuff that you can see on the charts. I'll deal with it in another post

IBM WAIT is a cool tool, but it suffered with some problems lately. For example there was a problem with their certificate that was revoked... This doesn't sound professional, but hopefully they will keep a valid certificate and the page will be kept fully accessible. Right now it is and they used a real CA cert from GeoTrust so I hope it will remain OK. Ahhh, right - the ssl. There is an important reason why they use SSL, because remember that if you upload files from the production environments, you transfer your clients data so this is critical to be safe. Before each analysis you will also have to agree on their terms which sounds reasonable.

Friday, January 13, 2012

Orange belt

It's been 3 days when I discovered the cool Black Belt Knowledge community and I already have the 3rd, orange belt in Java ;-). Yes, it is a long way to the black one, but with this post I want to express how absorbing is this site! My further experience with the site is great. You are encouraged to take new exams with funny attributes like a champagne when you gain a new belt or a milk to help your students (when you are a mentor). To get new exams I had to participate in beta questions - review and vote on couple of them and this is a perfect way to learn. The more points you get, the more influence you have (for example you can create new questions).

This is an excelent place to learn not only Java but also other technologies like frameworks or database stuff

I put a new gadget on the right panel with my current belt to be even more motivated to earn new blackbelt level :-)

Monday, January 9, 2012

About Black Belt Factory

Couple of days ago I thought that it would be nice to refresh my Java knowledge. My current work forces me to use many solid products which are based on Java, but there is less space for pure Java coding. With the new Java release 7, it would be nice to stop for a moment and update my knowledge.

Browsing through the internet, I found out Jacek Laskowski's post (in Polish) mentioning about the Black Belt Factory. Jacek wrote, that he used this site to update his Java knowledge. I also gave it a try and I'm amazed. This service is so cool. By earning points you are allowed to take exams to earn belts - just like in the martial arts. The process of earning points is also a learning process, where you learn about the staff you're interested by contributing in the sites resources (for example by judging beta exams, that are under development).

I am really into this. I don't have any belt in martial arts, but I will have one in Java for sure! I'll write more about my experience with this community!

I will end this post with the masters Miyagi quote:

We make sacred pact. I promise teach karate to you, you promise learn. I say, you do, no questions.