I\'ve got a J2EE application which uses JSP pages as front end and Struts2 as controller. I also use Hibernate to map my objects into a MySql DB. when I deploy the application o
Hibernate uses a primitive connection pooling mechanism, which is not suitable for production purposes (it even says that in the log file!). You should always use a connection pooling mechanism, be it the one provided by your container, be it a mechanism bundled in your application (c3p0, for instance). The exception you are seeing is because MySQL closed an "old" connection which Hibernate is still using. You can try to add a JDBC URL option, like "autoReconnect", but that's really not a long-term solution.
Ideally, you should configure your container to supply the connections to your application through JNDI. This is easily done with a "-ds.xml" file in JBoss or with a context.xml for Tomcat.
Once I get a similary looking exception, when I used a connection pool and the connection was closed after some time, but the pool did not recognized it.
What helped me in this case was to add a validation query to my data source:
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
...
<property name="validationQuery" value="select 1"/>
</bean>