Joined: Fri Aug 29, 2003 10:03 am Posts: 5
|
I am using hibernate 2.0.3 in JBoss. It's not configured as an EJB service, it is just used in some classes. The configuration is read and used in the following fashion:
conf.addInputStream(this.getClass().getResourceAsStream("hibernate.cfg.xml"));
SessionFactory sf = cfg.buildSessionFactory();
Session sesna = this.newSession();
sesna.beginTransaction();
When I want to start a new transaction an exception apears:
java.lang.UnsupportedOperationException: The user must supply a JDBC connection
at net.sf.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:32)
at net.sf.hibernate.impl.SessionFactoryImpl.openConnection(SessionFactoryImpl.java:396)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:2914)
at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:39)
at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:22)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1981)
...my methods
The configuration looks like this:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory name="java:comp/env/hibernate/SessionFactory">
<property name="hibernate.connection.url">jdbc:postgresql://machine.somewhere.cz:1234/satai</property>
<property name="hibernate.connection.username">satai</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.pool_size">50</property>
<property name="hibernate.statement_cache.size">50</property>
<property name="hibernate.dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
<mapping resource="chamurabi/imp/Predmet"/>
<mapping resource="chamurabi/imp/Pravo"/>
<mapping resource="chamurabi/imp/NastavenePravo"/>
</session-factory>
When I tried to google "The user must supply a JDBC connection" i get only two links and no one seems to be relevant. Does anybody have a hit what to do?
|
|