Friday, February 16, 2007

Slides from JUGS Talket online

The (German) slides from my yesterday talk at Java User Group Stuttgart are online at bsd.de/e3fu/ as PDF.

Wednesday, February 14, 2007

Eclipse 3.2.1 performance patch

I was recently complaining that Eclipse is taking a nap after a right-click before displaying the context menu.
When looking for an updated Findbugs plugin the update manager also offered me an update called
"Eclipse Java Development Tools 3.2.1 performance patch (bug: 159325) 1.0.0", which is related to the this bug :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=159325
After installing the Patch, the context menu appears again directly after a right click without any nap.
So this was no problem with the Mac or the Apple VM, but with Eclipse which I only never saw before in Win* times as I was not using such a big workspace together with Eclipse 3.2.1.
According to the bug notes, this is also fixed in 3.3.M2 and - as I understand it - an upcoming 3.2.2 maintenance release.

Timestamp comparision oddities

Yesterday a colleague of mine ran into a problem where code like this produced a ClassCastException:

.. av.getEndTime().compareTo(someDate);

av is a domain class in JPA with endTime like this

@Temporal(TemporalType.TIMESTAMP)
java.util.Date endTime

and someDate being a java.util.Date.

This just worked on my Mac, but failed for one colleague, while others had no problem.
Looking under the covers turned out that av.getEndTime() actually returned a java.sql.Timestamp, which in java versions between 1.5.0_00 and 1.5.0_06 (including) were suposed to throw a CCE when the argument of compareTo() is a Date. Interstingly before() and after(), which also compare, did not have this restriction.
In Java Version 1.4.x the CCE was also not present and SUN seems to have it changed back to the original behaviour in 1.5.0_07. Unfortunately the manual page was not updated, adding to the confusion.
This blog entry also talks about this problem. Sun has a list of page about incompatibilities where this problem is listed. Unfortunately, the original bug report is not accessible (to me).

Some people argue that one should write own comparators, but I think it is easier to update to a newer version of the JDK. Of course if the software gets shipped to customers, one needs to make sure the customer also has 1.5.0_07 at least.

Tuesday, February 13, 2007

Elvis^Wmarcf has left the building

Now it is official. Marc Fleury, founder of JBoss has retired from his position as SVP JBoss division at Red Hat. Many suspected this when he started to take his paternity leave. There are numerous posts around this like e.g. from Sacha Labourey.

I think it is a pitty, as Marc was a brilliant visionaire. I will aways remember when I was at the Advance Training in Paris in 2003. Juha and Adrian were teaching about various aspects (no pun intended) of the system (it was ealy 3.2 time) when Marc was coming into the room, watching the two for a minute and then running to the front of the room, saying "Forget all the bullshit - now we're doing it the AOP way". And then he started to draw on the flip chart his ideas about interceptors, applying pointcuts etc. Many students in the course have been very irritated, but for me this was really great stuff.

As I am a dad myself I can very well undertand that Marc is now taking care of his kids and his other interests. Some have even seen him as DJ Red Baron. And if you want to know what Marf is up to, you can visit his blog, where he can now freely comment on various things. Also something that he couldn't really do as founder of JBoss or SVP at Red Hat.

Marc, I wish you well - hope we meet again.

Saturday, February 10, 2007

A totally subjective comparision of Eclipse 3.2.1 and IDEA 6.0.4

As most of the project I am working on are using IntelliJ IDEA, I thought to give it a try as well. This was not easy, as I am a long term Eclipse and derivates (Rational XDE) user. But on my MacBook, Eclipse is often taking naps when e.g. right clicking in the navigator or package view. I find this behaviour very annoying. And yes, I already have 2GB Ram in the box and I am giving Eclise half a gig for the heap, which doesn't need according to this memory usage bar. IntelliJ just feels much snappier.
This are the differences I found so far:

Eclipse:

  • Better problem view. It shows all errors in the project if I e.g. break a method signature
  • Only one version of Ctrl-Space for autocomplete. I don't want to remember if I need to press alt-ctrl-space or shift-ctrl-space etc. for a given situation
  • Many more plugins
  • Plugins and features are often based on other huge features (e.g. EMF)
  • More than one main window. This is cool when you e.g. are working on transitioning a project from EJB2 to EJB3 or spring. On one monitor you have an Eclipse window with the old code and on the other monitor you have the new code. And on both monitors you can use Overview-view or Package explorer for the class just shown. It also helps when you just want to see a referenced class for the code you are working on. Splitting the window in more tab groups isn't the same.
  • Quick-fixes seem to do a better work for my typos


IDEA:

  • Changelists are an extremely cool feature if you are working at different parts of the project you don't want to commit together
  • Snappier than Eclipse (probably because it does no incremental compilation of the entire code base)
  • cmd-D in Changes View is very handy to see what one has done to a file.
  • Much better code smell detection.
  • Nicer UI look and feel (native Mac, I am not talking about some Motif styles etc.
  • Commit dialog is better arranged (probably due to the changelists). But the "show me the last commit messages" is hidden (cmd-m)
  • If one is programming in an EJB-2 project, Idea is able to follow calls into EJBs, as it knows through ejb-jar.xml which interface classes belong to which EJB. This is extremly helpful. It seems that there is a plugin for Eclipse that can do this as well.
  • The "Scope: Problem" view doesn't really work for me. Probably because IDEA does no incremental compile of the sources. If I change a class in the domain (remove a method) then classes in the GUI that access this method are not displayed as having an error until I open them. Eclipse shows me the GUI-classes directly upon save of the domain class.
  • Struts support is nice
  • Editors for HTML and other 'Web technologies' are better than what you find in a plain eclipse (one can download the WTP stuff to get this as well)


The comparision ends 0:0. If both were free then I'd just change around all the time. Using IDEA for hacking and Eclipse to find errors in the code

What do you think? And yes, there is also NetBeans. But this is not used in our project and I don't want to go through the process of setting up the project structure in it.

EJB3 alpha feature from IBM / Bea compliant

While in the past big blue was not too enthusiastic about EJB3, they now have an alpha version of EJB 3 support online.
It only works with WAS 6.1, but neverthless.

This means that EJB3 support is very widthspread now so that it will definitively become a widely accepted standard.
It is also interesting that vendors that haven't really been on the early adopters radar like SAP have one of the first certified implementations.
[update]
Bea announced that they are now also Java EE 5 compliant. See the post on TheServerSide.com. So Java EE and EJB 3 support by the big vendors is now also coming along. As many others I think this is a good thing even if I would have liked JBossAS to be the first.

Monday, February 05, 2007

Amazon finally has it - or not?

After I have my first copy of the EJB3 book since the 23th and I got my box of author copies, even Amazon now lists it as available :)
Man what a tough time waiting :-)

Another look at the Amazon page and it is listed as non available again. This sucks *sigh*

Tuesday, January 23, 2007

Yippie!

I just got a copy of my EJB3 book in my mailbox. It is again a great feeling to actually have the printed copy in the hands.
One can get sort of a feeling when one print it out on the laser printer, but having the real book is still different.

Amazon still shows it as unavailable, but this should change within the next few days. All those who preordered a copy will also soon get it.

I still need to add a few things to the accompanying web page, but I'll do this in the next few days.

Here is a picture with my copy:




Technorati:

Star imports

When pepole asked me why star imports are bad, I didn't really know what to answer. Usually I was talking about parsing time and so.
And actually IDEs like Eclipse or IntelliJ even offer to reorganize individual imports into star imports (I think IntelliJ does this as default).

Today I was doing a bigger refactoring and was moving packages around.
Eclipse is doing a really good job here.

Unfortunately I was getting compile errors afterwards, because the old packages did no longer exist.
The reason behind this is that a refactoring is a textual replacement and not a semantical. Example:

import foo.*;

public class Bar {
Foo f;
}

Now you move foo.Foo to baz.Foo. Eclipse adds the new import baz.Foo statement, but does not remove
foo.*, as is does basically not know that foo.* no longer exists (it could analyze all statements in the class and
automatically remove unused imports afterwards though).

Monday, January 15, 2007

EJB 3 book, talklets at Stuttgart Java User Group

My EJB 3 book will probably be in stores starting on 26th of this month.

Within the next month, the Java User Group Stuttgart will host two EJB 3 talklets

  • 25.1.06: Sun evening - presentations about Java SE 6 and EJB 3.0 from a Sun computers perspective.
  • 15.2.06: Broader look into EJB 3 - presentation about EJB 3, existing Appserver and some tips and tricks on using EJB 3

As usual, everyone is invited to join those sessions.


Technorati:

Tuesday, January 09, 2007

Using a printer on the mac from Windows

Recently I was struggling with printing from Win*. Samba was set up nicely, but Win users were not able to print. I tried lots of different things, but no success.
Googling around brought me to http://members.cox.net/18james/osx_printer_sharing.html#ipp
Especially the section about IPP near the bottom was very helpful. With it I was able to configure the Win machines within a few seconds.
As all newer Win* version support this, I'd say this is the recommended way to print from Win* on a printer attached to a Mac.

Tuesday, January 02, 2007

Samsonite suitcases can break

Do you remember when you first found out that your dad does not know everything or that Santa Claus does not exist?
I hat the same experience when returning from my trip to Philly and saw that two out of three Samsonite suitcases had cracks on the side as you can see here and here.

Unfortunately those suitcases can not be reparied as it seems that single parts are no longer available and the cost of the repair would be higher than that of new suitcases.

Tuesday, December 05, 2006

EJB 3 book in typesetting phase

It's nearly done .. last night I finished to work in the results of the spell checking.
Now the book is in the typesetting phase after which it will go to the printer.
Expect it to be in a store near you end of January / start of February.

*smile*

Thursday, November 23, 2006

Final cover of my EJB-3-book online

As I wrote before, the final draft of my book is at dpunkt.
They now also have the final cover design online. Unfortunately, Amazon is no yet this fast as you can see here

JBoss World Berlin

I had the luck to be in Berlin at JBossWorld for the last three days. This was a great event. I met many of my colleagues. The party at the eWerk was great and everyone enjoyed the event. The only downside was that I was not able to stay a little longer in Berlin for sightseeing purposes.
There is already some coverage of this event on the net, so I don't duplicate that, but merely link to it:

Friday, November 17, 2006

Parallel desktop for Mac, MacBook and special characters

Parallels Desktop for Mac is a great piece of software. You can run every other operating system for i386 architecture (yes includig vista).
On the MacBook, you usually have no external keyboard with a right alt key, so special characters such as
@, \, |, { , } , ... are on a MacBook with a German keyboard not usable on Rev 1970.
The following steps provided by Parallels support (extremly fast answer) allow you to map the
right enter key (of the emulated numeric keyboard) which sits between space and cursor-left to
AltGr like on ordinary pc keyboards.

  1. Stop any running VMs, close all instances of Parallels Desktop for Mac.
  2. Launch ?Macintosh HD? - ?Applications? ? ?Utilities? ? ?Terminal?.
  3. Type the following commands in Terminal, please mind that the system might ask you for the Administrator password after each command ? type it and hit Enter:
  4. sudo touch /Library/Parallels/.keyboard_config
  5. sudo chmod 666 /Library/Parallels/.keyboard_config
  6. sudo echo "numenterisaltgr" > /Library/Parallels/.keyboard_config
  7. Close the Terminal.
  8. Launch Parallels Desktop for Mac and check Right Enter key behavior in VM ? everything should work as you?ve set.

After this you might reach @ on AltGr+q (German PC keyboard) with AltGr being mapped on this additonal enter key.

A feature version of Parallels Desktop might include a Preferences option to select this behaviour directly in the application.
Thanks again to Parallels support for this fast solution.

Wednesday, November 15, 2006

Final draft of my ejb3 book at the publisher

I just sent the final draft of my book to the publisher.
Next steps are professional spell checking, type setting and printing. So I expect it to be in stores end on January 2007.
Stay tuned :)

Wednesday, September 20, 2006

A few helpful java links

Java SE 5 has introduced Annotations, amongst other @SuppressWarnings. This posting on an Eclipse mailing list shows possible values for it.

Joseph Mocker from Sun has collected all the (hidden) options of the Sun Java VM.
Sun has an official page on hotspot VM options as well.

The list of options for the Mac OS X java vm are desribed in the Apple developer resources.

Friday, August 18, 2006

Draft of my next book is at the publisher [updated]

I just submitted the draft of my upcoming next book to the publisher to start the review process.
You might wonder what it is about. Well it is about EJB 3.0 and targeted at readers who are already familiar with EJB 2.x and want to know the changes without repeatedly reading things that they already know about.
As there is no final title or cover etc, I can't give them at the moment. Stay tuned, as I will post some more later on.

Dpunkt.verlag is again my publisher, so you might also check out their page about upcoming titles for the anouncement and a link to the final page.

[Update]: Dpunkt has the book description (with the non-final cover) now online