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 [...]
Changing an index in MongoDB
December 15th, 2011 by Jan Kronquist — Java
Autowiring Morphia entities
December 7th, 2011 by Jan Kronquist — Java
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: mongodb, morphia, spring
Apache Camel automatic type conversion
August 12th, 2011 by Jan Kronquist — Java
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: camel, integration, Java
OSGi quick start
July 15th, 2011 by Jan Kronquist — Java
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: Deployment, karaf, osgi
Apache Camel and SOAP
July 14th, 2011 by Jan Kronquist — Java
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: camel, integration, Java, sample
Developing Minecraft Plugins
May 22nd, 2011 by Jan Kronquist — Java
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 [...]
Developing JMeter plugins using Maven
July 7th, 2010 by Jan Kronquist — Java, Testing
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: Java, jmeter, performance, test
Sneaky throw
January 29th, 2010 by Jan Kronquist — Java
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: exception, jayview, tricks
Getting around static typing in Scala
January 23rd, 2010 by Jan Kronquist — Java
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: collections, programming, scala
WebLogic 10.3 JMX
April 9th, 2009 by Jan Kronquist — Java
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.
PowerMock 1.0 released
November 21st, 2008 by Jan Kronquist — Java, Testing
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: easymock, junit, mock, open source, oredev, powermock
Azul
October 20th, 2008 by Jan Kronquist — Architecture
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: concurrency, hardware, programming, scala
JAOO 2008 in AArhus
October 2nd, 2008 by Jan Kronquist — Events
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: conference
Development 13 years ago
September 22nd, 2008 by Jan Kronquist — Uncategorized
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: development, game, programming, retrospective
Mocking Static Methods
May 1st, 2007 by Jan Kronquist — Java
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: automated testing, jayview, programming
