Saturday, September 29, 2012

Exception without sans try catch ou throws

If you want to throw an exception without using try, catch, see that link :

Strange !

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.