Sounds like you made a mistake... but without seeing the code you have written it's very difficult to help. If you're stuck you can zip up the plugin and attach it here. Or, better still, put it on Github and point us to it.
Check very carefully that you have named all your classes properly. An easy mistake to make.