lunedì, novembre 25, 2013

Soup with vegetables

Here a simple recipe to prepare a tasty soup with vegetables. Before starting make sure you have the following ingredients: 2 potatoes without peel, 3 carrots, 10 green beans with the ends cut, 1 pepper, 300ml tomato sauce, salt, oil of olive, 1 onion without peel.
So, let's start!
  • Cut the potatoes, carrots, green beans, pepper, onion in small pieces, not so small though.
  • Put these ingredients in a pot and fill it with the water.
  • Light the fire and wait till the water in the pot start to boil.
  • Once it's boiling reduce the level of firing to minimum and let it boil for other 60 minutes; really this is important, the level of firing should be very low, you should observe the level of water just boiling a bit.
  • Add the potatoes in the pot.
  • Add two spoons of oil of olive and a bit of salt.
  • Let it boil, always with low fire, for about 25 minutes.
  • Add the tomato sauce and half of dado knorr
  • Let it boil for the last 5 minutes.
Finally serve it hot in a dish with some slices of bread.
I learned how to prepare it today in the soup session with my friend Cristian, I hope to have not forgotten some steps so I won't consider myself responsible of the success of the soup ;-)

giovedì, novembre 21, 2013

Building Reactive Apps @ Jug Lausanne

Yesterday I've participated at the meeting @ JUG Lausanne, where there was a presentation with the title "Building Reactive Apps" kept by James Ward.
In the room there were about 40 persons and the speech was kept in English.
After having talked about the reactive manifesto , the speaker shortly introduced the principles of reactive programming
Has followed a demo of how to build a reactive application with the play framework, where he showed the usage of Future classes. Other topics were related websocket, actors in AKKA, scala and so on.
I think I'll give a try to these new technologies.

venerdì, settembre 13, 2013

NoClassDefFoundError in Jboss with maven EJB plugin when using SNAPSHOT dependencies

Context: Jboss 5.1.0, maven 2.x, snapshot dependencies.
Problem: I got this exception after deployed my ear in jboss 5.1.

EAR name: myEAR.ear
ejb component: services.jar

Jboss classloader cannot find the myPackage/MyInterface.class when this is a SNAPSHOT dependency of my services.jar.

Solution: Correct configuration of the maven ejb plugin.
You need to set to false the useUniqueVersion attribute.

org.apache.maven.plugins maven-ejb-plugin 3.0 true false Exception stack-trace:

er.MBeanServerImpl@52f97d27[ defaultDomain='jboss' ]
2013-09-13 14:22:03,699 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to PostClassLoader: name=vfszip:/usr/local/jboss-5.1.0.GA-jdk/server/standard/deploy/myEAR.ear/ state=ClassLoader mode=Manual requiredState=PostClassLoader
org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/usr/local/jboss-5.1.0.GA-jdk/server/standard/deploy/myEAR.ear/services.jar/
        at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
        at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
        at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
        at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
        at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
        at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
        at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
        at org.jboss.Main.boot(Main.java:221)
        at org.jboss.Main$1.run(Main.java:556)
        at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.NoClassDefFoundError: myPackage/MyInterface
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
        at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:63)
        at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:572)
        at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:532)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:530)
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:507)
        at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:134)
        at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)


lunedì, maggio 20, 2013

Spring - Unable to process claimed identity 'https://www.google.com/accounts/o8/id'

Issue - The openId gmail authentication, built on top of springsecurity, stopped to work on my website and I got this error:
org.springframework.security.authentication.AuthenticationServiceException: Unable to process claimed identity 'https://www.google.com/accounts/o8/id'

Reason - in the class OpenID4JavaConsumer
error: org.openid4java.discovery.DiscoveryException: 0x70d: Error parsing XML document

Solution
I fixed the issue by updating the version of xmlParserAPIs and xercesImpl from 2.5 to 2.6.x.
The wrong version for xmlParserAPIs and xmlParserAPIs was brought by jcaptcha so I had to exclude those two.
See this link on jugevents.