java web start jws legacy publish web start

Web Start your legacy applications

In this article, we’ll see how to make an old-but-useful legacy Java application into a brand new Java Web Start (JWS for short) application. JWS is an often overlooked technology that works miracles. With it, you can deploy any Java application, as easily as you would a web one: with the only update server-side and still your application running client-side, with access to all its resources. JWS has two main features: the downloading of the application to the client and the launching of

C jani Java java native access jna native win32 windows

JNA meets JNI

I reccently stumbled upon a nice framework you’ll love if you ever have to work with native code. Before this framework, if you needed to call native code, you would use JNI. JNI uses a proved but complex and error-prone process. First thing first, you write your Java classes like always. But for methods you want to delegate to native code, you use the native keyword and do not provide an implementation. Then, you call a JDK-provided executable named javah. This generates your C header fi

iNove Mandigo theme

Theme change

If you already visited here, you can clearly see something has changed. In order to celebrate my new job, Spring eternal and what have you, I changed my blog’s theme. I previously used Mandigo, which has many, many options but I grew tired of it. Mandigo is a beautiful theme but I wanted something more focused, that doesn’t take precedence over what is written. My choice went with iNove, even if I had to hack the theme PHP scripts to keep Goggle analytics scripts and favicon. It’

factoryBean mockito proxy spring spy stub stubbing unit testing

Mockito' spy() method and Spring

Mockito is a mocking framework (see Two different mocking approaches) that is an offshoot of EasyMock. Whatever the mocking framework one uses, a common feature is the ability to mock interfaces, through the JDK Proxy class. This is well and nice, but one has to explicitly mock every method that one wants to use in the course of the test. What if I want to mock an already existing implementation, with some methods providing behaviours that suit me ? Today, I ran across this case: I had a legacy

isolation mock mockito mockrunner test

Two different mocking approaches

Whether you choose to choose to adopt TDD or a more traditional approach, you will test your classes in isolation. This usually mean you code with interfaces and inject your dependencies in your classes. Last year, I had to test a servlet. Servlets are the showcase to demonstrate out-of-container testing because of their dependencies to said container in their doXxx() method. Every one of these methods has a dependency on HttpServletRequest and HttpServletResponse. Both are interfaces that have

app engine google

Google AppEngine limitations for Java (and how to overcome them)

Since the start of Google’s App Engine for Java, I have tried to create a small but representative project and to deploy it on Google’s infrastructure. I have learned much, mainly by making mistakes. Interestingly enough, there are much that I achieved I didn’t hope I would. On the contrary, the Devil is in the details, as they say, and I found some problems I couldn’t imagine there: for some, there are other solutions, for some, there aren’t. Eclipse Eclipse is

app engine free hosting google

Free Java hosting

They did it! Yes, they did it! Since a long time, PHP hosting is avalaible freely on the web from a multitude of providers but when you search the web for free Java hosting you find…​ nothing. Mark today as a the day Java free hosting came to reality: they did it! Who? Them, the techies from Google now support Java as their second language on Google App Engine. GAE leverages the entire Google infrastructure to host your web applications. Strangely enough, it was until then only avai

jaas loginmodule realm security tomcat

Custom LoginModule in Tomcat

Tomcat manages application security through the concept of realm. A realm is a coherent package of name password pairs that identify valid users for a web application. Tomcat’s default realm is MemoryRealm. This realm reads the famous conf/tomcat-users.xml file and uses it check for name password pair validity. Tomcat also provides realms to check against pairs stored in a database, either through a direct connection, or through a configured datasource. The main disadvantage of these all