Due to popular demand (and also because 'twit' has some negative connotation in some slang forms of English) I have renamed the JoprTwitStats plugin to Twitter plugin. This also means that the location of the source has moved to modules/plugins/twitter within the RHQ svn repository.
As you surely know, I am also active on Twitter as pilhuhn. So I have sat down and started to write a TwitStat plugin for Jopr and RHQ just to show the possibilities of the Jopr platform, that it is not exclusively about managing JBoss products (as some people say) and to show more example code.
Currently the TwitStats plugin lets you:
Post your own tweets
Monitor the number of tweets
Your friends timeline
Public users timelines
Search for stuff
Interesting detail is that the Event dots (green ones) show the post date of a tweet, while the blue monitor dots (number of tweets since last poll) show that number at the time of polling.
Show the monitored tweets as events in the Events Subsystem:
I have built the plugin around the Twitter4J library, which helps a lot in getting things done.
There are still some open issues:
OAuth support is missing
Calls to get tweets are synchronous and block the plugin for too long - those need to converted into async calls
The mini theatre sessions about Jopr are now online at YouTube. This is a four part series of videos. Greg Hinkle, lead of the Jopr, RHQ and JBoss ON projects is presenting:
I have been asked a few times in the last weeks about writing plugins for Jopr, RHQ and JBoss ON. People were interested, but still were not completely sure what to do.
So the first thing to know is that a plugin written for Jopr will also run in JBossON2 and (most probably *) in the new admin-console of JBoss AS 5.1
So I've complied a short list of resources to go through for starting development of a plugin
Whitepaper "How to write a plugin" - don't worry, even if it is named Whitepaper, it has technical content
Plugin skeleton generator with an example run that explains the various questions. This page also hosts binary versions of the generator that are ready to run.
So, I have been at Jazoon for the last few days. I arrived on tuesday at noon - just missing the keynote by James Gosling - I have heard that it was not that good from the content, but I would have liked to see it nevertheless. Then I attended some sessions and had lunch (a "Bratwurst" - sausage, every attendee only one piece). There was a talk about "IPhone hacking for java programmers" - I was expecting to hear about e.g this x-compile effort, but the session really just presented the Apple tools and Objective C. Not that I did not find this interesting and the talk was also well presented, but it just was not what I was expecting.
In the afternoon I went with Bela for a run and then basically went with the other JBoss guys for dinner.
On Wednesday I had my own presentation, which did not that well as I wished - the 50 mins time constraint irritated me totally resulting in me being done too early. But at least I created enough interest to have people come to me later and asking about how to write plugins :)
Rickard Öberg was supposed to give a talk, but did not show up. Everyone said that he was perhaps captured by the CIA :-)
The last session of the day was the final of the "rookies competition" - rookies were asked to submit a talk and the program committee selected three talks that got presented and jury selected the final winner. The talks were of mixed quality and I had the feeling that the 3rd guy was pushed by Sun to the last 3. Luckily at least Bela Ban gave the guys an honest feedback - otherwise the jury process would just have been a big joke. On wednesday evening was the party with burgers for dinner (lunch was pizza). I had some nice talks with some nice guys.
Thursday was the last day for me. Again some sessions, then lunch (sausage again), more sessions and then some talking with Alexander Neumann from iX magazine. Ed Burns was giving a talk (as a backup for a cancelled one) about his new book (I later got a copy of it that he signed) - for me one of the better sessions in the conference.
On all of the three days, the conference network had issues - either it was impossible to get an IP address or some other issue occurred.
So Jazoon leaves a very mixed feeling for me - on one side I had very good face to face talks and fun with people I met and on the other hand I was not happy with many of the talks I attended, the food and the network.
For food and network I could imagine that just raising the conference price slightly and then getting better food for that would work (and buy some more (private) IP addresses too. But for the sessions it is very subjective, so that someone else who was in the exact same sessions than I was, may have found it super.
Today, while being at Jazoon in Zürich, I took a run together with Bela from the Saalsporthalle (close to the conference venue) to the top of the Üetliberg.
Things went a bit strange, as at some point we switched on the most direct track to the hilltop. So in summary we did more than 400m of altitude. This included 'crawling' over tree roots on a very wet soil.
Here is a snapshot from Trailrunner about my performance (grey shows the heigth):
In both cases start height and end height do not match, as my Forerunner took a long time to discover the satellites and only did so while we were already running. This also means the distance has probably slightly longer.
A very nice thing is that at the Saalsporthalle, it is possible to just go into a public cloak room with showers, to change to sporting clothes and to shower later. Outside is even a possibility to clean the running shoes.
Update
A nice fellow at the top of the Üetliberg took photos of Bela and me and sent them via email to me:
When practicing, I was able to run the distance in 2:08h, but on a very flat course, so I was thinking that 2:15h would be realistic for this more demanding course.
But then at km 17 it looked like I would be able to run the track within 2h, so I tried to and here is the result:
My first half-marathon in 1:59:04h - wow, I am happy.
While running I also crossed the 800km border since I started running last year (see e.g. here).
Note that the distro does not have a separate agent download, but the agent is included in the server. Set up the server, log in and then in the top menu you will find Admin->Agents->Download
Otherwise have a look at the install docs in our wiki.
Greg Hinkle already wrote it: JBossON 2.2 has been released. This has been a big release for us - with arounds six month of work.
Some of you may already had a peek at the Jopr 2.2 beta and my know about some of the new stuff.
Changes were (in addition to hundreds of small enhancements and bugfixes):
* UI - Completely updated (and mostly rewritten from Struts to JSF), AJAX based UI with tree views, search and common menu system * Clusters - Cluster oriented tree views with group-wise configuration management and monitoring * Security - Improved DynaGroups queries and new support for recursive compatible groups simplifies access control * Monitoring - Configuration change detection, auditing and historical review * Agent auto upgrade - Agents automatically update themselves when new servers are installed * Subsystem views - Pages that e.g. show alert info over all existing resources * Much better IE support * Speed improvements * Automatic recalculatin of DynaGroups * Plugin skeleton generator
More information about JBossON 2.2 can be found at http://www.jboss.com/products/jbosson
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:
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
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.
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.
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:
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 )
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.
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.
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.
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 PluginOverseerPluginLifecycleListener 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;
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.
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.
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.
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.
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 :-/
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.
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.
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
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.
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 :-)
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.
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.
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.
RHQ had since its inception the concept of Out-of-bounds (OOB) metrics. Consider the following diagram:
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.
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:
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).
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?
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).