By the looks of it, this is an upgrade issue. I.e. it happens when
you install RHQ 4.5.0 and select to upgrade an already existing database with
some resources imported in the inventory.
Hmm. this obviously sucks. If its true that we have an upgrade issue, we need to release a
fix. And we should probably consider releasing some kind of SQL to help fix people who
already upgraded.