Wednesday May 06, 2009

One year ago I became certified as a Java Programmer. This year, I took advantage of the free voucher program that Sun offers to its employees to pass the Java Developer certification.

The Java Programmer certification tests the understanding of the language, and of its core APIs. The Java Developer certification is the next level. It tests the ability to complete a full project. I was given an assignment and had to work on it at my own pace (there's a one year time limit). Then I submitted my work, which was reviewed by an assessor. At the time of submission, I also had to take a written test at a Prometric center, where detailed questions about the code were asked. This written test is mainly to ensure that I was the one who wrote the submitted code.

The assignment is not 100% precise on all aspects, and I had to make choices. This decision-making process is also part of the grading

The Database part of the project must implement a Java interface that is specified in the assignment. The assessor runs some automated tests against that API, and the tests must pass. As Sun do not publish these automated tests, I wrote a lot of unit tests to make sure all aspects of the API were covered and worked.

It is not specified in the assignment if logging should be used. From what I saw on the JavaRanch forum, some people remove all logging code just before submission, to be safe in case there's a problem in the logging code itself. I decided to keep it, because that's what we do in "real" applications: we don't remove logging before shipping. It is possible that it lowered the score I got on the General Considerations part (see below).

I generated some UML diagrams (with NetBeans) to clarify the relationships of the different interfaces and classes, and included it in the Javadoc. I felt this made the overall structure easier to understand.

It took exactly 4 weeks after submission and written exam, to get the results.

There are different possible assignments, the one I got is known as Bodgitt and Scraper 2.2.3.

It took me 3 months to complete the work, and I estimate the time spent on it to be around 100 hours. On these, about 50 hours were the actual code writing, testing, documenting and debugging, and 50 were on doing research: on the different design patterns that could be used, on trying different locking strategies to compare performance, on trying the different network approaches and comparing them, and trying different tools to generate UML from code,... This takes time as it forced me to look for solutions that were not familiar, and this is one of the great strength of the certification : to learn new ways of solving problems, not on relying on the same solutions over and over again.

In the written exam, they asked which solution is chosen on a particular problem, and why the other options were not adopted. This means different options must be evaluated. Answers like "I used RMI because it does the job, and it's the only technology I'm familiar with" is not the best answer.

Here's the detailed scoring report I received:

This report shows the total points that could have been awarded in each section, and the actual number of points you were awarded. This is provided to give you per-section feedback on your strengths. The maximum possible score is 400; the minimum to pass is 320.

  • General Considerations (maximum = 100): 90
  • Documentation (maximum = 70): 69
  • O-O Design (maximum = 30): 30
  • GUI (maximum = 40): 31
  • Locking (maximum = 80): 80
  • Data store (maximum = 40): 40
  • Network server (maximum = 40): 40

I got the worst score on the GUI part. This is a confirmation that GUI design is better not done by Developers, but by real Designers :-) . The total score was 380.

I found this book very helpful, in particular to prepare for the written exam. It's "Java 2 Developers' Exam Cram 2" by Alain Trottier & Ed Tittel. It's available on Safari.

Being involved in commercial Java projects on my daily work at Sun, I can tell that what is asked by the Java Developer certification matches closely with what is expected from a working professional. For example, it would be risky to try this certification without using some kind of Source Code Management tool. It is also critical to develop correct Unit Tests in parallel with the code, as well as overall tests. Good code documentation is essential, as well as end-user documentation. The ability to deliver all that is tested by the certification.


Thursday Feb 12, 2009

Sun is delivering important addons to the GlassFish J2EE server. One of these add-ons is the SNMP Monitoring feature, which I'd like to discuss briefly here. Being part of the technical team that delivered the feature, I have to say that I was impressed by the overall way it was handled. It was released, not when the date set by marketing 8 months ago was rearched, but when all important sub-features were implemented, and when there were no major bugs left (and not because important bugs were closed as "not reproducible", but because code was actually fixed). It happened to correspond to the marketing date, but that's only because of the hard overtime work done of some team members. Great work !!

Here are some examples of what can be found out about a running GlassFish server, using some simple snmp requests. snmpwalk is a standard Unix command widely available.

In SNMP, indexes are used to walk through a hierarchy of information. In the J2EE MIB, they are used this way: ""

Here are some sample commands:

#
# Let's set snmpwalk options once for all
$
$ OPT="-m +J2EE-MIB:ALL -M +/tmp/:/etc/sma/snmp/mibs -c public -v 1 $HOST:10161"
$
# What domain do we have in the deployement ?
$ snmpwalk $OPT J2EE-MIB::j2eeDomMoName
J2EE-MIB::j2eeDomMoName.1 = STRING: "domain1"
#
# We have one domain (index 1). What are the servers in this domain ?
$
$ snmpwalk $OPT J2EE-MIB::j2eeSrvMoName.1
J2EE-MIB::j2eeSrvMoName.1.1 = STRING: "cluster=cl1,name=cl1_ins1"
J2EE-MIB::j2eeSrvMoName.1.2 = STRING: "name=server"
J2EE-MIB::j2eeSrvMoName.1.3 = STRING: "name=sa_ins3"
J2EE-MIB::j2eeSrvMoName.1.4 = STRING: "cluster=cl1,name=cl1_ins2"
#
# We have 4 servers. What are their states ?
$
$ snmpwalk $OPT J2EE-MIB::j2eeSrvSMState
J2EE-MIB::j2eeSrvSMState.1.1 = INTEGER: stopped(3)
J2EE-MIB::j2eeSrvSMState.1.2 = INTEGER: running(4)
J2EE-MIB::j2eeSrvSMState.1.3 = INTEGER: stopped(3)
J2EE-MIB::j2eeSrvSMState.1.4 = INTEGER: stopped(3)
#
# Only one is running (index 2). What are the applications deployed in it ?
$
$ snmpwalk $OPT J2EE-MIB::j2eeAppMoName.2
J2EE-MIB::j2eeAppMoName.2.3 = STRING: "name=conapp1,server=server"
J2EE-MIB::j2eeAppMoName.2.4 = STRING: "name=__ejb_container_timer_app,server=server"
J2EE-MIB::j2eeAppMoName.2.5 = STRING: "name=MEjbApp,server=server"
J2EE-MIB::j2eeAppMoName.2.6 = STRING: "name=__JWSappclients,server=server"
J2EE-MIB::j2eeAppMoName.2.11 = STRING: "name=webapp1,server=server"
#
# There are 5 applications. Let's take the last one (index 11). When was it started ?
$
$ snmpwalk $OPT j2eeAppSMStartTime.2.11
J2EE-MIB::j2eeAppSMStartTime.2.11 = STRING: "Fri Feb 06 10:32:33 MET 2009"
#
# What modules are deployed in it ?
$
$ snmpwalk $OPT J2EE-MIB::j2eeModMoName.2.11
J2EE-MIB::j2eeModMoName.2.11.14 = STRING: "application=webapp1,name=//server/webapp1webmod2,server=server"
J2EE-MIB::j2eeModMoName.2.11.15 = STRING: "application=webapp1,name=//server/webapp1webmod1,server=server"
#
# There are 2 modules in this application. What are they ?
#
snmpwalk $OPT J2EE-MIB::j2eeModType.2.11
J2EE-MIB::j2eeModType.2.11.14 = INTEGER: web(3)
J2EE-MIB::j2eeModType.2.11.15 = INTEGER: web(3)
#
# They are web modules
# Let's take the first module (index 14). When was it started ?
$
snmpwalk $OPT J2EE-MIB::j2eeModSMStartTime.2.11.14
J2EE-MIB::j2eeModSMStartTime.2.11.14 = STRING: "Fri Feb 06 10:32:33 MET 2009"
#
# How many servlets are in it ?
$
$ snmpwalk $OPT J2EE-MIB::j2eeSletMoName.2.11.14
J2EE-MIB::j2eeSletMoName.2.11.14.36 = STRING: "application=webapp1,name=webapp1webmod2_Servlet2,webmodule=//server/webapp1webmod2,server=server"
J2EE-MIB::j2eeSletMoName.2.11.14.37 = STRING: "application=webapp1,name=jsp,webmodule=//server/webapp1webmod2,server=server"
J2EE-MIB::j2eeSletMoName.2.11.14.38 = STRING: "application=webapp1,name=default,webmodule=//server/webapp1webmod2,server=server"
J2EE-MIB::j2eeSletMoName.2.11.14.39 = STRING: "application=webapp1,name=webapp1webmod2_Servlet1,webmodule=//server/webapp1webmod2,server=server"
#
# There are 4 servlets.
# On this server, how many resources are deployed ?
$
$ snmpwalk $OPT J2EE-MIB::j2eeRsrcMoName.2
J2EE-MIB::j2eeRsrcMoName.2.1 = STRING: "application=MEjbApp,name=bean-pool,ejb-module=mejb.jar,server=server,stateless-session-bean=MEJBBean"
J2EE-MIB::j2eeRsrcMoName.2.2 = STRING: "name=keep-alive,server=server"
J2EE-MIB::j2eeRsrcMoName.2.3 = STRING: "name=MConnectorPool,server=server"
J2EE-MIB::j2eeRsrcMoName.2.4 = STRING: "name=orb.threadpool.thread-pool-1,server=server"
J2EE-MIB::j2eeRsrcMoName.2.5 = STRING: "name=transaction-service,server=server"
J2EE-MIB::j2eeRsrcMoName.2.6 = STRING: "name=eis/ConnectorMonitoring"
J2EE-MIB::j2eeRsrcMoName.2.7 = STRING: "name=connection-queue,server=server"
J2EE-MIB::j2eeRsrcMoName.2.8 = STRING: "name=__TimerPool,server=server"
J2EE-MIB::j2eeRsrcMoName.2.9 = STRING: "name=jdbc/__TimerPool,server=server"
#
# There are 9 resources. Of what type are they ?
#
snmpwalk $OPT J2EE-MIB::j2eeRsrcType.2
J2EE-MIB::j2eeRsrcType.2.1 = INTEGER: other(1)
J2EE-MIB::j2eeRsrcType.2.2 = INTEGER: other(1)
J2EE-MIB::j2eeRsrcType.2.3 = INTEGER: other(1)
J2EE-MIB::j2eeRsrcType.2.4 = INTEGER: other(1)
J2EE-MIB::j2eeRsrcType.2.5 = INTEGER: jta(6)
J2EE-MIB::j2eeRsrcType.2.6 = INTEGER: jca(9)
J2EE-MIB::j2eeRsrcType.2.7 = INTEGER: other(1)
J2EE-MIB::j2eeRsrcType.2.8 = INTEGER: other(1)
J2EE-MIB::j2eeRsrcType.2.9 = INTEGER: jdbc(3)
#

This SNMP MIB will be of great help to administrators who need an easy and efficient way to access J2EE-related information, when monitoring and managing GlassFish deployments.

Sun GlassFish Portfolio Landing Page: http://www.sun.com/glassfishportfolio

GlassFish (Community) Homepage: http://glassfish.org

Sun GlassFish Enterprise Server Homepage: http://www.sun.com/software/products/appsrvr/index.xml

Tuesday Sep 16, 2008

I have decided to move my blog to this new location.

Wednesday Apr 16, 2008

This morning I took the Sun Certified Programmer for the Java Platform test in Grenoble, France, and passed :-)

I had just written a long post about this, but Roller crashed when I hit "Post to Weblog", and all text was lost. I'm too mad to retype everything :-(

To make it short: I studied with this book, and it was very useful. As Abraham noted in the comments, the book has numerous errors, so be careful. I'm also almost 100% sure that there was at least one error in the actual test as well.

The test is composed of 72 questions, and last 3.5 hours. The minimum passing rate is 65% (=47 right answers), I got 73% (=53). Some questions requires an extended knowledge of the base Java classes, so perfect score doesn't make much sense (who knows all signatures of all methods of all classes in java.lang.*, java.util.* and java.text.*, except maybe James Gosling ??)

Drop a comment if you want more details. 

Friday Feb 15, 2008

I was able to install Vista on Linux RedHat 4 with VirtualBox, on an X4100.

The first attempt failed with the following error:

The VirtualBox support driver which is running is from a different version of VirtualBox.
You can correct this by stopping all running instances of VirtualBox and reinstalling the software..

A Google search proved that I was using the 32 bit VirtualBox rpm, where I should be using the 64 bits one. Alas, no 64 bit rpm for RedHat 4. I tried the RedHat 5 version, but it failed the pre-install dependancy checking. So I used the integrated installer (VirtualBox_1.5.4_Linux_amd64.run), ran it, and it worked.

One trick: By default, the VirtualBox GUI uses the "Right Ctl" key as a magic key to release the keyboard and mouse grab. Unfortunatelly, on my Sun keyboard, there is no right ctrl key... I had to shutdown the Vista VM, access the VirtualBox config menu, and change the Hot Key to Left Ctl :-)


 

 

Thursday Oct 04, 2007


My blog is worth $564.54.
How much is your blog worth?

Friday Aug 24, 2007

Just one comment on this: I like it !

On another subject, Apache is loosing market share to the benefit of Microsoft's IIS and lighttpd. Thanks Alexis Moussine-Pouchkine for the info. And Google has 7 out of the 10 top visited web sites...(the others 3 being Yahoo, the BBC news and Microsoft). Should I say that, until today, I had bever heard about the most visited French site : www.clubic.fr ? Shame on me...
 

Monday Jun 11, 2007

This is a third test post. As I only post once a year, it should be OK :-)[Read More]

Thursday Sep 21, 2006

Does it still work ?

This blog copyright 2009 by Marco