Hi,
I'm trying to deploy a WAR web application that uses hibernate to connect to a DataSource configured in a Jboss 4.0.1 App server.
However, evertime I start the application server it throws a java.lang.StackOverflow error when trying to build the Hibernate SessionFactory.
Here is the datasource definition in the deploy directory
<datasources> <local-tx-datasource> <jndi-name>comp/env/jdbc/DB1</jndi-name> <use-java-context>true</use-java-context> <connection-url>jdbc:mysql://localhost:3306/DB1?autoReconnect=true</connection-url> <driver-class>org.gjt.mm.mysql.Driver</driver-class> <user-name>root</user-name> <password>root</password> <metadata> <type-mapping>mySQL</type-mapping> </metadata> </local-tx-datasource> </datasources>
<jboss-web> <resource-ref> <res-ref-name>jdbc/DB1</res-ref-name> <res-type>javax.sql.DataSource</res-type> <jndi-name>java:/comp/env/jdbc/DB</jndi-name> </resource-ref> </jboss-web>
<resource-ref> <res-ref-name>jdbc/DB1</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> <resource-ref>
<hibernate-configuration> <session-factory name="emp:/hibernate/SessionFactory"> <property name="connection.datasource">java:comp/env/jdbc/DB1</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
URL configFileURL = HibernatePlugIn.class.getResource(configFile); Configuration configuration = (new Configuration()).configure(configFileURL); SessionFactory factory = configuration.buildSessionFactory();