views:

618

answers:

0

We have two applications a legacy struts app and and a new Seam application. We are using Hibernate and JPA on the Seam side and want to try to do so on the Struts side. I am trying to do:

    EntityManagerFactory emf = Persistence.createEntityManagerFactory("foo");

on the struts side, but I am seeing the following error:


org.hibernate.ejb.HibernatePersistence java:/msatDatasource

12:17:59,227 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured 12:17:59,227 DEBUG [SessionFactoryImpl] instantiated session factory 12:17:59,242 INFO [STDOUT] javax.persistence.PersistenceException: [PersistenceUnit: foo] Unable to build EntityManagerFactory

In persistance.xml I have defined:

<persistence-unit name="foo">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>java:/fooDatasource</jta-data-source>
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
         <property name="hibernate.show_sql" value="true"/>
         <property name="hibernate.format_sql" value="true"/>
         <property name="jboss.entity.manager.factory.jndi.name" value="java:fooEntityManagerFactory"/>
      </properties>
   </persistence-unit>

This same code works fine on the Seam side. What am I missing? Do I need to do specialized configuration for Struts to get it to recognize the JNDI datasource?

Thanks in advance!