Note that there are some explanatory texts on larger screens.

plurals
  1. POHibernate cannot open connection in server
    text
    copied!<p>Hi am developing an struts+hibernate website. I have an issue with the hibernate connection problem. When i am using it in my localhost it is working properly. The issue is i am using the same configuration file with the server database connection username and password the connection not open. I have write the error message to a file in server and it shows the error message as "<strong>Cannot open connection</strong>". </p> <p>Here is my hibernate configuration file</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt; &lt;?xmsl version="1.0" encoding="UTF-8"?&gt; &lt;hibernate-configuration&gt; &lt;session-factory name="session1"&gt; &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt; &lt;property name="hibernate.connection.driver_class"&gt;org.gjt.mm.mysql.Driver&lt;/property&gt; &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost/dev_mydatabase?autoReconnect=false&lt;/property&gt; &lt;property name="hibernate.connection.username"&gt;myusername(not original)&lt;/property&gt; &lt;property name="hibernate.connection.password"&gt;mypassword(no original)&lt;/property&gt; &lt;property name="show_sql"&gt;true&lt;/property&gt; &lt;property name="hibernate.cglib.use_reflection_optimizer"&gt;false&lt;/property&gt; &lt;property name="current_session_context_class"&gt;managed&lt;/property&gt; &lt;property name="hibernate.c3p0.max_statements"&gt;50&lt;/property&gt; &lt;!-- For seeing hibernate log on the console --&gt; &lt;property name="show_sql"&gt;true&lt;/property&gt; &lt;!-- End--&gt; &lt;property name="hibernate.hbm2ddl.auto"&gt;update&lt;/property&gt; &lt;property name="log4j.logger.org.hibernate.SQL"&gt;trace&lt;/property&gt; &lt;!-- &lt;property name="hbm2ddl.auto"&gt;update&lt;/property&gt;--&gt; &lt;!-- All my mapping files are here.--&gt; &lt;/session-factory&gt; &lt;/hibernate-configuration&gt; </code></pre> <p>and in my dao file i write query as</p> <pre><code>SessionFactory sessionFactory = (SessionFactory) ServletActionContext.getServletContext().getAttribute(HibernateListener.KEY_NAME); Session Hibernatesession = sessionFactory.openSession(); Hibernatesession.beginTransaction(); doctorList = Hibernatesession.createCriteria("Hibernate query will be here"). </code></pre> <p>I don't understand what is the issue occured here. Any one please help me.</p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload