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

Friday, August 11, 2006

How to outsmart lazy loading

A customer recently had a problem with his O/R mapping framework(*) that all relations between objects/classes were marked to be loaded lazily. Despite this setting, loading a class (either by direct access or via HQL) caused all related classes to be loaded and their related ones as well until the whole graph of attached objects was in memory. The trace of the generated SQL clearly showed this behaviour without any explanation.

Looking at the mapping files, the queries or the java code for the relations brought not explanation. Also the startup of the mapper did not show any errors. The customer even implemented equals() and hashCode().

After having a closer look at the later two methods, the problem came clear: Hibernate did in deed only load the starting class and not the relations (initially). But when putting the entity into the Session, Hibernate has to call equals() or hashcode() for its internal maps. Those two methods now have been implemented my using (amongst other) some relation fields. So in order to compute the hashCode(), the relation had to be loaded (which in turn loaded the next relations, as the hashCode() method on the other classes were implemented in a similar manner).
So actually Hibernate worked as designed :-)

The use of collections within hashCode()/equals() is problematic anyway: a Map uses it to determine the location of the entry. If the hashcode changes this location is no longer correct, which will lead to strange problems.

As a summary: don't only be careful with externally generated primary keys within equals() and hashCode(), but also with using collections.


(*) Actually this was with Hibernate, but the problem can also arise with JDO, JPA etc.

Tuesday, July 04, 2006

Wednesday, June 28, 2006

Importing Thunderbird mails in Microsoft Outlook and Outlook Express

It might sound strange, but sometime it is necessary to migrate from Thunderbird to Outlook.

Robert Ploschek explains in his blog how this can be done:

Robert Peloschek aka Unic0der: Importing Mozilla Thunderbird mails in Microsoft Outlook and Outlook Express

This actually works, but is somewhat cumbersome.

I guess if one has access to an imap server, it is easier to move everything onto the imap account and pull it over to outlook from there.

Saturday, May 27, 2006

[mac] OmniGraffle - Diagram successor?

Some of you probably remember the drawing software Diagram on the NeXT computer. Years ago I used that to draw all the graphics for my diploma thesis. Since then I have never found such a good drawing program. Now I stumbled over
OmniGraffle and it looks like this is the successor of diagram. I downloaded the professional version to try it out and the very first steps already look familiar. When you add a few shapes on screen, it just looks good. PDF export works also like a charm and it has a SVG export as well. The latter two are very important for me, as I want the best quality of the drawings when writing a book or an article.

So if you need a drawing program on the mac you should check out OmniGraffle - this is definitively a good option.

Sunday, May 21, 2006

2 cache presentations upcoming at SIG-JBoss

SIG-JBoss of Java User Group Stuttgart will soon have two presentations about caching technologies:
19. Juni, Cameron Purdy: Distributed Caching ... Lessons Learned
13. Juli, Bela Ban: JBossCache

Both presentations will start at 6:30pm and will be hosted at the
VRS building at Kronenstr. 25, Stuttgart.

There will be separate invitations to those events, but: keep an open slot for them in your calendar.

JAVA:JAVA-CAMP2006 - Rootserver

A few guys from Sachsen-Anhalt are doing a Java-Bootcamp.
Check out their webpage.

This sucks

Andy writes in his blog that the mentionned webmail client doesn't suck.
But then
- it is written in Flash!
- is is written in a version of Flash that Andy can not even use on his Linux computer.

I don't get it...

Thursday, May 04, 2006

JBoss 4.0.x plugin for Eclipse WTP [updated]

The Eclipse WTP 1.0 only has a server definition for JBoss 3.2.3 which is quite old (3.2.x is at x=8.sp1 and 4.0.x is at x=4).
The webseite at the following link gives an explanation on how to build a definition for 3.2.5
How to build a JBOSS 3.2.5 Server Definition for Eclipse Web Tools Platform
If you want a definition for 4.0.x, you can just follow the document - it is quite detailed.
I have also provided a org.eclipse.jst.server.generic.serverdefinitions_1.0.0.zip that contains a definition for 4.0.3sp1 as well.

Don't forget to run eclipse -clean or you won't see the fruit of your work.
[Update]
The config is still not yet complete. There are a few libraries missing that are needed for starting the server from within eclipse.
When those are included, there is still a problem with parsing of login-config.xml

org.jboss.security.auth.login.ParseException: Encountered "Was expecting one of:
<EOF>
<IDENTIFIER> ...


As the server starts nicely standalone, this seems to be a eclipse related problem.

Tuesday, May 02, 2006

Hacking JBoss snmp-adaptor

I'v been hacking JBoss snmp-adaptor in the last few days, providing support for
get and set operations. The code currently is only available in cvs head, as it still needs some tweaking. Dimitris set up a forum to discuss the adaptor and a possible mib. Please contribute to the discussion. Tell me / us your needs.

Thursday, April 13, 2006

JBossXB - X/O-Mapping made easy

JBossXB is part of the JBoss application server, but will also be used in other projects. As far as I understand, it will be moved to a "common" paltform, so that it can be used separately. Currently you can find it in jboss-common-client.jar.

If you have a simple structure like
<list-of-foo>
<foo>
<bar>
<baz>
</foo>
<foo>
...
</list-of-foo>

You basically need a POJO for <foo> and a few lines of code to get things parsed into a list with all Foo-objects.

Alexey has quite some documenation on the wiki page for it.

Monday, April 10, 2006

Is it still April 1st?

Wow, I am confused by the announcement that RedHat is buying JBoss. Does anyone have a clue what this means (other that some VCs get a good bonus on their invested money)?

Sunday, February 26, 2006

Two day course at FHT Esslingen

On March 7th and 8th I'll give a two day course at the University of Applied Science Esslingen (FH Esslingen). Title is "J2EE mit JBoss".
Planned agenda is:

  • Software layers and views on them
  • Architektur JBoss
  • Install, Directories and files
  • Lab 1
  • Services of a J2EE-Server
  • Lab 2
  • Intro into EJB 3
  • Lab 3

Monday, February 20, 2006

Outdated/incorrect docu is worse than no documentation

I was struggling with this How to use JDBC and transactions in Tomcat with JOTM. JOTM was always throwing java:comp away after the first request (the first lookup went through nicely). Thanks to a bug report from Matt Raible, I found out that carol now needs more options in the property file:

carol.protocols=jrmp

# do not use CAROL JNDI wrapper
carol.start.jndi=false

# do not start a name server
carol.start.ns=false

# use the apache naming factory
carol.jndi.java.naming.factory.url.pkgs=org.apache.naming


While browsing more tracker items, more and more things come clear.
Please: update the documentation if you make such big changes in a project. Wrong documentation is worse than none.

Saturday, January 28, 2006

EJB3 session visibility

EJB3 started with the claim to reduce the artefacts needed to program with EJBs. Unfortunately if you want to expose a SessionBean locally *and* remotely, you start to either list all business methods in a POJI for the local interface and the same again in an interface for the remote view. If you update the session bean class by a new method, you need to remember to update both interface files (this calls again for generators like Xdoclet ...)

Another variant to acheive the same result is by using the following view pattern:



In this case you only list the business methods in the "Business" interface. IRemote and ILocal are only marker interfaces that just extend the "Business" interface and which carry the respective annotation:


package foo;

import javax.ejb.Local;

@Local
public interface ILocal extends Business {
// empty
}


This way extending the session bean by new methods just means to update one additional file. Unfortunately this yields again four artefacts for this task, which is far from simple.

Are there better ways to do this?

Tuesday, January 24, 2006

LaTeX on Rail

Ever wondered how to graphically represent EBNF?

There are some packages out there that can produce so called Railroad diagrams.

Phillips has a package called Elegant (you can see some examples in this document)

Then there is LaTeX-style rail.sty online, where the results are quite ok as well (the png image is scaled to 600pt in width, so the real quality is better) :



So, how does one read the diagram? For the start form left to right :-) Words in rounded boxes are terminals (i.e. words that you put literally in your code) Words in normal boxes are non-terminals that refer to other diagrams. A construct like in the start with "AVG", "MAX", ... is a switch statement, where you can choose one ot the options. You will see that above "DISTINCT" is a line without a box. This means that "DISTINCT" is optional.
And this is basically all about reading those diagrams.

Unfortunately, this package does not directly know about the 'ususal' EBNF syntax ( AggreagateExpression ::= ....), but uses its own, which looks like the following for the above example


AggregateExpression : ("AVG" |"MAX" |"MIN" |"SUM")
(
(
'DISTINCT' ? StateFieldPathExpression
) | 'COUNT'
(
'DISTINCT' ? IdentificationVariable
| StateFieldPathExpression
| SingleValuedAssociationPathExpression
)
)
;


Perhaps I am going to write some translator between the formats in Perl ...

Thursday, January 12, 2006

Tuesday, January 03, 2006

Presentation at Hochschule Heilbronn

On 25th of january I will give a presentation at Hochschule Heilbronn. From their website:
Heiko W. Rupp, Autor des ersten deutschsprachigen JBoss-Buches, wird einen Gastvortrag bei uns halten. Thema seines Vortrages im Studiengang Software Engineering: Die interne Architektur von JBoss.
Start 25-01-2006 14:00
End 25-01-2006 15:30
Where A311 - Hochschule Heilbronn