I got the below error “You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null.”whenever the i save something on my IDE and hot deployment is done.The fix for the above error is change overwrite=”true” to overwrite=”false”

<target name="datasource">
<fail unless="jboss.home">jboss.home not set</fail>
<copy file="${basedir}/resources/${project.name}-${profile}-ds.xml"tofile="${deploy.dir}/${project.name}-ds.xml"overwrite="false"/>
</target>

as shown above in your build.xml file.