What application server are you using?
This will work OK but if you're using JBoss, using a service deployment works better.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4015294#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...