Hi,
I am trying to integrate hibernate with spring. I do not have all the JPA entites generated yet but I am setting up my datasource, persistenceunit and referencing that in applicationcontext.xml
However, when I start JBoss 5.1 I am seeing that ''entityManagerFactory'' fails to get initialized and I see the below exception in the JBoss console.
I do see the persistence unit being initalized and bound prior to the below exception.
Can you tell me where I could be going wrong? Can you please help?
Thanks
David
Here's my ds.xml entryCode:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory': Invocation of init method failed; nested exceptio n is javax.naming.NameNotFoundException: ties-2 not bound
My persistence.xmlCode:<datasources> <local-tx-datasource> <jndi-name>ties-2Datasource</jndi-name> <use-java-context>true</use-java-context> <connection-url>jdbc:oracle:thin:@mydb.mydomain.com:15333:icore</connection-url> <driver-class>oracle.jdbc.OracleDriver</driver-class> <user-name>ties</user-name> <password>tiesdev</password> </local-tx-datasource> </datasources>
my applicationContext.xml entryCode:<persistence-unit name="ties-2"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java:/ties-2Datasource</jta-data-source> <!-- The <jar-file> element is necessary if you put the persistence.xml in the WAR and the classes in the JAR --> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/> <!-- <property name="hibernate.hbm2ddl.auto" value="validate"/>--> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.format_sql" value="true"/> <property name="jboss.entity.manager.factory.jndi.name" value="java:/ties-2EntityManagerFactory"/> </properties> </persistence-unit> </persistence>
Code:<jee:jndi-lookup id="entityManagerFactory" jndi-name="ties-2"/>


Reply With Quote
