Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004491 [Resin] minor always 04-09-11 11:16 04-27-11 17:56
Reporter rickHigh View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0004491: Roo app not running in Resin (JPA w/o jta-data-source)
Description Roo is the way to generate "best practice" spring 2.5/3.0 applications.
Roo apps are tested in JBoss and Tomcat and they run out of the bat in those environments.

Roo apps do not seem to run in a Resin environment without changes.

It appears that Resin finds a loads the persistence.xml file (which it does at at com.caucho.env.jpa.PersistenceUnitManager.createDelegate(

Then Hibernate complains that there is no JDBC connection.

     [java] java.lang.UnsupportedOperationException: The user must supply a JDBC connection
     [java] at org.hibernate.connection.UserSuppliedConnectionProvider.getConnection(
     [java] at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(
     [java] at org.hibernate.tool.hbm2ddl.SchemaExport.execute(
     [java] at org.hibernate.tool.hbm2ddl.SchemaExport.create(
     [java] at org.hibernate.impl.SessionFactoryImpl.<init>(
     [java] at org.hibernate.cfg.Configuration.buildSessionFactory(
     [java] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(
     [java] at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(
     [java] at com.caucho.env.jpa.PersistenceUnitManager.createDelegate(
     [java] at com.caucho.env.jpa.PersistenceUnitManager.start(
     [java] at com.caucho.env.jpa.PersistenceManager.startPersistenceUnits(
     [java] at com.caucho.env.jpa.PersistenceManager.environmentConfigureEnhancer(
     [java] at com.caucho.loader.EnvironmentClassLoader.config(
     [java] at com.caucho.loader.EnvironmentClassLoader.bind(
     [java] at com.caucho.loader.EnvironmentClassLoader.start(

Roo apps come preconfigured with this for JDBC (in applicationContext.xml):

    <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource">
        <property name="driverClassName" value="${database.driverClassName}"/>
        <property name="url" value="${database.url}"/>
        <property name="username" value="${database.username}"/>
        <property name="password" value="${database.password}"/>

I know there are workarounds. We should document the workaround on the Resin wiki and on the Roo forum. This way folks that want to use Roo with Spring 3 can.

Also in the future Resin may want to check to see if jta-data-source is set in the persistence.xml.


If jta-data-source is not set, then it might be a good idea if Resin does not process the persistence.xml and assume Spring or something else is going to deal with it directly.

I think many (if not most) Spring applications use BasicDataSource and not JNDI.

Resin might not work with a lot of JPA applications for this reason.
Additional Information
Attached Files

- Relationships

- Notes
04-09-11 11:46

Work around:

Run this command from the roo console:

roo> persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY --jndiDataSource jdbc/basic

Then add jta-data-source to your persistence.xml file.

Adding <jta-data-source>jdbc/basic</jta-data-source> to persistence.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="" [^] xmlns:xsi="" [^] version="2.0" xsi:schemaLocation=" [^]"> [^]
<persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL">
            <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
            <!-- value="create" to build a new database on each run; value="update" to modify an existing database; value="create-drop" means the same as "create" but also drops tables when Hibernate closes; value="validate" makes no changes to the database -->
            <property name="" value="create"/>
            <property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy"/>
            <property name="hibernate.connection.charSet" value="UTF-8"/>
            <!-- Uncomment the following two properties for JBoss only -->
            <!-- property name="hibernate.validator.apply_to_ddl" value="false" /-->
            <!-- property name="hibernate.validator.autoregister_listeners" value="false" /-->

Lastly add this resin-web.xml file to your WEB-INF directory:

<web-app xmlns=""> [^]

<database jndi-name='jdbc/basic'>
  <driver type="org.hsqldb.jdbcDriver">

This will get you past this issue. If you are using the maven plugin (under development). Just run:

 mvn org.cdisource.maven.resin:cdisource-resin-maven-plugin:run-war -Dresin.runMode=gui -Dresin.spawn=false -DskipTests=true
04-27-11 17:56


- Issue History
Date Modified Username Field Change
04-09-11 11:16 rickHigh New Issue
04-09-11 11:46 rickHigh Note Added: 0005185
04-27-11 09:45 ferg Summary Roo app not running in Resin => Roo app not running in Resin (JPA w/o jta-data-source)
04-27-11 17:56 ferg Note Added: 0005221
04-27-11 17:56 ferg Assigned To  => ferg
04-27-11 17:56 ferg Status new => closed
04-27-11 17:56 ferg Resolution open => fixed
04-27-11 17:56 ferg Fixed in Version  => 4.0.18

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker