0

I started learning Spring Roo recently and generated a webapp which ran fine with Jetty. I would like to move this prototype app to Glassfish now with view of deploying it to production when done.

Now I am facing uphill battle to get persistence layer working with Glassfish 3.1. Following are relevant snippet from my config files updated for Glassfish. Any help/pointers to resolve this error will be much appreciated. I did follow similar thread here to no avail. There appear to be Jira for this issue here but I am lost at how to implement workaround mentioned in comments.

Thanks in advance.

persistence.xml

<persistence-unit name="persistenceUnit" transaction-type="JTA">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>jdbc/CTUDB</jta-data-source>
        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
            <!-- 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="hibernate.hbm2ddl.auto" value="update"/>
            <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" /-->
        </properties>
</persistence-unit>

web.xml

<persistence-unit-ref>
    <persistence-unit-ref-name>persistence/persistenceUnit</persistence-unit-ref-name>
    <persistence-unit-name>persistenceUnit</persistence-unit-name>
</persistence-unit-ref>

applicationContext.xml

<jee:jndi-lookup id="entityManagerFactory" jndi-name="persistence/persistenceUnit"/>
<tx:jta-transaction-manager/>
<tx:annotation-driven/>
TMan
  • 422
  • 1
  • 3
  • 13

1 Answers1

0

have you tried this: http://forum.springsource.org/showthread.php?113533-Deploying-a-Roo-JPA-2-App-to-GlassFish-3 ??

Cheers!

Yiannis Gkoufas
  • 660
  • 6
  • 16