The following are the configuration details.
I have tried various connection.url but every time I get the same error.
Some of the URLs I tried are
1. jdbc:mysql://localhost/dev
2. jdbc:mysql://localhost:3306/dev
3. jdbc:mysql:///dev
Hibernate version: 3.2.5
Mapping documents: <hibernate-configuration> <session-factory> <property name="current_session_context_class">thread</property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.url">jdbc:mysql:///dev</property> <property name="connection.username">root</property> <property name="connection.password">nilay</property> <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.c3p0.initialPoolSize">3</property> <property name="hibernate.c3p0.minPoolSize">3</property> <property name="hibernate.c3p0.maxPoolSize">10</property> <property name="hibernate.c3p0.idleTestPeriod">300</property> <property name="hibernate.c3p0.timeout">300</property> <property name="hibernate.c3p0.maxStatements">10</property>
<property name="hibernate.show_sql">true</property> <property name="hibernate.format_sql">true</property>
<mapping resource="web/persistence/config/UserLogin.hbm.xml"/>
</session-factory> </hibernate-configuration>
Full stack trace of any exception that occurs:
org.hibernate.HibernateException: connection is not valid without active transaction at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:297) at $Proxy0.connection(Unknown Source) at web.datamanager.test.UserLoginDAO_AT.testConnection(UserLoginDAO_AT.java:21) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Name and version of the database you are using: MySql Server version: 5.0.45-community-nt MySQL Community Edition (GPL)
Am I missing something.
Fyi, I havent modified the tomcat server.xml.
Thanks,
Nilay Chheda
|