Changing an index in MongoDB

We are using the @Indexed annotation in Morphia and when we changed to @Indexed(unique=true) we were first surprised when nothing happened. Our first thought was that this might be a problem in Morphia. However, on second thought automatically changing an existing index is probably not a good idea! Although I couldn’t find anything in the [...]

Tags: ,

Autowiring Morphia entities

My current project is using Morphia to handle object mapping to/from mongoDB and I wanted to add dependency injection using Spring to my entities like this: @Entity public class MyEntity { … @Autowired @Transient private SomeService someService; } Notice the @Transient annotation that tells Morphia to avoid persisting this field! I solved this problem by [...]

Tags: , ,

Apache Camel automatic type conversion

Apache Camel has good support for type conversion and it is easy to add your own type converters. In this blog post I’ll show how to create a generic type converter using reflection. Type conversion is done by Camel either when you explicitly tell Camel to perform conversion or in some cases where Camel detects [...]

Tags: , ,

OSGi quick start

OSGi has been looking promising for a long time, but I have felt that getting started have been really complicated and deploying dependencies have been messy, in particular for transitive dependencies. While I was looking into deployment options for Apache Camel I realized that a lot has happened with OSGi since last I looked. In [...]

Tags: , ,

Apache Camel and SOAP

To learn more about Apache Camel I have implemented a non-trivial integration scenario using freely available SOAP web services to create a service that can return the weather at an airport. The webservices are: The Airport Information Webservice to find the location of an airport The National Digital Forecast Database Webservice provided by http://www.weather.gov/ to [...]

Tags: , , ,

Developing Minecraft Plugins

Minecraft is the most interesting gaming concept I’ve seen in many years. It is sort of a digital equivalent of Lego and allows people to build and experience amazing worlds. With well over 2 million copies sold and 1.2 million YouTube videos you quickly realize that people like this kind of game. Using just the [...]

Tags: , ,

Developing JMeter plugins using Maven

I have been using JMeter for load testing and I needed to create a custom plugin to handle parsing JSON results but I couldn’t find a simple guide how to do this. I wanted a simple solution that didn’t require manual installation in my repository or a repository manager such as Nexus.

Tags: , , ,

Sneaky throw

The latest issue of our magazine Jayview is out with brand new look and feel. My contribution was a cool piece of code that gets rid of those annoying exceptions. However, during layouting the link to the source disappeared. Credit should of course go to Reinier Zwitserloot and his mail on Java Posse. public class [...]

Tags: , ,

Getting around static typing in Scala

I really like static typing, but sometimes it can get in your way. For instance if you have a collection of objects and you want to perform an operation on the objects of a certain subclass you can run into problems.

Tags: , ,

WebLogic 10.3 JMX

I have been using Oracle WebLogic 10.3 for a while in my current assignment. I wanted to publish my own custom MBeans and be able to see and edit properties and invoke methods on them. However, the built-in management console does not support custom MBeans (without adding custom configuration). I ended up using JManage which is an open source management console implemented as a web application.

Tags: , ,

PowerMock 1.0 released

We have released 1.0 of PowerMock just in time for the Øredev conference! PowerMock is an open source mock framework based on EasyMock that allow you to mock static methods, private methods and even constructors. Our intent is mainly to allow unit testing of legacy code and people really seemed to appreciate this idea at the conference.

Tags: , , , , ,

Azul

We have got the privilege to borrow an Azul Vega 1 which is the smallest of Azul‘s monster machines. This evening a bunch of us Jaywayers gathered to try it out. Installing the Azul JVM was painless and all of us were up and running very quickly. Read more…

Tags: , , ,

JAOO 2008 in AArhus

This year at JAOO all 5 keynote speakers were language designers so there was a clear trend talking about new languages, for example Scala, F# and Fortress. What motivates this is the trend toward more parallel computing with more cores per machine and also to increasing popularity in cloud computing. That is, parallel computing applies [...]

Tags:

Development 13 years ago

Back in 1994-1995 me and a friend wrote a game called Gravity Force 2 on the Amiga. It got very popular and we still get the occasional email about it. Some people have requested to look at the source code and now it is finally released!

Tags: , , ,

Mocking Static Methods

Mock objects is a very useful technique for unit testing as it allows you to focus your testing efforts on the class being tested instead of on its collaborators. Unfortunately, not everything is an object and therefore you cannot always use mock objects. This article will show how mocking can be generalized to include more [...]

Tags: , ,