IntelliJ IDEA / Unsupported classpath format eclipse
Case
The project on which I work is built on Eclipse and Ant. I am trying to migrate it to Maven 3.0. I thought to do this within IntelliJ IDEA.
Once the pom.xml was created, I wanted to revert to a configuration based on Eclipse’s .classpath file.
Then IntelliJ IDEA crashes. On starting up again, I get the following error
Cannot load module file 'jonathanModule' Unsupported classpath format eclipse
Quick Fix
For a reason I ignore, Eclipse integration plugin was disabled. To restore Eclipse compatibility, simply do enable Eclipse integration in the plugin preference menu of IntelliJ IDEA.
Sniffing RMI Traffic… Rather log it!
Suspecting a thread leak, there is some traffic I’d like to track on my JOnAS server: most of all, the calling IPs, with the methods and parameters sent. Actually, I lack some tools, so I tried to snif the network traffic.
Two softwares may make the job:
I discarded these solutions for several reasons. First, there are some issues with Windows Seven compatibility. Moreover, traffic on RMI protocol is SSL-encrypted… therefore not easy to read.
At least, I withdrew from this idea to snif, and I decided to intercept calls thanks to loggers.
In order to enable RMI logs, add the following properties to your JVM (to JAVA_OPTS parameters):
- on client side:
-Dsun.rmi.client.logCalls=true - on server side:
-Djava.rmi.server.logCalls=true
More details and options are available in Oracle’s documentation: RMI Implementation Logging.
By default, the logs look like this:
FINEST: RMI TCP Connection(5)-10.76.35.25: [10.76.35.25: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)] 2012-05-03 15:35:51,053 : Log$LoggerLog.log : RMI TCP Connection(5)-10.76.35.25: [10.76.35.25: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]
(Don’t be fool: this is Java logging, but not Log4J!)
By the way, a very interesting result I got is the following: monitoring and profile tools such as JVisualVM or JProfiler « ping » the RMI server, disturbing the measurements. Let’s consider that as « the Heisenberg uncertainty principle » applied to softwares
Configure JProfiler 5 to work with JOnAS 5
JOnAS 4 (and older) and JProfiler 4 (and older) were used to working smoothly. JOnAS 5 makes a large use of OSGi libraries… which may « blind » JProfiler.
Here is a workaround, slightly different from former version, to bypass this issue, in order to make JProfiler 5 work with JOnAS 5:
- let’s assume you have installed JOnAS in a folder, let’s say
JONAS_ROOT - install JProfiler 5 with default options, set the JDK, licence key, etc., let’s say in a folder
C:\win32app\jprofiler5\also known asJPROFILER_HOME. - edit
%JONAS_ROOT%/bin/setEnv.bat:- set:
JAVA_OPTS=-agentlib:jprofilerti=port=8849 "-Xbootclasspath/a:C:\win32app\jprofiler5\bin\agent.jar" %JAVA_OPTS%
- set:
- edit
%JONAS_ROOT%/conf/osgi/default.properties- in the property
bootdelegation-packages, add the JProfiler packages:
- in the property
bootdelegation-packages com.sun.corba, \
com.sun.corba.*, \
(...)
com.jprofiler, \
com.jprofiler.*, \
com.jprofiler.agent, \
com.jprofiler.agent.*
- add
JPROFILER_HOME\bin\windowsto your environment variablePATH. - startup JOnAS, you should see the following block in standard output:
JProfiler> Protocol version 25 JProfiler> Using JVMTI JProfiler> 32-bit library JProfiler> Listening on port: 8849. JProfiler> Native library initialized JProfiler> Waiting for a connection from the JProfiler GUI ... JProfiler> Using dynamic instrumentation JProfiler> Time measurement: elapsed time JProfiler> CPU profiling enabled JProfiler> Hotspot compiler enabled JProfiler> Starting org/ow2/jonas/commands/admin/ClientAdmin ...
- run JProfiler, follow the wizard, take caution to set JProfiler port at 8849 (or remain consistent with the port set in JOnAS config file)
Starting a new position at Amundi AM
This week I have started a new position as transverse architect at Amundi Asset Management in Paris (France).
I have to manage the project of Stabilization and Reliability of the platform (tens of JOnAS servers, EJB2 to migrate to EJB3, JVM tuning, etc.). I will have to face hard technical challenges.
I wish I’ll spend a nice time with my new team!
Difference between wait() and sleep() in Java
Today in interview I have also been asked the following question: in Java, what is the difference between the methods wait() and sleep()?
First of all, wait() is a method of Object, meanwhile sleep() is a static method of Thread.
More important: Thread.sleep() freezes the execution of the complete thread for a given time. wait(), on its side, gives a maximum time on which the application is suspended: the waiting period may be interrupted by a call to the method notify() on the same object.
« Synchonized » in a block vs on a method
Today, in recruting interview, I have been asked the following question: what is the difference between the Java reserved word synchronized used on a method and this very word in a block? Happily I have known the answer:
Indeed, synchronized uses an Object to lock on. When a methid is synchronized, this means the current object is the locker.
Eg: this piece of code:
public synchronized void foo(){
System.out.println("hello world!!!");
}
is equivalent to that:
public void foo(){
synchronized (this) {
System.out.println("hello world!!!");
}
}
Besides, when synchronized is used on a static method, the class itself is the locker.
Eg: this piece of code:
public static synchronized void goo() {
System.out.println("Chuck Norris");
}
is equivalent to that:
public static void goo() {
synchronized (MyClass.class) {
System.out.println("Chuck Norris");
}
}
Jonathan LALOU recommends… Ronan PIERRE
I wrote the following notice in Ronan PIERRE’s profile on LinkedIn:
I have reported to Ronan for more than two years as I was software architect at BNP Paribas. Ronannot only holds title: he *is* an actual team leader and project director. Efficient, skilled, open-minded, you can trust him: as a provider, he is used to following requirements and keep delays ; as a manager, he will do all that is necessary and sufficient to keep his commitments and find solutions if, ever, an issue appears. I strongly recommend Ronan as a very valuable professional.
Jonathan LALOU recommends… Ludovic MAURILLON
I wrote the following notice on Ludovic MAURILLON’s profile on LinkedIN:
I had reported to Ludovic for more than two years. Ludovic gathers eclectic skills: functionnal, technical and managerial. Ludovic is as fluent in Java as in prime brokerage. As a good leader, Ludovic always listens to his teammates. He is able to create trust and confidence between him and the people he works with. This trust creates strong synergy within and between teams: this is one of the factors that explain the successes Ludovic has encountered in all the projects he was involved in and/or led since I have met him. Shall I recommend Ludovic? Of course! Hire Ludovic, he is among the most valuable professionals you may work with!
Jonathan LALOU recommends… Denis PIHAN
I wrote the following notice on Denis PIHAN’s profile on LinkedIn:
I worked under Denis’ indirect management. Denis is one of the most valuable professionals I have worked with. His knowledge is wide and impressive. Developer, architect, team leader, COO… He has gone up all the stairs. Nothing can stop him. His skills are numerous. Denis inspires trust. His pieces of advice are searched and followed by the tens of peoples who have worked with him. And do not let me forget to mention the enjoyment of listening to Denis’ Aussie accent!
Depart du pole PrimeBrokerage de BNPParibas
Le roman de PrimeWeb
Au debut, il n’y avait rien. Puis Denis crea PrimeWeb en semaine (et coda PrimeRisk le soir et le week-end). Quelques annees plus tard, il en confia la garde a un jeune padawan devenu maitre Jedi, Ludovic.
J’entrai dans la confrerie de l’anneau PrimeWeb en mars 2007. Je fus forme par mon maitre, Jean-Philippe, qui fit de moi ce qu’il etait: un cow-boy. Puis Jean-Philippe s’en alla fonder une autre confrerie, bien qu’il reapparut plus tard par hasard sur nos aggregateurs RSS. Il fut suivi par Marouane qui, lasse de tous ses voyages en Peugot 404, prefera s’installer au pays de Yabiladi. A cette meme epoque, la confrerie s’elargit: ce fut la glorieuse epoque de plusieurs elfes, nains, hobbits, humains et geeks (plus ou moins refoules).
• PYC « c’est quoi ce bousin?!?! »
• Lamine, Bisounours syndique CGT, qui, negligeant le danger, assuma son devoir, et se retrouva au beau milieu du manifestation du Front National pour rejoindre son poste. Lamine n’a toujours pas reussi a me battre a Street Fighter
• Kim Quoc, le roi du Wicket, Bisounours syndique FO.
• Nico Gri, dit “Bart”, le Birt-master.
• Nico Mi, dit “Kiki”
• Nico Ma, le celebre touilleur express, Gentil Organisateur du 1er Devoxx France.
• Karim le chevalier du CNAM.
• Guillaume D., sa Mule et son commercial.
• Pierre-Matthieu, le premier intraboy.
• David, dit “Lyteh”, l’heritier intraboy, exile au Canada.
• Morad, le Kaiser, qui renonca a son ambition de devenir le troisieme intraboy.
• Jieren le crackeur de Wii
• AbdelAziz le discret.
• Hicham au pull violet.
• Jean-Luc,qui sut admirablement prendre la releve de Lamine en portant une echarpe en plein mois d’aout.
Les discussions, melant la philosophie et la geopolitique de la Terre du Milieu, etaient animees: Sarko allait-il nettoyer la France au Karcher? Pourquoi au XXIe siecle IntelliJ IDEA ne compilait pas continuellement en arriere-plan alors qu’Eclipse en etait capable depuis plusieurs annees? Combien de cafes peut-on prendre avant qu’IDEA et WebLogic ne bootent? Est-il possible de lancer une Mule dans un WAR? Qui, de Nico Mi ou Lamine, serait en retard au cours du CNAM le jeudi soir? La main de Thierry Henry jetait-elle le sceau de l’infamie sur Domenech et ses 11 charlots?
PrimeWeb c’etait aussi une mafia: des echanges informels de tours de prod, des extorsions de croissants sous pretexte de build rouge, des punitions sous forme de templates a migrer vers BIRT pour les recalcitrants a l’autorite du chef…
Tout ce petit monde quitta le quartier de l’Opera pour la populaire Barbes. On etait jeunes, on etait beaux, on etait dans un quartier de riches, pres de Surcouf et de Monoprix ; on se retrouvait dans un quartier ou des dizaines de vendeurs a la sauvette, plus ou moins agressifs, repetaient a longueur de journee “Malboro! Malborooooooooooooo! Leggggggeeeeend!”.
L’equipe s’agrandit encore et accueillit des BAPI. Le « PI », loin d’etre une lettre grecque fortement utilisee en mathematique, c’etait pour un « Program Interface », pas tres politiquement correct. Aussi les BAPIs perdirent leur PI et ne furent plus que des BAs. Citons Manu « chemise ouverte », FFK « Milouse », Elodie et Damien.
Notre bebe, PrimeWeb, avait bien grandi. Nos petits freres de MyBook quitterent le navire et eurent leur propre repo SVN. Ludo, le maitre, decida de son cote d’affronter de nouveaux defis loin du code. Nous accueillimes alors de nouveaux maitres de l’anneau: Ronan et Matthieu.
PrimeWeb ce furent de bons moments… et puis il y avait la prod… et puis il y avait la prod BofA… Et puis on croisait parfois quelques boulets (TdDdS, Bouledogue, Caniche, YF «je veux, dans 5′, et j’appelle le client, le report, et j’appelle, dans 5′, avec le report, le client », et compagnie)
Chaque padawan ayant bien grandi, decida de suivre sa voie de Jedi de son cote. Bientôt, seuls Abdel et moi-meme restames du canal historique, pour maintenir la plate-forme en dessus de l’eau. Bien qu’aspires a batir une nouvelle communaute de l’anneau avec d’autres Jedis a NYC et Mumbai, nous ne perdimes pas de vue notre mission: faire bouffer du CSV et du PDL a PrimeWeb pour qu’il recrache du PDF a des clients qui de toute facon ne lisaient quasiment jamais les rapports.
Et puis Abdel, « le meilleur d’entre nous », nous quitta. Nicolas A. et Brice reprirent le bebe.
Les historiens du code s’interrogeront probablement sur la source de ce curieux phenomene sociologique: par rapport au reste de la population francaise, tout individu nomme « Nicolas » a 800% de chances supplementaires d’atterrir sur PrimeWeb.
A mon tour, j’explorais d’autres horizons.
Je parcourais diverses contrees, dont PrimeDB, le mysterieux rivage dont le code est genere et ecrase toutes les nuits.
Enfin, j’arrivai vers mon nouveau havre: la PRSL. Et je fis la connaissance de mes nouveaux camarades: JP, Vincent, MT, Andre, Yves et… les Padawans de Mumbai. De sacres padawans. Je pus leur transmettre ma passion de la litterature Chuck Norris, la peinture Bruce Willis et la sculpture Sylvestre. Nous batimes notre chef-d’oeuvre: la Mule dans Weblo soutenu par MQ.
(je nie publiquement toute responsabilite quant au choix de MQ: ce n’etait pas mon idee ; pour une idee geniale, c’etait une idee geniale…)
Or, apres 604 JIRAs traites, 3643 commits sur le repo PrimeWebSVN (sans compter les commits sur feu le repo PrimeWebCVS et le repo US), 14464 fichiers impactes, 243702 lignes creees, 2900 pages manuscrites, comme tout cow-boy qui se respecte, vient un temps ou il faut se diriger vers le soleil couchant.
• Merci a Ludo et Denis qui m’ont donne ma chance et m’ont permis de progresser dans tous les domaines.
• Merci a Karim, Kim, Lamine, les Nico: plus que des collegues: de vrais amis fideles.
• Merci a Jean-Pierre, un gars formidable, aussi bien humainement que techniquement
.
• Merci a Pascal et Antoine qui auront reussi a me faire partir avec le sourire.
• Merci a Vincent, un petit jeune qui code bien. Tu codes tres bien meme Vincent, tu apprends vite et tu bosses bien, bravo! Tu merites amplement d’etre considere comme le cow-boy de la PRSL!
• Merci a tous, j’espere n’oublier personne: Guillaume, Emma-Gab, Yves, MT, Pascal, Latifa, Georgette, Martial, Lisa, Sylvia, Manu, Fabrice, Brice, Christophe, Nico A, les BAs, Francois L. pour ses polemiques, les RAs, les RMs, Marie, Agnes et les OPs.
• Et bien sur merci a Ronan pour avoir fait le max pour m’envoyer au pays du Coca-Cola, des hamburgers et de Rambo. Ronan est un excellent manager, bonne continuation a lui dans la constitution de la plateforme globale!
Je vous rends l’Ocarina. Et ainsi se clot le roman de PrimeWeb.
5 mars 2007 – 30 mars 2012
Jonathan