Yet Another Crap Mission

Just to let you know about my state of despair right now, I’m now involved (single-handedly, with a project leader and someone above and me to handle the whole s***) in a project with VisualAge for Java 4.0, to make Swing screens (remember how “great” the visual composition is with VAJ) and JDK 1.2.2. No CVS or anything, which is just a fine idea amongst others and allowed me to lose everything I’d done yesterday at VAJ first crash.

So I came in this morning with the firm intention to tell VAJ what I really thought of it. Redid everything, taking care to release versions. Well, looks fine. But that was a bit presomptuous on my part. Anyway, around 10 this morning, VAJ started to behave erraticly, complaining about whatever bean or user java code which happens to be not responding. Then crash. I’ve been trying to restart it, fix it, uninstall it, reinstall it ever since. Still no luck.

I’m kind of pissed off to be forced to use VisualAge. I thought it was behind me when I last used it in a project 3 years ago. And I was not even using Swing on that project but the quite good WebSphere Test Environment… I think it’s a mixture of having 2 or 3 JDKs on my machine which runs Win 2000.

Well, to be frank, I’m kind of pissed off. Full stop.¶

 
---

Smoking Ban

The “Smoking Ban” debate has been going on and on and on, and now that it is in place, ink (and bytes) is still flowing about it: Daily Moiders is the latest contribution to this discussion. Marc Mulholland sounds quite unhappy with the ban and in fairness to him, when all this started, I had the same view about the topic. But not anymore.

Maybe passive smokers are not that affected by smoke in public places. But smokers themselves, wherever they are, are in danger. I think – as a smoker – that it is a good law: it makes the smoker be aware that smoking is unhealthy (not to say worse). The smoker is going to feel guilty to smoke, even more that he or she probably already feels for in the past decades, smoking has become a fairly anti-social habit. The fact that the law now unwelcomes cigarettes in public places in Ireland is going to ostracize even more the smokers.

At first, it sounds dreadful – sounds like secluding a group of people. But at the end of the day, all this should have positive result on us (smokers) and make us quit. If all warnings about cancers, both on television and on the packs don’t manage to help us, maybe using this means (guilt) is a more efficient one.¶

 
---

Craic agus Ceol

If you’re asking, excellent week-end, thank you. I was in Wales to attend a wedding some miles away from Swansea, in a lovely little village called Llandybie. Lovely ceremony, both in Welsh and English. Lots of singing – I learnt that “calon” in Welsh has just the same meaning as in Breton, heart, which would make of me someone called braveheart in Welsh too, funly enough – lots of drinking, lots of dancing… Good craic, that’s for sure.

Being the only the only Frenchman amongst Irish, Welsh, Scots and English, it is been somewhat exciting to follow – in a remote manner – first a wonderful Irish Triple Crown and then a French Grand Slam celebrated by everyone but the English.

 
---

<abbr title="PHP: Hypertext Processor">PHP</abbr> 5: “Ready to Serve!”

PHP 5

PHP 5 is in the pipes: Zend has recently launched its PHP 5 Infocenter.

On the menu, resources about PHP 5 novelties, like:

  • Improvement of the object-oriented support;
  • Facilities to handle XML in an easy way;
  • SQLite support;
  • Tidy and Perl extensions.

In this center, there is also an overview of the new Zend Engine II, redesigned to suit the OO needs, as well as i18n and exceptions.

SQLite

SQLite support has been included apparently because of MySQL change of licence (from LGPL to GPL); as far as I understood, it means that PHP will prefer SQLite to MySQL and the MySQL support will have to be activated to be used. To be honnest, I had never heard of SQLite before and it is said to be “compact and fast”:

Two times faster than PostgreSQL and MySQL for many common operations.

First impression: YADb! I guess we’ll see if it begins to be used or not, if the performance claims are proved to be true, if, if… For the moment, I guess people will stick to MySQL: too many changes would have to be done – and yes, because of lame coding.

Comments [2]

 
---

Back on Java Track: JBoss3.0TemplateAndExamples

Times are pretty quiet at the moment, and I thought it was just about time to go back to J2EE. Since I was willing to give a look to JBoss that I’ve not used for quite a while, I stumbled upon this article written by Phil DeJarnett on Netbeans.org website. I just followed the recipe and discovered that there is a mock application which can be used to start with JBoss, called JBoss3.0TemplateAndExamples.

I downloaded the whole lot, along with JBoss 3.2.3 and XDoclet 1.2. I was first frustrated to see that it was not quite a “plug-and-play” operation: the Ant file delivered with the templates wouldn’t compile:

XDoclet classpath missing J2EE classes
        at xdoclet.modules.ejb.EjbDocletTask&para;
                   .validateOptions(EjbDocletTask.java:85)
        at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:94)
        at org.apache.tools.ant.UnknownElement&para;
                   .execute(UnknownElement.java:166) etc.

What I didn’t know starting from there is that it would take me quite a while before I could really make it run… Here are the steps I’ve followed to do so.

Ant file

I had therefore to update the Ant file and add the following in the xdoclet-generate target:

      &lt;taskdef
         name="ejbdoclet"
         classname="xdoclet.modules.ejb.EjbDocletTask"
      &gt;
         &lt;classpath&gt;
             &lt;fileset dir="${xdoclet.home}/lib"&gt;
                 &lt;include name="**/*.jar"/&gt;
             &lt;/fileset&gt;
             <b>&lt;fileset dir="${jboss.client}"&gt;
                 &lt;include name="**/*.jar"/&gt;
             &lt;/fileset&gt;</b>
         &lt;/classpath&gt;
      &lt;/taskdef&gt;

Names and JNDI

After having made those few changes, I managed to compile the test application. But that was certainly not the last step of my long journey towards deployment. The application wouldn’t deploy because of the following error:

The ejb-name for a CMP2.x Entity must be a valid Java Identifier

I then changed the name for my CMP EJB, TestEntity from test/TestEntity to TestEntity, both in TestEntityBean and TestSessionBean which refers to the latter. The reference to the CMP EJB looks like this:

 * @ejb:ejb-ref ejb-name="TestEntity"
 *              ref-name="ejb/TestEntity"

Finders

But the EJB still wouldn’t deploy, JBoss complaining about the fact that the EJB were not spec-compliant.

Several reasons for that. First of all, it looked like the @jboss directives, supposed to generate the finders were not working properly. I moved the @jboss directives into plain EJB-QL queries for the TestEntity bean:

 * ejb:finder signature="java.util.Collection findAll()"
 *            query="SELECT OBJECT(t) FROM TestEntity t"
 *
 * ejb:finder signature="test.interfaces.TestEntity findByName( &para;
 java.lang.String pSurname, java.lang.String pLastName )"
 *            query="SELECT OBJECT(t) FROM TestEntity t&para;
 WHERE t.firstName = ?1 AND t.lastName = ?2"
 *
 * @ejb:finder signature="test.interfaces.TestEntity findAnotherByName( &para;
 int pId, java.lang.String pSurname, java.lang.String pLastName )"
 *            query="SELECT OBJECT(t) FROM TestEntity t WHERE t.id &lt;&gt; ?1&para;
 AND t.firstName = ?2 AND t.lastName = '?3'"
 *
 

I also removed in the BMP Bean the @ejb:finder directive and wrote the finder in the bean:

    public java.util.Collection ejbFindAll(  )
      throws FinderException
   {
      DataSource lDataSource = getDataSource();
      Connection lConnection = null;
      PreparedStatement lStatement = null;
      java.util.Collection result = new java.util.LinkedList();
      try {
         lConnection = lDataSource.getConnection();
         lStatement = lConnection.prepareStatement(
            “SELET Id FROM TestEntity”
         );
         ResultSet lResult = lStatement.executeQuery();
         while( lResult.next() ) {
             result.add(new TestBMPEntityPK(lResult.getInt(1)));
         }

         return result;
      }
      catch ( SQLException se ) {
         throw new FinderException( “Could not find record from DB: “
          + se.getMessage() );
      }
      finally {
         if( lStatement != null ) {
            try {
               lStatement.close();
            }
            catch( Exception e ) {}
         }
         if( lConnection != null ) {
            try {
               lConnection.close();
            }
            catch( Exception e ) {}
         }
      }
   }
   

Local and LocalHome

The last error to occur was that the entity bean was produced without its Local and LocalHome classes. The solution for that was to add the associated XDoclet tasks, &lt;homeinterface&gt; and &lt;localhomeinterface&gt;.

And it worked <sigh>:

New Entity Id is: 2

Take your Pick

If you happen to want to do the same, the zip containing the template for JBoss can be found here. As I may have forgotten to mention changes I’ve made, here are the ones I’ve modified:

I’m aware of the fact that I’ve decided to take easy shortcuts to reach my goal but you’ll have to keep in mind that my original plan was to have a plain look at JBoss… I hope this will help and if you manage to do it in a much cleaner way, I’d be quite happy to hear about it.

References

Comments [3]

 
---

Low Carb and Beer

Last Wednesday was Paddy’s Day and apparently it was mayhem in Grafton Street and Stephen’s Green (according to the listeners of RTÉ liveline) as well as in Belfast. Probably because of alcohol.

Alcohol is bad for your health. And beer makes you fat. That’s why BellaOnline provided us with this article, mentioning beers such as Corona Light, Bud Light, Amstel Light… Never heard of those before but I must the idea is quite scary…

 
---

The ‘Backwards’ Experiment

This is just a plainly amazing experiment. I’m glad to see that there are still people out there who still work for the sake of science. :-)

And this – hilarious – post has just led to the creation of this section, “curiouser and curiouser”:

“Curiouser and curiouser!” Cried Alice (she was so much surprised, that for the moment she quite forgot how to speak good English).¶

 
---

Citizen’s Self-Arrest Form

Still on holidays, so still a holiday link: the Citizen’s Self-Arrest Form. Could be useful in some cases… What a pity the French police don’t set up such a scheme.

If you do attempt an escape, use all reasonable force to stop yourself.¶

 
---

That’s Sweden for You

Since I’m on holidays, Weblogism tends to become very Symphony of the Good Auld Worldish, but that’s great fun, isn’t it? Well, anyway, Ellen and I have planned to go to the cinema tonight to see Big Fish. “Well, pretty easy,” she said, “We’ll book the tickets on the Internet.” Fair enough, she went onto sandrewmetronome.se and started to book.

At some point, a little pop-up opened and a Java applet started to run. And here’s what we got:

A visual programme allowing the Internet user to select his/her seat in the cinema

You can just choose your seat within the cinema just by clicking on the right place. Very ergonomic, very quick, very handy. That’s Sweden for you!

Ellen explained to me that she had done that once and the application asked her (with all the Swedish courtesy) if she wanted to send an automatic SMS to her friend telling her about the film, the time and the place. And I thought of all the hassle you get when you want to go and see a film in Chatelet-Les Halles in Paris, crying on all this precious time lost in queueing stupidly.¶

 
---

England 13 - 19 Ireland

Well, they did it! We followed the match yesterday in the Dubliner Stockholm Southside (in SoHorny?), and after a very stressful match, that was just like a dream: Ireland won against England, World Champions, Grand Slam holders, unbeaten in 22 matches, unbeaten by the Irish in Twickenham for years (I’d say around 10 years or so) and Big-Head Contest winners, on its own soil. Well done!¶

 
---

A4 Redesign Award 2004

“Dans” and “ST-tidningen” have been awarded the A4 Redesign Award 2004, resp. in magazine and newspaper categories. The aim of this contest is to improve the quality of Swedish papers and magazines design and typography-wise.

Good opportunity for me to link to A4 site which I really like. Both for its looks and its contents:

A4 är en designbyrå med bas i Stockholm och medarbetare i flera länder. En sak som skiljer oss från många andra grafiska formgivare är vårt intresse för ordens betydelse, inte bara deras utseende.


A4 is a design office based in Stockholm and employing people in several countries. One of the things that make us different to the other designers is our interest for the meaning of the words, not only for their look. (According to my rough translation)¶

 
---

The Vincent Connare Interview

Vincent Connare interviewed on the Snog Blog. I’ve always cursed Comic Sans but never blamed its designer. What I indeed hate about Comic Sans is its misuse. It is used in contexts which just do not suit, like in calls for tender, in internal notes in companies, on menus in bars and restaurant both in Paris and Malahide, near Dublin, and that really irritates me.

And I’m happy to see – even though not quite surprised – that Vincent Connare thinks the same: he likes his work but it is all about use. Just the occasion for me to link to his website, which has a pretty unfortunate name if you speak French. And to his Magpie font.

Comments [2]

 
---

27.02.04

,

<abbr title="Cascading Style Sheet">CSS</abbr> Won't Stop Amazing me

It looks like I discover a new amazing CSS trick every second day… I am among those who make their drop shadows the brutal way: I open a picture with The Gimp and go with a selection tool, shrink selection, Ctrl+K for a plain border and then a quick filter to actually drop the shadow.

Today’s article in A List Apart by Sergio Villarreal just makes me look plain stupid. It is a fairly easy way to get a drop shadow without even opening an image manipulation program. And it does the trick also with text. Easy, but someone had to think of it. And someone did… That’s what I like in CSS. It looks like you can do anything: you just have to think of it.

And every day, someone comes up with a terrific way of using the lethal weapon – even though it is more than probable that this trick has been around for quite a while and I didn’t come across it before. That would make me look even more silly. In public.

 
---

27.02.04

,

<abbr title="Portable Network Graphics">PNG</abbr> and <abbr title="Internet Explorer">IE</abbr>

Alpha Channels in PNG don’t work with IE, as we have learnt to our cost. It never occurred though that it might be an IE limitation until I read one of Dave Shea’s posts yesterday; for me, who’s rather limited mentally, that was just because of the PNG format. And we would struggle just to get the right transparency (not to talk about The Gimp: I still haven’t figured out how to make a PNG transparent.

But the culprit was elsewhere. And the post mentioned above provides a link for a (somewhat complicated) solution – using AlphaImageLoader. The thing is, once the property behavior is used, the stylesheet doesn’t validate anymore. That’s why I reused WebFX example and inserted a piece of JavaScript to enable the Alpha channal and to validate. The result can be seen here. The drawback? A FOUC bug of some sort. I’ll have to think about that one.

 
---

Type and Lettering in Stockholm

This post is worth mentioning for two good (and personal) reasons. First of all because it deals with types. And also because I’m fond of Stockholm – and of Sweden, where I lived for one year. I happen to go there about once every month and when I had read the first “version” of this post, I thought it was an excellent idea – and decided I’d do the same for my very own pleasure. That’s how I ended up wandering around in Stockholm’s streets, with Ellen’s digital camera, trying to spot all those signs I had seen before.

Also, maybe worth mentioning, Sweden is the country where I bought my first book about typography… Of which I should take a photograph any time soon!

Source: Typographica

 
---

← Older Newer →