JP'zlog

Aller au contenu | Aller au menu | Aller à la recherche

mercredi 9 mai 2007

OpenJDK is go!

The Sun JDK is now completely available under the GPL from http://openjdk.java.net/, at the exception of a few modules (font rendering and audio I think) which are distributed as blobs.

This is now the end of endless stupid flamewars against Java being unpure and not free... or even evil :-)

I am myself very happy by this complete release of the code base. I confess I was even a hard Sun-basher when they were still against the Java opensource move. My main complain was mainly the one of portability across more than the Sun-blessed platforms. I remember myself compiling the JDK on FreeBSD, having to register to download the source code from Sun under the SCCL license, then have a huge patch being applied and come back the next morning for the JDK to be installed :-) There are also many people out there running other hardware/os combinations than Windows, Linux/Intel-AMD or Mac OS X, so this move will make it even more true to say that Java actually is a universal runtime platform.

Many thanks to Sun for this move ... and thanks also to them for their overall HUGE contribution to the opensource ecosystem (think OpenOffice.org, OpenSolaris, ZFS, ...).

jeudi 1 février 2007

Interview Romain

Romain s'est fait interviewé par InfoQ. La vidéo est disponible depuis http://www.infoq.com/interviews/romain-guy, en anglais dans le texte.

mardi 9 janvier 2007

The (other) Netbeans BPEL tutorial

The (other) Netbeans BPEL tutorial

Netbeans + the Enterprise package is probably the most appealing solution to get started with BPEL development. After all, there are not that many free application server + BPEL engine + designer combos :-) However, you may find yourself quickly in a situation where you get bitten by a ton of strange errors either when developing a BPEL process or when trying to execute it. In this tutorial, I will show you how to create a simple process and mention the important points where I have already cut my teeth.

The sample BPEL process that we are going to develop is extremely simple and won't even call an external web service. Given a name and an email, it will generate a single string representation of the form name . As you probably already know, Netbeans will require two projects to prepare and deploy a BPEL process:
  • a BPEL module
  • a Composite application that will reference one or more BPEL modules.

To get started, let's create a BPEL project called ContactBPEL. To build a BPEL process, we now need to create the following files:
  • an XML Schema that defines the messages that will be used as the input and outputs of the BPEL process once exposed as a Web Service
  • a WSDL document that will define the static interface of our service by reusing the previous XML Schema for the data types and by defining the operations exposed by the service (usually just one for a BPEL process
  • the actual BPEL process.

The general rule of thumb is that any error message from Netbeans should not be ignored as you are sure to hit the troubles. So let's define our schema as exposed in the following screenshot.



There is one first gotcha here as we define the schema. For document-style SOAP messages, JAX-WS will not work if you reference schema elements via a type: you will have to reference an element. The WSDL specification work for both, but JAX-WS has a problem there. Hence, for any complex type you need to define an element of this type. In this example we have defined a contact element of ContactType complex type. If you don't do that you will not be able to generate a stub from the WSDL and you will hit problems while defining the WSDL.

It's now time to move on to the WSDL document creation. The first wizard page is easy to fill, don't forget to import your XML Schema:



You can now define the abstract part of the WSDL:



You will have to reference the elements (and not the complex type!) that you have defined to serve as the input and output of the BPEL process. However, accepting the default values would be way too easy :-) Even better: let's say that you leave part1 as the message part name of the input and the BPEL engine will crash with obscure null pointer exceptions... You need to specify 'body' as the message part names.

Once this is done you can move one and define a Document/literal SOAP binding:



We can now move on and create the BPEL process file. Be happy, as you are now over with the strange and unexpected behaviors :-) In fact, the Netbeans BPEL editor is a awesome. Start by dragging the WSDL to the editor, and accept the default partner link creation (unless it doesn't specify that it is going to be your role). The next step is to remove the empty operation, and create the skeleton of the process. Basically, the canvas is that you receive the input message, perform an assignment for building the reply and return it:



By editing the receive and reply activities, create the required variables named input and output. Making the assignment is a breeze and shows how good the BPEL editor is. Click on the Assign activity, and the Mapper editor will show up. From the Strings drop-down menu, select the Concat function, and make the connections as picture on the following screenshot:



Programming using your mouse has never been that easy :-)

All you have to do now is to create a Composite Application and add a JBI module (your BPEL project) to it. Then you can start the Glassfish Application Server and deploy the composite application.

Testing the BPEL process is rather easy now, you can create a standard Java Application and use the WSDL that you have defined to create a Web Service Client reference, then call the service and see that it just works :-)



It works!


mercredi 29 novembre 2006

Gfx@Clermont

Nous avons le plaisir d'accueillir demain Romain Guy pour une conférence à Clermont-Ferrand :-)

jeudi 16 novembre 2006

Mozilla Rhino License changes

The great Mozilla Rhino Javascript engine for Java strangely used to be still licensed under the Netscape Public License and the GPL. This is now over and there will be soon a new release under the MPL/LGPL/GPL licences:

It would be great if the Maven2 repositories could be synchronized as Rhino 1.6R4 is not yet available and has been out for a while now.

mardi 14 novembre 2006

Java goes GPL

Java goes GPL, and that's a real bombshell news from Sun. Many people have been commenting this around, and here is my point of view about this historical announcement.

  • Java will be easy to redistribute, that's great.
  • Java will be ported to more operating systems out of the box (ex: FreeBSD) and that's even greater.
  • The GNU fanboys will finally stop whining about Java beeing evil.
  • The GNU fanboys will probably start to realize that Sun contributes a lot of open source software (OpenSolaris, OpenOffice.org, ZFS and now Java).
  • Projects like KDE will probably start integrating Java more seriously.
  • The choice of the GPL license does make sense for Sun, although I have personnaly come to prefer lax licenses (MIT, BSD, Apache) and middle-ground licenses (MPL, CDDL).
  • I hope that it won't kill the CDDL license that Sun has developed.
  • I hope that Sun won't move to the GPL v3 unless the FSF significantly rewrites it.

mardi 31 octobre 2006

Le couteau suisse des bases de données

Squirrel-SQL vous sauvera la mise dans bien des situations où vous avez besoin de vous connecter à une base de donnée pour y inspecter le contenu, analyser la structure, ou encore effectuer des corrections en cas de pépin. Squirrel-SQL est écrit en Java, et comme tous les types de SGBDs existants (serveurs ou embarqués) ont un driver JDBC, il sera capable de s'y connecter et de les analyser en détails (y compris les tables systèmes). Pour ne rien gâcher il est disponible sous une licence plus libre que la GPL (la LGPL), et il fonctionnera même avec cette saleté infâme de MySQL[1].

Notes

[1] Rappel : "PHP et MySQL, c'est de la merde."