Skip to main content

Posts

Showing posts from 2014

Software University Conference Presentation about Java 8

This is video from the presentation I did for Software University   conf  at Borovetz, Bulgaria. And here is the presentation (slideshare) only. I recommend to watch the previous video in my post bellow since it has more content (but I speak a bit faster there :) )

Patching a Maven library with your custom class.

Sometimes you use a library that has a bug. Or maybe it doesn’t has a bug but you want to change something. Of course if it is an open source you can get the sources… build them … with your change and so on. However this first takes a lot of time and second you need the sources. What you usually want .. is to just replace one class.. or few classes with something custom… maybe add a line .. or remove a line and so on. Yesterday… I had an issue with jboss-logging. The version I was using was 3.2.0Beta1 and it turns out that using this version and log4j2 2.0 final basically meant that no log is send to log4j2. The reason was a null pointer exception that was catched in jboss logging class called Log4j2Logger. The bug I submitted is here https://issues.jboss.org/browse/JBLOGGING-107 and it was fixed at the same day. However I will use it as an example since I didn’t knew when this will be fixed.. and I didn’t want to wait till it is fixed. So I was thinking what I want.. to take the j

spring-loaded rocks !

Today I found spring loaded ( https://github.com/spring-projects/spring-loaded ) in short this is a java agent that enables class reloading of already running VM. Simply this means zero deployment time (in many cases). It is like a free and open source alternative of JRebel. Spring Loaded allows you to add/modify/delete methods/fields/constructors. The annotations on types/methods/fields/constructors can also be modified and it is possible to add/remove/change values in enum types. There is a preliminary java8 support. There is also another project DCEVM ( which is also great but supports only till JRE 6 update 26). More info here http://ssw.jku.at/dcevm/ But lets stop speaking and show you how it works. In short you just need to pass the agent when starting the vm and that’s it. >java -javaagent:D:/Downloads/springloaded-1.2.0.BUILD-20140409.201438-12.jar -noverify org.gochev.MainClass I am using this Build since I am running Java 8 and this is currently the latest . The