November 2005
Monthly Archive
Monthly Archive
I will attend one of the most interesting Java conference in europe, Javapolis. I hope to find maven people over there. I am also willing to talk to atlassian and jetbrains people. And, why not, I might talk to our very dear Hani.
I don’t know if I will be able to communicate but if so, I’ll try to summarize interesting stuff over here!Ouch, it’s been a few days now that my Gmail account is down.
Sorry… account maintenance underwayWe’re currently performing some unexpected maintenance on your account. While we can’t predict exactly how long it will take, we’re working as quickly as we can to restore access to your email–apologies for the inconvenience.
If you have questions, please contact us at gmail-maintenance@google.com.
I searched the web about issues related to gmail and found this post. I hope I won’t lost any mail (it could happen according to this post!). Anyway, if you did send me mails lately, please try again to this address. I just changed the forward so that it goes to another email account.
Let’s cross fingers …
4 comments Saturday 26 Nov 2005 | Stéphane | General
One of the great feature of Java2 Enterprise Edition is its messaging system, defined by the Java Message Service specification.
I won’t explain the basics of JMS, please check this tutorial for more details. There are good materials regarding JMS on the Internet but I think that exception handling is not correctly covered. How can we handle exceptions in services invoked asynchronously? Well, I would say that this fall into two main principles:
/**
* Handles recoverable exceptions.
*
* @param inst the instruction that could not be processed
* @param props the jms message properties
* @param context the reason why the instruction is refused
* @param t the exception
*/
protected void handleError(Instruction inst, Properties props,
String context, Throwable t) {
// Does not throw any exception
rejectedInstructionHandler.
processRejectedInstruction(inst, props, context, t);
}
public void onMessage(Message msg) {
try {
// Get the representation of the message - assume that TextMessage is sent
String xmlInstruction = ((TextMessage) msg).getText();
// jmsProperties contains the message properties and the destination
// where it was received
instructionHandlerHome.create().
processInstruction(xmlInstruction, jmsProperties);
} catch (JMSException e) {
logger.error(”Failed to get message content”, e);
ctx.setRollbackOnly();
} catch (CreateException e) {
logger.error(”Could not create instruction handler instance”, e);
ctx.setRollbackOnly();
} catch (EJBException e) {
logger.error(”Unexpected error”, e);
ctx.setRollbackOnly();
}
}
public void processInstruction(String xmlInstruction, Properties properties) {
Instruction instruction = null;
try {
// Get the instruction
instruction = instructionParser.parseInstruction(xmlInstruction);
// process the instruction
} catch ( InvalidInstructionException e) {
handleError(currentInstruction, properties,
“Invalid instruction”, e);
} catch ( InstructionValidationException e) {
handleError(currentInstruction, properties,
“Validation of the instruction failed”, e);
} catch ( ProcessorException e) {
handleError(currentInstruction, properties,
“Could not process the instruction”, e);
} catch (RuntimeException e) {
handleError(currentInstruction, properties,
“System exception”, e);
}
}
0 comments Thursday 17 Nov 2005 | Stéphane | Java
In this tutorial, I am trying to explain to you how easy you could monitor, configure and manage your Java application with JMX. A good starting point is available at Wikipedia.
Basically, a JMX domain contains MBeans, which are Java objects exposing attributes and operations. Namely, an MBean could allow you to configure your application or watch the server state and fire specific actions if necessary. To me, JBoss provides the cleanest implementation of the JMX specification. Namely, it provides a base MBean class, ServiceMBeanSupport, which allows you to implement a JMX service very easily. This helper class provides callback methods linked to the lifecycle of your component:Here is a very naive implementation:
public class MyFirstService extends ServiceMBeanSupport
implements MyFirstServiceMBean {
private static final Logger logger =
Logger.getLogger(MyFirstService.class.getName());
protected void createService()
throws Exception {
logger.info(”Creating service[”+getClass().getName()+”]”);
}
protected void startService()
throws Exception {
logger.info(”Starting service[”+getClass().getName()+”]”);
}
protected void stopService()
throws Exception {
logger.info(”Stopping service[”+getClass().getName()+”]”);
}
protected void destroyService()
throws Exception {
logger.info(”Destroying service[”+getClass().getName()+”]”);
}
}
Note that each and every MBean needs to implement an interface which exposes the attribute(s) and operation(s) you can invoke on it. Note also that the MyFirstServiceMBean interface is empty and extends ServiceMBean which exposes already the lifecycle methods.
< ?xml version="1.0" encoding="UTF-8"?>
name=”nicoll.net:service=MyFirstService”>
0 comments Sunday 13 Nov 2005 | Stéphane | Java
The english translation of Tarja’s press conference is available here.
1 comment Saturday 12 Nov 2005 | Stéphane | Music & Movies
I have setup recently a Gallery instance on the nicoll.net domain.
Nice, easy to install, easy to use and free! This application is truley complete, almost anything you would think of is available. By the way, if you want to see some nice pictures of us, let me know.0 comments Friday 11 Nov 2005 | Stéphane | General
Well, at first I could not believe it but they did it.
dns.be now provides a .be domain to you for free. The purpose of this is to increase the number of belgian domains on the Internet. OVH is a partner of the operation and provides a 1000Gp for free for any belgian citizen. Well, well, well. Nice! Domains are so hard to find these days (nicoll.net for instance was quite hard to get). I blame the poor guy in search for a .be domain. Edit following a comment: if forgot to mention that it was free for one year. After this period, you have to pay the registration of your domain (around 8€ per year). That said, if you register with OVH the hosting is free at will, provided the domain remains at OVH. This is not specified on their web site but if you browse their forum a bit, you will find the informationAs we said in my region and probably somethere else in the world, I’m “une guerre en retard” which means that I am talking about something which happened quite a while ago.
Well, sorry, I am not (that) a nerdzz. My sweet girlfriend just told me that Nightwish has fired her singer, Tarja in a letter the band gave her after their last show. By the way, one of the links above might be down soon2 comments Sunday 06 Nov 2005 | Stéphane | Music & Movies
Backward compatibility is really an issue in computer software development theses days. And on both sides … Well I would say only one actually but let’s try to be fair.
On the dev side (mine), ensuring backward compatibility is sometimes sooOoo painful (and so easy to forget). Wanna a proof of that? Sun which is definitely a big figure of the Java world has made a funny non backward compatibility in its J2EE specs between version 1.3 and 1.4. In the deployment descriptor of an EAR file, one could specify a description and display-name. Those elements are specified as first elements of the application.xml file. In J2EE 1.3, one must write (to comply with the J2EE 1.3 DTD):
My Cool J2EE application
cool description
0 comments Saturday 05 Nov 2005 | Stéphane | Java
This is the second time I am cooking a meal based on Chiken, Pesto and Riccotta. The recipe can be found here (sorry in French).
The first time, I must say it was a real success. This time, it was quite ok but first time was better. I think the secret is basically about quantities and cooking period: do not hesitate to leave the sauce with the chicken for 5 - 10 min. Anyway, this one is really easy, let me know if you try.3 comments Tuesday 01 Nov 2005 | Stéphane | Cooking