ClassNotFoundException when adding slf4j to Akka

When adding to a Akka project I got the following error java.lang.ClassNotFoundException: akka.event.slf4j.Slf4jLogger. I double checked my configuration and the Akka documentation. The documentation says the following:

Akka provides a logger for SL4FJ. This module is available in the ‘akka-slf4j.jar’. It has one single dependency; the slf4j-api jar. In runtime you also need a SLF4J backend, we recommend Logback.

No success. Continue reading

Pretty printing Akka config

Akka makes use of HACON (Human-Optimized Config Object Notation) for configuration. Today I needed to check the config that was loaded. When printing the config to the terminal it is displayed in a compact format. I wanted to pretty print it so it was easier to read. I found a briljant blog post by marcinkubala.

I adapted a code snippet as follows: Continue reading

Deleting a remote tag in Git

Today I deleted a tag in Eclipse using EGit that was already pushed to the origin. I then discovered that once the tag is deleted in the local repository there is no way in EGit to delete it from the origin. I am using Github as remote repository. So I checked if the tag could be deleted there. Unfortunately I could not find a delete option there. Bummer what now? Command line git to the rescue. Continue reading

My favorite Eclipse shortcuts

This is a collection of Eclipse shortcuts I use often:

Mange Files and Projects

  • Alt+Enter: Show file properties of file open in the editor.
  • Ctrl+S: Save the current file.
  • Ctrl+Shift+S: Save all open files.
  • Ctrl+W: Close the current file.
  • Ctrl+Shift+W: Close all open files.
  • F5: Refresh selected workspace element with the local file system.

Continue reading

Generating a large test file with Scala like the Linux dd command

I was writing functionality to merge download chunks yesterday. This functionality takes a file that is downloaded in chunks and mergers these chunks back into a single file. Writing the test class I did not want my test to depend on downloading a file in chunks, so I needed a way to quickly generate a number of chunks that could be merged. Under Linux the dd command is available that generates a file of a given size that contains random contents. I wrote a small helper class that does exactly this, with the extra twist that it splits the file into a number of chunks. Continue reading