I'm trying to use Hibernate's factory as JMX MBean with my webapp. When I start the server they work correctly. However when I redeploy hibernate mbean (it's a development environment) it's JNDI context disappear from webapp. Even redeploying webapp doesn't change anything.
Should I create some dependency between hibernate factory mbean and webapp? If so, am I correct that I have to repackage the webapp into a service rar?
You should use an ear or sar.