Wednesday, December 26, 2012



I just add my blog on Technorati with the reference : SNHEY74ZG7EV

Wednesday, December 12, 2012

Paper about CRaSH : a shell to extends the JVM

I've made an article about an interesting new project : CRaSH
It was published on it is in french but it will be translate.He is a direct link to this paper : 

CRaSH permits to access to the JVM by Shell and then execute scripts that you have mage in JAVA or Groovy ...

Saturday, November 10, 2012

IntelliJ : shortcut with kde

Recently, I use IntelliJ with KDE.
I notice that some keymap didn't work.For example, The shortcut ALT + 1 which open the projet window.
I replace it by ALT + NUMPAD 1.

I will try to fill an excel google drive document with shortcuts : here

Tuesday, October 16, 2012

Git reminder

Just a git reminder to work with github ...

git checkout master
git fetch upstream
git merge upstream/master

git checkout dashboard
git merge upstream/dashboard

git push --set-upstream origin dashboard


git mergetool -t kdiff3
git mergetool -t meld
git config --global merge.tool kdiff3

Clean d'un repository :

For example,

git fetch upstream
git checkout master
git reset --hard upstream/master  
git push origin master --force 


  • git checkout path/to/file
  • For a working copy : git reset --hard

Monday, October 8, 2012

Closure Lambda and Java 8

I found a good link about Closure (Lambda project) of Java 8.With this article, you will have a good idea of what is Lamda :

Keep in my, that Java 8 come next year !

Saturday, October 6, 2012

Junit @Rule

Recently, I've found an article on Junit about annotation @Rule.I didn’t know this annotation before.I will present you briefly how it works and I will give you some interesting links.

In earlier version of Junit, we need to declare @SetUp and @TearDown for each test class.
Now, with newer version of Junit, it’s possible to define its own rule with @Rule and you will have the possibility to execute code during test (Same thing than AOP).
To help you to understand, here is some standard rules :

  • ExpectedException: check if an exception is thrown during test
  • Timeout: check that one test doesn’t exceed a given time
  • ExternalResource: Open or close a resource.
  • TemporaryFolder: create and destroy a temporary directory.

Ref :

Friday, October 5, 2012

Can't import an existing Maven Project with Eclipse Juno and Maven Plugin 1.1.0


I do the following :
Import -> Maven -> Existing Maven Project
Then I choose My project on disk.

I click Next.I have the Maven Selector Plugin Screen :

If I click on Finish, I wait a long time and I finally I hava an error : Problem occured while performing ...


In Maven Selector Plugin Screen, just click on resolve All Later button.
It will permit to have the project on Eclipse and after you could resolve problem.

Wednesday, October 3, 2012

org.springframework.web.servlet.PageNotFound No mapping found for HTTP request with URI


I've met the following error on Jboss (7.1.1) with an application using Spring 3.1.1 :
14:35:03,357 WARN  [org.springframework.web.servlet.PageNotFound] (http-- No mapping found for HTTP request with URI [/sandbox-0.0.1-SNAPSHOT/css/design.css] in DispatcherServlet with name 'sandbox'


You have to add     <mvc:resources mapping="/resources/**" location="/resources/" />

Thursday, September 27, 2012

Spring 3.1.1 and ehcache demo application

I've just commit a new version of demo application on GitHub
This application works on with JBoss 7.It uses Spring and Ehcache.
One important thing is that you could use Crash (a shell to extend the JVM) with it.
I will made a more complete article about Crash.See for more information.

All source code is available at

Spring cache tutorial

Annotation about cache on Spring are properly explained at

Wednesday, September 26, 2012

Fuzz Box: How to generate UML Diagrams from Java code in Ecl...

Fuzz Box: How to generate UML Diagrams from Java code in Ecl...: UML diagrams compliment inline documentation ( javadoc ) and allow to better explore / understand a design. Moreover, you can print and bri...

Sunday, September 23, 2012

Javadoc search engine

If you search a javadoc search engine : and click en

Why the site ?
Like any Java programmer, I regularly need the documentation.The javadoc is well made and rather clear. On the other hand, there is not any simple search engine making it possible to easily find the required classes or methods. Wearied to use the “CTRL+F” of my explorer to find the good word in the list of the 2700 classes, I decided to index the totality of the Java documentation (more than 200 Mo of HTML files !) to create a fast and simple search engine.

Comment : there is not the javadocs for Java 7.

Saturday, September 22, 2012

You want learn Groovy ?

If you want to learn Groovy without buying anything and with alittle fun, you should see
that link :

In fact, you will download a Koans which contains exercises.
You ave to success unit tests to solve the problem.In each test method,
there are explanations about how to succeed.
For myself, I know a little Groovy.I want to learn more but there is always something to do ...
So with theses exercices, you just have to do your exercise.So it's more simple and it permit
to show you all language features ...
So ... I have exercises todo !

Wednesday, September 19, 2012

Crash Spring et ehcache

I test succesfully Crash with an Spring application deployed on Jboss 7.1.1.
This application put datas in Cache at startup and also with an Url.Then, I use Crash to connect
to the application and to call a script for seiing cache datas.
If you want to see the source code, it is available on GitHub (

Tuesday, September 18, 2012

java.lang.NoSuchMethodError: org.springframework.core.convert.converter.ConverterRegistry.addConverter(Ljava/lang/Class;Ljava/lang/Class;Lorg/springframework/core/convert/converter/Converter;)V

 Problem :

When I deployed my war, I’ve the following error :

14:11:53,425 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/sandbox-0.0.1-SNAPSHOT]] (MSC service thread 1-1) Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) fr.dr.sandbox.listener.CacheListener: java.lang.NoSuchMethodError: org.springframework.core.convert.converter.ConverterRegistry.addConverter(Ljava/lang/Class;Ljava/lang/Class;Lorg/springframework/core/convert/converter/Converter;)V
       at [spring-core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
       at [spring-core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
       at<init>( [spring-core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
       at org.springframework.core.env.AbstractPropertyResolver.<init>( [spring-core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
       at org.springframework.core.env.PropertySourcesPropertyResolver.<init>( [spring-core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
       at org.springframework.core.env.AbstractEnvironment.<init>( [spring-core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
       at org.springframework.core.env.StandardEnvironment.<init>( [spring-core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
       at<init>( [spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
       at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.<init>( [spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
       at [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
       at [spring-context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
       at [spring-context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
       at [spring-context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
       at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext( [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
       at org.springframework.web.context.ContextLoader.initWebApplicationContext( [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
       at org.springframework.web.context.ContextLoaderListener.contextInitialized( [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
       at org.apache.catalina.core.StandardContext.contextListenerStart( [jbossweb-7.0.13.Final.jar:]
       at org.apache.catalina.core.StandardContext.start( [jbossweb-7.0.13.Final.jar:]
       at [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
       at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(
       at org.jboss.msc.service.ServiceControllerImpl$
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask( [rt.jar:1.6.0_18]
       at java.util.concurrent.ThreadPoolExecutor$ [rt.jar:1.6.0_18]
       at [rt.jar:1.6.0_18]


If you look carrefully the error log, you will see that there is 2 versions of Spring.(3.0.5.RELEASE et 3.1.1.RELEASE).In fact, I use Spring 3/0.5.RELEASE in my pom.xml and I introduce a library which has a Spring 3.1.1.RELEASE dependency.
To resolve my problem, I update my pom.xml with Spring 3.1.1.RELEASE.

Monday, September 17, 2012

Java podcast

Here is a podcast I did'nt know :
If you have any comment about podcast, post -it !

jk's blog: Duck typing in Java ? Well, not exactly

jk's blog: Duck typing in Java ? Well, not exactly: What is it all about ? According to Wikipedia duck typing is style of dynamic typing in which an object's methods and properties determi...

Friday, September 14, 2012

ScriptRoom: Creating and configuring a MySQL DataSource in GlassFish Application Server.

ScriptRoom: Creating and configuring a MySQL DataSource in GlassFish Application Server.:

Glassfish reminder

./asadmin start-domain domain1
./asadmin list-jndi-entries
./asadmin stop-domain

crash Could not start CRaSSHD Failed to register BouncyCastle as the defaut JCE provider


I deployed crash.war in JBoss and  I’ve the following error : Could not start CRaSSHD

10:22:31,335 INFO  [SSHPlugin] Booting SSHD
10:22:32,826 INFO  [SecurityUtils] Trying to register BouncyCastle as a JCE provider
10:22:36,861 SEVERE [SecurityUtils] Failed to register BouncyCastle as the defaut JCE provider
10:22:36,862 SEVERE [SSHLifeCycle] Could not start CRaSSHD

java.lang.RuntimeException: Failed to register BouncyCastle as the defaut JCE provider

Caused by: JCE cannot authenticate the provider BC
       at javax.crypto.SunJCE_b.a(DashoA13*..)
       at javax.crypto.KeyAgreement.getInstance(DashoA13*..)
       at org.apache.sshd.common.util.SecurityUtils$
       at org.apache.sshd.common.util.SecurityUtils.register(
       ... 79 more
Caused by: java.util.jar.JarException: Cannot parse jar:file:/opt/jboss/jboss-eap-5.1/jboss-as/server/all/deploy/crash.war!/WEB-INF/lib/bcprov-jdk16-1.46.jar

Solution :

- Download  bouncycastle library at (For me its bcprov-jdk15on-147.jar and bcprov-ext-jdk15on-147.jar).

- Copy theses files (eg: bcprov-jdk15on-147.jar and bcprov-ext-jdk15on-147.jar) in /path_to_your_jvm/jre/lib/ext. (e.g: /opt/jdk/jdk1.6.0_18/jre/lib/ext)
- vi /path_to_your_jvm/jre/lib/security/ and add the following line : security.provider.9=org.bouncycastle.jce.provider.BouncyCastleProvider

- Restart jboss.

Monday, April 23, 2012

How to apply Checkstyle format automaticaly ?

Problem :

You want to format your code with checkstyle rule with CTRL-ALT-F.

Solution :

Right clic on the project -> Checkstyle -> Create a Formatter

Then go Windows -> Preferences -> Code Style -> Formatter 

Next, you just have to select the formatter you have created.
After that, you can make CTRL - ALT - F to format you code

Saturday, April 21, 2012

java 1.8 lambda example

I saw at Devoxx France, a conference about java 1.8 and the use of lambdas by Guillaume Tardif. (

In this article, I will show you an example.You can dowload the jdk here :

To install jdk1.8 on Ubunutu, you can do :

sudo mv ./jdk1.8.0 /usr/lib/jvm/
sudo update-alternatives --install “/usr/bin/java” “java” “/usr/lib/jvm/jdk1.8/bin/java” 1
sudo update-alternatives --install “/usr/bin/javac” “javac” “/usr/lib/jvm/jdk1.8/bin/javac” 1

sudo update-alternatives --config java

Then, you just have to choose the jdk.

Note : I have a bug when I use javac because javac -version show me always 1.6 and not 1.8
So to compile, I've done the following :

java Main

Here is my file

import java.util.ArrayList;
import java.util.List;

public class Main {

public static void main(String[] args) {
List names = new ArrayList();
names.forEach( (String s) -> { System.out.println(s);} );


Then we show on the screen :


An other important point, Java 1.8 should support multiple inheritance !
If you have comment, post it !

Tuesday, April 17, 2012


Tomorrow it's the beginning of a great conference.

During 3 days, there will be technical session on JAVA, HTML5, NOSQL, CASSANDRA ... et all new technologies !
Go to the web site to see trend of the moment devoxx

Thursday, March 29, 2012

Import Existing Maven in Eclipse : project has no J on the folder project


I made the following :
- Import  Existing Maven project
- Browse -> Choose Maven project (It has pom Module)

Then I saw in Package Explorer, that my project has a M for Maven but has no J for Java Project !
And therefore package are not managed .


Right Clic --> Configure --> Convert to facet form

Saturday, March 17, 2012

Go : read and write in a file

To read or write in a file, you can use the package io/ioutil which contains méthods like ReadFile orWriteFile

Example :

package main
import ("fmt";"io/ioutil")
func main() {
fmt.Print("Lecture \n");
contents,_ := ioutil.ReadFile("/home/damikde/tmp/server.log")
        fmt.Print("Ecriture \n");
   ioutil.WriteFile("/home/damikde/tmp/toto", contents, 0x777)

Wednesday, March 7, 2012

You can create a free Git open source project by using