Applications deployed through MainDeployer in jmx-console do not survive the server restart, because they are created in the tmp folders. This is a known limitation. Since you are on AS 5.1, you can instead use the admin-console to deploy your application (or do it manually).
Thank you. but my requirement is deploy applicatation programmatically. For that i am using JMX.
Is there any other way to do this?
See if this helps http://community.jboss.org/message/196974#196974. For JBoss AS5, there's also a ProfileService API for doing the deployments. But I haven't looked into those details yet, so don't know much about that.