Wednesday, April 22, 2009

I love the Standalone container in Jopr (updated)


I am just working on a plugin when I have some spare cycles (I will tell you which one in a few days :-)

To test the plugin I am using the Standalone Container where I have deployed my plugin, the JMX and the platform plugin.
So when I have compiled a new version of the plugin I just copy it over and start the standalone container:

snert:rhq-agent hrupp$ bin/standalone.sh

Listening for transport dt_socket at address: 8788



Starting the plugin container.

Loading plugins

...Loaded plugin: Platforms

...Loaded plugin: JMX

...Loaded plugin: MyNewOne



Ready.

[0]:0 >


This takes 3 seconds and then I am ready to discover resources:

[0]:0 > disc s

Discovery took: 2269ms

[Resource[id=-3, type=Secret, key=service:jmx:rmi://127.0.0.1/jndi/rmi://127.0.0.1:1090/jmxconnector, name=Secret, parent=snert]]

[1]:0 >


Now I can test if my invokeOperation() method from the OperationFacet works:

[2]:-0 > set res -3

[3]:-3 > invoke getProperty name=test

[PropertySimple[id=0, name=result, value=null, override=null]]


So set the resource id to the resource I want to work with and then invoke the getProperty operation with parameter name and value test. The Operation then returned null, as the underlying resource does not know this specific value.

This all took around 10 seconds now for a round trip - you can't really do faster testing :-)

When I want to repeat those steps with an updated version of the plugin, I can save my work:

[4]:-3 > !w /tmp/foo

This creates a file and saves the commands given in it. The name of the file can later be given on the command line to just run the action as a script without any need to manually type in the commands.

There is currently one caveat: Resource ids will change in each startup so the "set" command in step 2 above will not work exactly like this.

[UPDATE]


I will work on adding variables to the find command in the standalone container which can then be passed to set -- if you want to help out contact me.


What you can do is to use $r as 2nd parameter to set after finding a single resource:

[5]:0 > find r *myFooBar*

-12: MyFooBar ( Resource[id=-3, ... )

[6]:0 > set r $r

[7]:-12 >



With this trick it is now possible to just run the container with the saved file as input again and again

$snert bin/standalone.sh /tmp/foo

Monday, April 20, 2009

RHQ and Jopr plugins: What about <T> ?

When writing a Plugin for RHQ, JBoss ON and Jopr (or for completeness: Embedded Jopr, you will run into Generic types for ResourceComponent and ResourceDiscoveryComponent. And I am sure you have often wondered what the T in ResourceComponent<T> should be.

The following diagram tries to help here. We have two ResourceTypes that from a Parent-Child relationship e.g. a Database and a DatabaseTable.

If you don't know what parent you will run in, you can just leave the generic bit away, as in ParentDiscovery and Parent in the diagram. This is usually the case for ResourceTypes of the Server category that live in their own plugin. One could also use the platform component as parent if its clear that the plugin will only run as a child of the platform, but never e.g. within another resource like a JBossAS.



InheritanceDiagram.png


Children of this server Parent will set the T to the parent component. This allows them to e.g. access the parent ResourceContext.

For examples of all this, check the Jopr source code, which contains many examples.

Friday, April 17, 2009

♫ I'm running in the rain ... ♫

Today it was raining, but I had the urge to go out for a run, so I went out nevertheless. Normally I am more a like a sissy in that area though.

But after around 1km I felt warm enough so that it did not feel uncomfortable anymore and later on it did not even feel bad being splashed by a car driving through a puddle. And this is how I looked when I was coming home:

DSC00039.JPG


But hey, it felt great !

And the best: my Adidas (Supernova) shoes stayed dry inside. No wet feet - I just love those.

( The very best was actually that my ankle did not hurt )

Jopr/RHQ plugin generator updated

The plugin generator has been updated for the plugin lifecycle listener. I have uploaded a new version to the description page on the RHQ wiki.
So you can grab the standalone jar file from there without the need to download the RHQ source and compile it from scratch -- which would not be hard actually:


$ cd $RHQ/modules/helpers/pluginGen

$ mvn install


You can find the resulting rhq-pluginGen*-jar-with-dependencies.jar in target/ then.

Sunday, April 05, 2009

List of Jopr / RHQ resources


Just as a FYI:

Mazz has, while answering a forums post made a nice list of resources
related to Jopr and RHQ.

Check out the post at the Jopr user forum.

Saturday, March 28, 2009

GSoC students where are you? Jopr wants you!



JBoss and Fedora are this year again participating in Google Summer of Code as mentoring organization.

We have set up a list of ideas at the JBoss Wiki.

For Jopr some ideas are:

  • Baselining that respects hourly and weekly variances to get better out-of-bounds conditions

  • Proactive alerting - alerting operators of bad conditions before they actually happen

  • Correlation of arbitrary input values to generate new results - often one input parameter is not enough to determine if a bad condition is in place

  • Multidimensional multimetric multidevice graphing of measurement values

  • Portal-UI for Jopr so that users can compose their own UI. This includes adding of other related consoles

Of course contributions are not limited to these ideas.

If you want to participate, be quick as deadline for submissions is on April 4th !

For more information have a look at the GSoC FAQ.

Friday, March 20, 2009

Working on a standalone PluginContainer wrapper

I have been working on a standalone plugin container wrapper for RHQ and Jopr which allows to call plugin functionality without the need for a fully running agent and server. Of course this only makes sense while developing a plugin.

This video shows how this may look like (swf format).

This stuff is not yet committed to subversion, but I guess I will do that in the next few days.

Please provide feeback.

Review of my talk @RheinJug with pictures

Yesterday I was talking at Rheinjug in Düsseldorf about RHQ, Jopr and JBoss ON.

To get to Düsseldorf, I took the ICE fast train which took 2:41h for 410km distance, which is the fastest way to travel between those cities. On this course, Deutsche Bahn is offering WiFi on board (unfortunately not for free), so you basically have Internet at 300km/h - nice. While being on the train I also started about implementing a Standalone PluginContainer wrapper that can be used when implementing a new plugin to test it; I will post about this separately.

After I arrived in Düsseldorf I first went to my Hotel, which is nicely located in the old town - only 5 mins by subway from the main station. after check in I walked around a little bit in the old town and went to the Rhein river. On the next picture you can see locals with one of their favorite occupations:




People were just standing outside a brewery and drinking Altbier. In summer that place is crowded.

Düsseldorf is supposed to have "die längste Theke der Welt" ( 'the longest bar counter of the world', which is not to be taken literally ) see also:


There are lots of other restaurants and bars in that area too, as you can see from this picture:


 



I took the tram to the Heinrich-Heine-University where the talk was taking place in an auditorium. The first people were already there and enjoying food and drinks sponsored by Red Hat Germany.













Michael Jastram from the JUG opening the evening by welcoming all of us and doing a little lottery - prizes were a Jetbrains license, a backpack and a copy of my EJB-3 book.

After this my colleague Joachim Schröder who is living close to Düsseldorf briefly introduced Red Hat before my talk started:




My talk was taped by the user group and should soon be available on the Rheinjug.tv web page



(Installation of the camera)

Around 40 people had found their way to the presentation at that time. The talk itself went well. As usual I was also talking about the thermometer chip monitoring that I implemented a while ago. And of course I did a live demo of the system which was well received. In the Q&A session we had some good questions from people who obviously have an administration background.











When this "official" part was over we relocated to a different part of the building and did some more socializing.







Joachim drove me to my hotel, where I arrived around midnight. While this he told me that he especially found the thermometer chip part very interesting, as he recently implemented some monitoring of his heating system with this exact chip and with some proprietary code. So he is now interested in replacing this with a Jopr based solution :)

This morning when I went back to the main station, I met Mete again, who was in the talk yesterday. He invited me for a coffee (thanks again) while I was waiting for my train and we had another good conversation.



Tuesday, March 17, 2009

RHQ tip of the day: Overseer API (updated)



Sometimes it is necessary in RHQ-plugins to load resources when the plugin is loaded and more important to unload those when the plugin is unloaded from the plugin container.

( As you can see from the comments, Mazz has renamed the Interface class, so I updated this article. )

Mazz has recently added the PluginOverseer PluginLifecycleListener interface for exactly this purpose (see e.g RHQ-1584).

To use the api, you need to do two things:

  • Implement the interface org.rhq.core.pluginapi.plugin.PluginLifecycleListener
  • Wire the implementation class in the plugin descriptor.


With the following entry in the plugin descriptor, rhq-plugin.xml


<plugin name="MyPlugin"

  package="org.rhq.plugins.myPlugin"

  pluginLifecycleListener="MyPluginOverseer" .../>


The code for this could look like this:



package org.rhq.plugins.myPlugin;

import org.rhq.core.pluginapi.plugin.PluginContext;

import org.rhq.core.pluginapi.plugin. PluginLifecycleListener;

 


public class MyPluginOverseer

  implements PluginLifecycleListener {


  Class clazz;

// called on plugin load

public void initialize( PluginContext context ) {

  ...

  clazz = Class.forName("org.acme.Driver");

  ...

}

// called on plugin unload

public void shutdown() {

  clazz = null;

  }

}


There are some real examples of the usage of this API, like e.g. in the Postgres-plugin.

As this API is added to RHQ, it applies to Jopr (trunk) and the upcoming release of JBoss ON as well.

I have also updated the plugin generator to support this new API - its version is now 1.2.1.


Monday, March 16, 2009

RHQ Tip of the day: XA issues with oracle ?

Are you running Jopr, RHQ or JBoss ON 2 with Oracle and see the following warnings in the servers logfiles:


 


 


14:05:51,406 WARN [loggerI18N] [com.arjuna.ats.internal.jta.recovery.xarecovery1] Local XARecoveryModule.xaRecovery got XA exception javax.transaction.xa.XAException, XAException.XAER_RMERR

Then you need to set up your Oracle user for XA mode:

GRANT SELECT ON sys.dba_pending_transactions TO rhqadmin;

GRANT SELECT ON sys.pending_trans$ TO rhqadmin;

GRANT SELECT ON sys.dba_2pc_pending TO rhqadmin;

GRANT EXECUTE ON sys.dbms_system TO rhqadmin;




This is also described in the Jopr installation page on the JBoss.org Wiki (and of course in the JBoss ON manual)

Saturday, March 14, 2009

Safari 4 has by far the fastest JavaScript engine on my MacBook

I did just run the Peacekeeper benchmark on my 2.5 years old MacBook (2GHz Core Duo CPU). And here are the results:



Bild 10.png

(Click to enlarge)


So Safari 4 beta is nearly 3.5 times faster than Safari 3.0 and more than 2 two times as fast as the third beta of upcoming Firefox 3.1.

Friday, March 13, 2009

Devoxx 08 slides are now online

The Devoxx team has made the slides of most university and tools in action talks available.

The ones for my talks are:


Enjoy! If you have question, contact me.

Talking at RheinJUG next week

I'll be talking at RheinJUG, Düsseldorf next Thursday, March 19th about Jopr, JBoss ON and RHQ.
Subject of the talk is:

"Server-Monitoring und -Management mit JBossON2"

RheinJUG created a cool announcement poster (original is on their web site, this is a scaled down png version of the original PDF):

024_poster3.png



You can find more details at the web site of RheinJUG.

I am pleased that Red Hat is providing free food and drinks for this event - many thanks for that.

Thursday, March 12, 2009

Review of my yesterday talk about Jopr at JUG-Ka

Going to Karlsruhe to talk to the local Java User Group was a little bit like going back in history - I used to live for over 10 years in Karlsruhe and did study computer sciences at the University. So I was giving the talk in an auditorium where I used to sit my self on the benches years ago.

I went to Karlsruhe by train, took the tram to the city center and then walked to the University and the CS building. When I arrived the first two members of the audience have been there. David who used to organize the event unfortunately got ill and was not able to attend.
After some waiting, the audience grew to more than 20 people.

Before I started my talk, there was a presentation about Jazoon by Christian Frey. Christian explained why it is worthwhile to attend Jazoon and left some vouchers for user group members.

IMG_3235.JPG

Christian Frei talking about Jazoon


Next was my talk, which went well. The audience was interested and from the questions, it was obvious that at least some of the members have management and monitoring experience. This also resulted in some good new ideas.

Of course I did a live demo of the latest Jopr 2.2 beta 1 release.

After the talk there was some Q&A and then (nearly) everyone went home quickly as it was already past 9pm.

IMG_3236.JPG

Part of the audience


Eckes took a picture of me ..

You will be able to download the slides from the Jug pages; or from here (PDF, 2 MB).

I ended up back home at 1am this morning ...

Sunday, March 08, 2009

Reconfigure Oracle-XE to a different port for jdbc

I wanted to reconfigure my Oracle-XE instance to run the tnslsnr on port 1522 instead of 1521. So as first try I went in and just changed the listener.ora and tnsnames.ora files. But after those changes, the system did not give away a beep when I e.g. called lsnrctrl status.

Solution to this was (on RHEL 5.3):

# mv /etc/sysconfig/oracle-xe /tmp/
# /etc/init.d/oracle-xe configure

The script asked some questions about ports (you can look them up in the copy in /tmp) and the db password etc. And then started the database with the new port.


Wednesday, March 04, 2009

Apple heard my prayers: new keyboard

I saw this first on this post: http://elliotth.blogspot.com/2009/03/apple-keyboard.html

Apple has introduced a new keyboard that has a cable and does not have the numeric keypad, making it much smaller than the already existing one with keypad. Actually as it does not need the battery casing, it is even smaller than the wireless one (see e.g. http://www.apple.com/keyboard/ ) and http://store.apple.com/de/product/MB869?mco=NDE4NDE5NQ for the new one in the German Apple store.

And you can immediately see that this is a real Apple product, as it is the same price as the one with keypad :-/

See also Apple Quietly Bumps 15" MacBook Pro Speed, 256GB SSD Option, and New Keyboard


Tuesday, March 03, 2009

Public beta of Jopr 2.2 released

The RHQ / Jopr team has released a first public beta of the upcoming Jopr 2.2 and thus RHQ 1.2 release.

This first public beta consist of a big list of changes that you can see in the respective JIRAs:



As I have written earlier, there is a page available that shows an overview of the UI features - but of course it is better to try them yourself.

Please provide feedback

We have two jira systems as development effort is split between the foundation RHQ Project and the Jopr Project that is specific to JBoss technology management.

Or post a message in the Jopr user forum.

You can grab this public beta from the SourceForge download page.

Install documentation is available in the JBoss.org wiki.

Note, that there is no longer a separate agent download. The agent is delivered with the server package and you can install it as I have described here.

Are you in Karlsruhe and want to know about Jopr, RHQ and JBossON ?

As written previously, I will talk next wednesday, March 11th at the Karlsruhe Java User Group about Jopr, RHQ and JBoss ON. This will of course also include new Jopr 2.2 features.

The talk will be in the CS building of University of Karlsruhe

Uni Karlsruhe, ATIS,

Am Fasanengarten 5, Geb. 50.34,

76131 Karlsruhe

(view address in Google Maps)

Multimediahörsal im UG (102)



See also https://www.xing.com/events/313859

Sunday, March 01, 2009

Jopr 2.2 UI preview

My colleague Mazz has made a UI preview page of the upcoming Jopr 2.2 (and thus RHQ 1.2) release. You can view it at https://www.jboss.org/community/docs/DOC-13381 .

Of course you can always build Jopr 2.2 from svn and have a look at things yourself.

We have incorporated a lot of changes in the UI:

  • Navigation tree on the left
  • Subsystems view
  • Summary view per resource
  • More streamlined UI
  • New Problem Resource / OOB view

As Jopr 2.2 is not yet released, this is all still work in progress and subject to changes.

Please give us feedback - e.g. via Jira or mail to jopr-dev @ lists.jboss.org. Or meet us in #jopr at irc.freenode.net


Thursday, February 26, 2009

Hibernate: QueryException: could not instantiate: (updated)

I was doing some queries today in EJB-QL on JBossAS (which uses Hibernate as persistence provider).
And for a query that was nicely working in the Jopr Gui, I got errors in the test suite:


javax.ejb.EJBTransactionRolledbackException: java.lang.IllegalArgumentException: org.hibernate.QueryException: could not instantiate: com.acme.Foo
at ...... ( a lot ) ....
Caused by: java.lang.IllegalArgumentException: org.hibernate.QueryException: could not instantiate: com.acme.Foo


Ok nice - Hibernate can not instantiate my class because it can not instantiate my class. So what?

After looking some time at this and debugging around I found out that the issue was the following. But before I show you the code, let me assure that IntelliJ flagged it as valid and it did work in the UI.

But now the code:


SELECT new com.acme.FOO(res.name, res.id, ... , parent.name, parent.id)

FROM Resource res

LEFT OUTER JOIN res.parentResource parent

...

WHERE ...


The constructor of com.acme.Foo looked like this:


Foo(String res.name, int res.id, ... , String parentName, int parentId) {}


This is all valid,

but:

It can happen for Resources at the root of the hierarchy to not have a parent (when they are roots). And in this case, parent is null and Hibernate is looking for a constructor to pass NULL in as last argument, which does not fit for 'int'. Thus the failure to instantiate the class.

The correct constrctor looks like this:

Foo(String res.name, int res.id, ... , String parentName, Integer parentId) {}

(of course you need to update the respective property within Foo too).

Conclusion:
Just to get it straight: Hibernate is doing the right thing - it's only not easy to find out what is going wrong.




Tuesday, February 24, 2009

Cups error on Leopard: "Missing filter"

Today I was trying to print some files over the printer attached to my mac mini. All I got were pages with errors


ERROR: undefined
OFFENDING COMMAND: csq
I thought first the word processor is sending crap, but after some investigation I found out that the issue is that the generic postscript printer driver is used and not the Laserjet one. Ok, went to preferences and changed the printer to use the Laserjet driver. But still no avail - now the printer even showed up as "not ready" :-(

Looking at /var/log/cups/error_log showed the following:

E [24/Feb/2009:11:02:59 +0100] Unable to execute /Library/Printers/hp/filter/hpPostProcessing.bundle/Contents/MacOS/hpPostProcessing: Operation not permitted
E [24/Feb/2009:11:02:59 +0100] [Job 50] Unable to start filter "/Library/Printers/hp/filter/hpPostProcessing.bundle/Contents/MacOS/hpPostProcessing" - Operation not permitted.

Looking at the two files showed that the x-Bit was missing from them. chmod +x solved this and now the printer is up and running nicely :-)


Thursday, February 19, 2009

Postgres/Hibernate sql fun - NOT

This probably isn't really a postgres, but a more general issue, but then ...

I was writing some stuff in EJB-QL and all I got from Postgres was

ERROR: could not identify an ordering operator for type record
SQLState:42883

This sucks of course :)
After some trial and error I found the following in my query:

group by resource4_.NAME , ... , (measuremen1_.TIME, measuremen1_.ID)

Removing the parens ('(',')') finally made the query run successfully.

Now you may ask, what was the input that led to this? Well, here is is:

SELECT new Foo(a.id, b.id, ..., bla.id, bla.time)
FROM .... , org.acme.Bla bla
GROUP by a.id, b.id, bla

So the query translated the bla in the GROUP BY to (bla,id, bla.time) - including the parens. Explicitly listing bla.id, bla.time in the GROUP BY clause solved this.
This is no fun, as the EJB-QL Query got correctly translated and postgres does not give any hint, what part of this longish SQL it does not like.


MacDeveloper

Are you interested in testing Mac software? You can do so at MacDeveloper.net. I met this site when reporting issues with Trailrunner and the TR autor pointed me to this site, where he has just opened an account.
Meanwhile MD is getting traction and new projects are popping up every week.

And - your time is honored: when you find an issue that is accepted by the developer, you will get points for this. If you have enough points, you will get a rebate on the license or even a license for free -- this depends on the developers and each individual project.


Tuesday, February 03, 2009

Upcoming speaking engagements in March '09

I have been invited by two German Java user groups to talk about RHQ, Jopr and JBoss ON. The talks will be as following:



Both talks are special to me: As I studied in Karlsruhe, I will be talking in the same lecture auditorium in which I used to sit and listen to Professors talks some years ago. The user group in Düsseldorf will record the session and make it available on the web later on.

I am looking forward meeting as many as possible of you.

Monday, February 02, 2009

New OOB subsystem in RHQ

RHQ had since its inception the concept of Out-of-bounds (OOB) metrics. Consider the following diagram:

oob_example


Here we have measurement values denoted by the green and red vertical bars (actually those are aggregates over several values as e.g. seen in the 1h tables). In addition to the values we have a band of 'good' or 'allowed' values (e.g. the typical variation of disk space used).

The measurement values marked in red have outliers outside of the band and thus trigger OOB conditions.

In previous RHQ versions, we were computing the OOB violations against the live data coming into the system, which was expensive on large scale systems. And if you had a violation every minute, the counter was showing you 3600 violations a day - but it did not tell you if those were severe conditions or just tiny little ones.

For the upcoming version of RHQ (or in svn HEAD) we revamped the system in a way that it calculates the OOB conditions from the hourly data table, that already has an aggregation of data from the last hour. Instead of recording the count of OOBs, we are now computing a factor. This is just a number that tells you how severe the violations are. A higher number means more severe. This could come from a one time big violation or from many smaller ones.

The new subsystem view will show you a table about the known OOB violators sorted by severity. You can then go to the individual metrics big charts and if you want also manually set a larger band. Resetting the band will automatically clean out the now obsolete OOBs, as will the automatic recalculation of baselines.

If you want to know more, have a look at the design page and the documentation jira entry.

Tuesday, January 13, 2009

Small review of my yesterdays talk at JBUG Munich (updated with pictures)

I've been invited for some time by Serge Pagop to talk at the JBoss User Group Munich. Yesterday was the big day then.

Munich is not that far from Stuttgart, but the train connection is still slow because part of the tracks are built over 100 years ago, so that the fast train can nevertheless only run 60km/h in some places.

When I arrived in Munich I first met with Heiko Braun from the jBPM team to have lunch together and to talk about Jopr and RHQ and to give him a hands on introduction.

We also took a photo for all of you that don't believe that we are not the same person:

Foto 16.jpg

Heiko (left) and Heiko (right)


Afterwards I worked from his office for some time and then went to the meeting venue (the linked page offers a link to the slides).

Attendance was around 15 people of which there were 4 people from Red Hat Munich. It was nice to meet them too and I think they were happy to get information about RHQ, Jopr and JBoss ON directly from the source.

My talk went on for 1,5 hours - I was showing some slides and also the live system, as well as introduced into plugin-writing (again, slides with all the links etc. should be available soon from the JBug web site).

After talk we had some Q&A and then went into the other room to conclude the meeting with Pizza.

My train back left in Munich on time and I arrived back in Stuttgart at 1:20am this morning. There is no more tram going at that time, so I decided to take a Taxi. Unfortunately I did not have enough cash with me, so I asked about credit card acceptance. "Yes, no problem". But as the driver heard that I don't want to travel a big distance, he indicated me to leave his taxi again "I don't accept credit cards for such a small distance". So I had a 25mins walk from the train station to my home (Germany is no Service Oriented Country).

Here are some impressions from the event:

P1000356.jpg

Serge and I

P1000357.jpg

Part of the audience

P1000361.jpg

Me talking

P1000364.jpg

Socializing after the talk

Sunday, January 11, 2009

Tremendous speedup for NSMetadataQuery

In QNote I am using a NSMetadataQuery to allow the user to search for notes. Even with a notes database of a trivial size, it took ages to find notes (it is basically faster to open a terminal and issue a grep command ). And this even when
I have already restricted the searchScope to the directory with the notes in them.

Today I was experimenting with Spotlight again (is there really good documentation for it out there?).

When I add the type of the data I am expecting (plain text), the search gets real quick - exactly as expected. So the code now looks like this:


// Predicate expression for the search string
NSString *predicateFormat = @"kMDItemTextContent like[cd] %@";

// Predicate expression for
NSString *textType = @"kMDItemContentType == 'public.plain-text'";

// If there is something to search for ..
if (_searchKey != nil )
{
// Create the predicate for the key
NSPredicate *p = [NSPredicate predicateWithFormat:predicateFormat,
[_searchKey stringByAppendingString:@"*"]];

// And one for the type
NSPredicate * subPredicate = [NSPredicate predicateWithFormat:
textType];

// Combine the two
p = [NSCompoundPredicate andPredicateWithSubpredicates:
[NSArray arrayWithObjects:p, subPredicate, nil]];

// And set on the query
[_query setPredicate:p];


This simple addition of kMDItemContentType == 'public.plain-text' provides the speedup.
It is unfortunately not clear to me why, as I don't have any other files of other types in the searchScope.

Next thing for me to investigate is not why this spinning thingy (they are called async arrows :) does not stop spinning when spotlight does no longer return results. Perhaps I need to programatically set this and can't rely on the cocoa bindings here - does anyone know?

JBug-Munich talk 12.1.09

Ok, this is sort of a very short notice..,

I'll talk about Jopr,RHQ and JBoss ON at the JBoss User Group Munich on Jan 12th. The talk wil start at 7pm.

Check out www.jbug-munich.org for more info.

Friday, January 09, 2009

Warranty, repairs, downtime etc.

So, as I was twittering I had an issue with my mac mini at home and especially with its connected Raid in a Taurus case.

The internal hard disk of the mini seems to have died and the raid behaved strangely too. Ok, I got myself a new internal hard disk for the mini and restored it from a Time Machine backup. No really big deal (wasn't too easy, as the installer does not want to directly install from the backup when the data on the backup is more than the internal HD size and it does not let you ignore parts of the data).

But then I had to find out that (very probably) the power supply (one of those external bricks) is broken. When I put a volt meter on the 12V line, I see the voltage dropping to < 11V when the drives want to start, so the drives don't spin up.

I had bought the Taurus enclosure at a local dealer and went there last monday. They were not able to do anything about it, but to sent it to their central office. Today I was calling them about the status and the lady on the phone told me that the box was sent to the central office on wednesday (Tue was a bank holiday here in Stuttgart) and that they did not yet have it in the systems in the central office. She told me that they will probably take it into the system today and starting on it on monday.

If I extrapolate this, I will hopefully the box back monday in a week resulting in 2 weeks of downtime just from the dealer service side.

This is extremely annoying.

When I think back - if I did not go to the local dealer "competent, service, ..." but would have ordered somewhere on the internet, I would probably have saved money when buying and wouldn't have a longer downtime now.

How are your experiences? How do you handle this? I am a prosumer here - this is no way to order a 1 day pickup-return service. Also I can't really afford a several k€ raid array. Actually that raid is just an example of the underlying issue: buying from a local dealer in the hope of getting service - or buying just at the lowest cost (and possibly throwing the stuff away to buy new one).

Monday, December 22, 2008

Zwitscher: JavaME client for Twitter

I have written a little JavaME client for Twitter, called Zwitscher.

Over the weekend I have published a very first version, that is already able to post tweets and to get the friends timeline. So far it is still at a very basic level.

And I have only tested it on my SonyEriccson K610i phone.

If you are interested, you can download the current version from http://bsd.de/zwitscher/. Please provide feedback.

Friday, December 19, 2008

Plugin generator for Jopr/JBossON/RHQ updated


As I wrote previously, I have written a plugin generator for Jopr, JBoss ON and RHQ, which is hosted in the RHQ source tree.

This generator asks a few questions on the command line and creates the necessary directory structure and artifacts depending on the answers.

Since the last posting, I have updated the generator a lot, so that it
is now also able to generate embedded child servers/services and also supports most of the entries in the plugin descriptor.

I have added a dedicated page for the plugin generator in the RHQ wiki.

The old 1.0 version of the binary from the previous post has been removed.

Please provide feedback and report bugs to me.

Btw: If you are new to writing a RHQ plugin, you might want to first check out the "How-To"-Whitepaper.

Tuesday, December 16, 2008

Short Devoxx 08 summary

This post is a summary of a whole week of Java geekdom gathered together in Antwerp, Belgium

The conference was sold out with over 3200 attendees (propably not all did all the 5 days, as I have seen some that only were there on the first two university days). This had an influence on the quality of the Wlan (and the total internet connection) :-/ But in total it was a really good conference. I met a lot of colleagues and other interesting people, learned new things, got three books signed and also delivered three talks.

One of the major focuses of the conference was JavaFX, others were Java 7 with support for dynamic languages and dynamic languages per se.


Of course you can also read my reviews of the individual conference days:

Day 1,
Day 2,
Day 3,
Day 4 and
Day 5



Photo of me at the speakers dinner, of me presenting and here.

Plugin-generator for Jopr, JBoss ON and RHQ

I have written a simple generator that allows to generate plugin skeletons by answering some questions. The generator will afterwards try to generate the respective artifacts. I have added it to RHQ in version 2419. Of course it is also usable in Jopr and JBoss ON.

See below on how to obtain the generator.

Sample run



This is a sample run to create a new plugin called 'test' in my RHQ tree -- user input is marked in bold. Comments at the end of line in italics are mine for explanation. Those will not show up on screen.

$ java -jar rhq-pluginGen-1.0-jar-with-dependencies.jar
Please speficy the plugin root category (Platform, Server, servIce) S What resource category is this plugin using? Most common is server or service.
Please specify its FileSystemRoot: /jon/jonHEAD/rhq/modules/plugins This is the base location of your plugin subtree within RHQ or Jopr
Please specify its PackagePrefix: com.acme.plugins The base in which your plugin should live in. The plugin package itself will be added below it.
Please specify its DiscoveryClass: TestDiscovery The name of the discovery class
Please specify its ComponentClass: TestComponent The name of the component class
Please specify its ParentType: The parent type if this plugin should e.g. be embedded into another one. Can be left empty
Please specify if it should support Monitoring (y/N): y Will the plugin gather measurement data?
Please specify if it should support Operations (y/N): y Will the plugin allow to execute operations on a managed resource?
Please specify if it should support Singleton (y/N): n Is this a singleton kind of server/service? This is e.g. true if it represents a Subsystem with individual resources below it.
Please specify if it should support ResourceConfiguration (y/N): n Will configuration of managed resources be supported?
Please specify if it should support Events (y/N): y Does the plugin gather event type data (e.g. logfile parsing)?
Please specify if it should support CreateChildren (y/N): n Can child resources be created by this server/service?
Please spefify if it should support UsesExternalJarsInPlugin (y/N): y Do you use external chars that need to be put in the plugin?
Please specify its Name: test The name of the plugin. Used for the package, the name and the top level server/service
Please specify its Description: This is a test plugin
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen run
INFO:
You have choosen:
Props{category=SERVER, name='test', description='This is a test plugin', packagePrefix='com.acme.plugins', discoveryClass='TestDiscovery', componentClass='TestComponent', parentType='', fileSystemRoot='/jon/jonHEAD/rhq/modules/plugins', monitoring=true, operations=true, singleton=false, resourceConfiguration=false, events=true, createChildren=false, children=null}
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen generate
INFO: Generating...
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen createFile
INFO: Trying to generate /jon/jonHEAD/rhq/modules/plugins/test/pom.xml
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen createFile
INFO: Trying to generate /jon/jonHEAD/rhq/modules/plugins/test/src/main/resources/META-INF/rhq-plugin.xml
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen createFile
INFO: Trying to generate /jon/jonHEAD/rhq/modules/plugins/test/src/main/java/com/acme/plugins/test/TestDiscovery.java
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen createFile
INFO: Trying to generate /jon/jonHEAD/rhq/modules/plugins/test/src/main/java/com/acme/plugins/test/TestComponent.java
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen generate
INFO: Done ..


Please note, that you still need to add the plugin to the parent pom
file - e.g. like this:

<module>test</module>


Please also note that creation of children (Servers, Services) is not supported in this version.

How to get and start it



The generator lives in modules/helpers/pluginGen. So update your source, go into the directory and compile it via mvn install. To run it, change into target directory and issue java -jar rhq-pluginGen-1.0-jar-with-dependencies.jar as seen above.

For convenience you can directly download the generator from the RHQ wiki (Note: this download can go away any time).

Further reading



I am writing from time to time on my blog about RHQ and have also written a "How to write a plugin" series of posts.

We have compiled this "How to" series into a PDF Whitepaper, that you can download. It might make sense to first having a look at this paper before using the generator.

Feedback



Please tell me if this generator is useful for you (of course you can also put feature requests in RHQ-Jira).

Sunday, December 14, 2008

x2svg updated to use fop 0.95 final

I have updated x2svg to compile against fop 0.95 final.
There is no new binary release yet, as I wanted to look into some other issues first.

If you are running the source, you can just do a svn update to get this minor change.

Let me know if you encounter issues.

Friday, December 12, 2008

Devoxx08 - day 5

Today is the last day of Devoxx and actually it is only half a conference day and the exhibition floor is closed anyway. Will it be a good day? Yes, of course it will.

In the first session JRuby has been presented and how easily you can write programs in it. JRuby will run most of the 'normal' Ruby programs without change - except those that are using C libraries. But even those can be used with some changes. They also showed the nice integration into NetBeans with auto-completion for a lot of stuff.


Next talk I attended was about WOTE (Write Once Test Everywhere). Brian Leonard talked about developers can effectively test apps without the need to access to lots of extra machines. But first it was a sales pitch for Solaris and OpenSolaris (and other Sun products).

After this he showed how to build a database CRUD application in NetBeans and how to turn it into a Java Web Start application, deploy it via web server and test it outside of the IDE.

The next part was about VirtualBox that he was using to test on a different guest. This part was again a big sales pitch (but then I a biased, as I am using Xen on Red Hat Enterprise Linux for work to test on different guests as well :-)

ZFS allows for Snapshots (like the NetApp filers already allowed over 10 years ago), which is kinda neat, as you can define a file system, run the tests and then roll back to the original maiden state.


I went quickly to the talk about EJB 3.1 - from legacy to secret weapon by Adam Bien. Of course I already had some knowledge, but I finally wanted to see Adam live, which I was never able before.

IMG_3074.jpg


My last session was "Dynamic Service Management in High resolution monitoring systems". This was about visualizing data on very large screens (up to 16mx6m in size) with equally high resolutions in real time. The first part was again a sales pitch, which was still interesting, as they showed pictures of the installed screens.

After this the talk went more into the technology behind the Digital Mosaic. An interesting idea behind the software is data driven control room management, where they can update the whole wall and update screen layout when an alert arises. Of course it is also possible to just update a value on screen :-)

IMG_3075.jpg

Picture of a 15mx3m screen






That's it from Devoxx08 - I will probably in the next days post a summary with more pictures from the conference and also from Antwerp, which is a really nice town.

Thursday, December 11, 2008

Devoxx08 - day 4

This conference day started for me with the keynote talk "Effective Java reloaded" by Josh Bloch and "Java SE 7 update" by Mark Reinhold. As the main room was crowded, I went to the overflow room. This feel strange as you see presentation and the speaker on the big screen, but just no one standing in front of you (Josh on that subject of overflow rooms: "You are not missing anything except from the dancing girls").

Josh was giving examples from his 2nd edition of his book about Generics ("Remember your ECS"), Enums (passing data in the constructor, usage of Enums instead of C-style bitfields, use the ordinal method if you really need it and know what you are doing, all Enums are serializable by default - can be used for Serialization-save singletons) and Lazy Initialization (do it only when you need it (fix circularity issue, solve a performance issues), Double check locking works since JVM 5 -- if done right "copy and paste this from the book web site").
IMG_3058.jpg



Next Mark was talking about SE7 and especially also about project Jigsaw under the new title "The modular java platform". He was talking about Java and the JDK are big and amorphous. Running a simple hello world uses 332 classes and takes around 10 times the execution time than the same on Python. So the idea is to introduce profiles to JavaSE as they have been successful in ME already.
This can also extend into the applications by defining what we have today as a classpath as modules with version information and explicit dependencies (the next image shows a possible module and dependency tree).


IMG_3060.jpg


Modularization is coming in the form of JSR 294 in JDK 7 (and not as JSR 277, which is not dead, but 'on hold'); OSGi is out of the game because the platform requirements for modularization are to integrate deeply in the VM and the language, but Sun is talking to the OSGi guys to make sure that the modularity work interoperates with OSGi.

In the last part of his talk, Mark was showing a list of potential features for Java 7. Among those are:

  • Modularization - see above

  • JSR 292, VM support for dynamic languages

  • JSR 203, more NIO Apis (e.g. real filesystem api)

  • Small language changes (Sage re-throw, Better type inference, Multi-catch (YAY!!) TBD) -- See blog of Joe Darcy

  • JSR 296 Swing Application Framework

  • Unicode 5 support

  • Upgrade class-loader architecture (-> deadlock prevention)

  • Swing updates

  • G1 garbage collector, HotSpot improvement

  • Thinking about a MVM-lite

  • JSR 308 Annotations on types (e.g. annotate method parameters with @NonNull and have static checkers running on this stuff, much like ItelliJ and Findbugs are doing it with their proprietary annotations).

  • Concurrency and collections updates (see. e.g. yesterday talk by Brian Goetz)


Some features that won't make it into 7:

  • Closures

  • Operator overloading

  • JSR 295, Beans Binding




The next talk I went to was titled "Towards a universal VM" with a subtitle of "The JVM is not just for java anymore" and was given by Brian Goetz and Alex Buckley. Brian was first defining VMs and what they provide and how they help you writing new languages, as you don't have to re-invent stuff like garbage collection etc. A big advantage is here, that Objects of different languages running on the same VM can reflectively call each other. Another big advantage is hat the HotSpot compiler has information about the hardware and can profile class usage etc. to optimize the behavior, which is not possible with static compilers. It also just allows for an easy implementation of a new language, as its compiler just needs to create dumb code and the VM will speed it up nevertheless.
As an example of this Brian showed results of the great ruby shootout dec 2008 where JRuby is the fastest Ruby 1.8 implementation.

The VM only has a basic set of features; other stuff (also in Java) needs to be implemented by the compiler ("language fictions"). Some of those fictions are difficult to implement efficiently (like e.g. Open classes in Ruby).

IMG_3049.jpg

Brian when signing his book yesterday


Handing over to Alex: This is why JSR 292 is working on a invokedynamic bytecode. In addition there will be a MethodHandle that can point to a block of code. But first before getting to this, Alex was explaining why the current version with invokevirtual is slow and not well suited for other more dynamic languages.

The idea behind invokedynamic is to have the VM call in the user language to consult the dispatching for calls and to trust its result to dispatch then. The good part is that this 'boostrap' code only needs to be called once at the start and after this the direct jump can be inlined and optimized. For all the details you really should go to JSR 292 and / or also watch the recording of this session.

Next to this, Brian was back to talk about the other part of JSR 292, Interface injection. This allows you to modify existing classes to have them implement new interfaces. As an example, this would allow to have java.lang.String also implementing GroovyString. This is also implemented through some bootstrap upcall as just seen before.

There are a few other features in JSR 292, that may or may not make it in Java 7.

John Roses blog (JSR 292 spec lead) talks about all this too.



Next for me was the "JBoss SOA platform overview" by my colleague Mark Little. Mark was having some issues with his presentation template; Did I already mention that white text on light blue background is unreadable? :)

Mark was showing an overview slide of all the possible modules and then listed the features of ESB and the SOA-P(latform) product.



Roberto Chinnici was then giving an "Overview over JEE 6". As I wrote a book on EJB-3 in the past and am a user of JEE 5, this was quite interesting for me. Most of the spec parts are now in public review in the JCP. Goals for EE6 are Easier to use, profiles (full EE, web profile), pruning and extensibility. First profile will be the Web profile. In the future profiles will be defined in the JCP. The current spec just defines the rule on how those profile rules need to work.

A good thing is that the spec is now pruning deprecated stuff. Current candidates are JAX-RPC, EJB 2 Entitiy Beans, JAXR, JSR-88. In consequence this means that they (if confirmed) will be optional in EE 7.

Extensibility means that frameworks (e.g. in the Web tier) can come with a built-in description which is read by the container and which will allow those frameworks to be registered in a zero-conf way in the container (-> web fragments, located in META-INF/web-fragment.xml within the framework).

Another change (especially) in the web tier is to move more to the annotation based configuration by exception development mode.
Proposed components for EE 6 are along with minor updates of others:
  • EJB 3.1 - JSR 318

  • JPA 2.0 - JSR 317

  • Servlet 3.0 - JSR 315

  • JSF 2.0 - JSR 314

  • JAX-RS 1.0 - JSR 311

  • Connectors 1.6 - JSR 322

  • Web Beans 1.0 - JSR-299

  • Bean Validation 1.0 - JSR 303



Also new in Servlet 3.0 (next to the fragments) are annotations for servlets and filters (@WebServlet, @ServletFilter). New is also an async API e.g. for Chat room applications. You need to annotate the Servlet with @WebServlet(asyncSupported=true) and can get a AsyncContext from the ServletRequest on which you can operate. It sounds relatively easy, but can have strange effects on servlet filters, so all filters and servlets need to explicitly enable asynchronous behavior by correctly (re)codig them to support it.

Next were the highlights for EJB 3.1 - I will skip those, as I've written an entry about those in the past already. The only new one are global JNDI names for beans in the form of java:global/(app)/(module)/(bean)#(interface)

EJB components can now also be put directly into Web applications (in the war file).

Within EJB there will also be EJB 3.1 lite, which contains: Session Beans, Tx, Security, Interceptors, ejb-jar.xml. This EJB 3.1 lite can be used in JavaSE and there is a bootstrapping API for this and to embed it e.g. in a Servlet container or in unit tests. EJB 3.1 lite will be in the Web profile.


Current proposed contents of a Web Profile would be
  • Servlet 3.0

  • JSP 2.1

  • JSR-45

  • EL 1.2

  • JSTL 1.2

  • JSF 2.0

  • EJB Lite 3.1

  • JTA 1.1

  • JPA 2.0

  • JSR 250


Still controversial are JAX-RS 1.1, Web Beans 1.0 and JSR 303

Estimated release date for EE6 will be around JavaOne 2009




For the last session of the day I peeked at the Hibernate performance tuning session by Volker Bergmann. Volker points out that there is no silver bullet, but some steps that you can follow to diagnose the issues.

Volker was describing those steps starting from the 10000 feet perspective and drilling down into the details.




One of the nice things of being at such a conference is that one meets people. So for me it is/was great to meet my colleagues. But not only this. I was able to speak with the Jetbrains people about some issues I was having with IntelliJ (I am mostly used to Eclipse an IJ does some things just differently) and they helped me solving those. This is just cool - and I start liking IJ just more and more.

With all the Macs, iPhones and iPods used by Java people, this conference looks a lot like an Apple users conference :)
IMG_3064.jpg



Btw.: There is a nice photo of mine.

Wednesday, December 10, 2008

Devoxx08 - day 3

JavaFX is strong on Devoxx, so the keynote (that I missed was about it). What I did not miss was the talk "From Concurrent to Parallel" by Brian Goetz - this was about the (possibly) upcoming JoinFork classes in Java 7. Brian was describing that the current thread and concurrency model is not suited for future computers with large number of cpu cores. JF provides some implicit divide-and-conquer algorithm working on a ParallelArray data structure. After his talk he was also signing copies of his book at one of the book stores in the exhibition area (Josh Bloch was also signing copies of his books there, even if his signing session will be tomorrow).

After lunch (there were sandwiches and soup, but when I arrived there was no more soup left), I had a talk with Mark Newton from the JBoss.org and went to the JPA2 session done by Mike Keith. Mike showed us the upcoming features of JPA2 and also a collection of funny signs in Canada. This talk was crowded even if a good part of the people didn't know much about JPA 1 at all.

As I am tired, there will be no photos today - I will supply some tomorrow again.

Tuesday, December 09, 2008

Devoxx08 - day 2

Today was my big day with my two presentations and the quickie session.

But first I started off with some real good coffee at my very nice hotel :) When I arrived at Devoxx, the exhibition floor was already crowded with people enjoying breakfast there and playing table soccer at the JBoss booth.

IMG_3016.jpg


IMG_3019.jpg

People at breakfast


I went to the "Java Performance Tooling" presentation by Kirk Pepperdine and Holly Cumminns. They really approached the topic in a funny and very knowledgeable way. Key point to successful performance tooling is to use the right methodology. The two were showing and explaining this with lots of fun, examples and demos.

IMG_3023.jpg


If you have the chance to get the video after the conference, make sure to take the time to watch is and learn from it (there are a few spots, where you can press fast forward :). But I have definitively learned from this session.

Next for me after this talk was Quickie "I spy something ... and it's a bug". When I came into the room, the person doing the previous quickie talk had not even started due to technical issues, so I was only able to start at the time I was supposed to finish. Luckily there was time left after my presentation, so I went through the slides a little quicker - the actual code demo was exactly right. I got some good applause and also some feedback about the issues presented from the audience. One of the feedbacks was that I'd probably enjoy the "Java Puzzlers" book - will check it out.

I took some of the time until my next talk to prepare for it - the conference network is sub-obtimal and relying on it being present is no good idea for a talk.

My other two talks went well as well. The RHQ one attracted around 50 people and the Profiler one around 300. I got good and positive feedback for both and was actually talking to some folks about Jopr and RHQ later on and showing them more at our booth. I hope that there will be more questions to come.

Here are some more pictures from the exposition floor:

IMG_3030.jpg


IMG_3031.jpg


IMG_3045.jpg


There are actually a lot of photos online at http://www.flickr.com/groups/devoxx08


Luckily I got rewarded for all the pain and hassle :-) by the speakers dinner in the Pakhuis brewery....

Monday, December 08, 2008

Devoxx08 - day 1

Pheww this first conference day started early for me: I got up at 4am (actually even woke up earlier) and left Stuttgart with the train at 5:51am. I had to change trains in Cologne and Brussels and finally arrived in Antwerp around noon. Antwerp has a great main station that goes over several levels and where a modern station has been integrated in the historical one:

IMG_2980.jpg


Made a quick stroll to the hotel to drop my stuff and headed to Metropolis. Before doing that, I walked under the Schelde river - there is a pedestrian tunnel starting right in front of my hotel. To get down into the tunnel you can take the elevator (meant for cycles) or alternatively an escalator with wooden stairs. Way cool.

IMG_2989.jpg


There is a tram going directly to the front door of Metropolis; tram tickets are actually quite cheap over here -- 15 € for a 5 days ticket for all of Antwerp.

After registration (which was quick) I went to our booth, which Noel and Tobias were just building. A few other colleagues also joined later - most notably the JBoss.org team, Sacha and Emmanuel Bernard.

IMG_2999.jpg


IMG_2998.jpg


I've been in Emmanuel and Max' talks and it is really impressing when you see them talking in front of the big screens and the huge audience (the rooms have 400 seats ..)

IMG_3002.jpg


IMG_3003.jpg

Thursday, December 04, 2008

Devoxx I am coming

Only four more days until Devoxx 08. I am just finalizing my presentations for my two Tools in Action talks:

I am also giving a little Quickie session on the 9th:


As I will be at Devoxx for the whole conference, you will also be able to reach me at the JBoss booth, where I'll be happy to talk about JBoss ON, RHQ and Jopr.

I will try to post updates about the confernce here on this blog and will also do some twittering about it.

Tuesday, December 02, 2008

Whitepaper on how to write a plugin for JBossON, Jopr and RHQ available

I am very pleased to announce that Red Hat has published my plugin development series as white paper. This document got real formatting from the Red Hat creative team - and it is looking just great. I am very pleased with it. The following is a screen shot of the title page and if you want to see more, you have to download it :)

Screenshot_2.png

Image of the title page of the paper


You can get the paper from those locations:



Many thanks to the Creative team for going over my "rough" text in OpenOffice and making this look so great. I also want to thank Chris Morgan for his work, as well as my colleagues who have read the paper and have given me hints on how to improve it.

Monday, December 01, 2008

Dzone interview with Greg Hinkle on Jopr and JBoss ON

Dzone has done an interview with Greg Hinkle, the project lead for JBoss ON, RHQ and Jopr.

The interview is available as a 23 minutes talk as well as in the form of a transcript. You can read it and listen to it on the Dzone site.