Where am I supposed to define the Spike7 datasource. I keep getting this error:
javax.naming.NameNotFoundException: Spike7 not bound
where I have defined in my @Stateful bean an Entity Manager like so:
@javax.persistence.PersistenceContext (unitName="Spike7")
private EntityManager em;
and my persistence.xml file located in the WEB-INF/classes/META-INF directory has this entry:
<persistence>
<persistence-unit name="Spike7">
<jta-data-source>java:Spike7Datasource</jta-data-source>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate-dialect" value="org.hibernate.dialect.SQLServerDialect" />
<property name="hibernate.hbm2ddl.auto" value="${hibernate.hbm2ddl.auto}"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
</properties>
</persistence-unit>
</persistence>
and I have a Spike7DataSource-ds.xml deployed on my JBoss server... The jmx-console has these MBeans deployed indicating the DataSource has been successfully deployed:
name=Spike7Datasource,service=DataSourceBinding
name=Spike7Datasource,service=ManagedConnectionFactory
name=Spike7Datasource,service=ManagedConnectionPool
name=Spike7Datasource,service=XATxCM
Any ideas what I am doing wrong? Can I use the Stateful bean in a WAR application.
Sorry if these are uneducated questions, but I am new to the seam world.