Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.3
JPA 1.0
OC4J 10.1.3.3.0
Spring 2.0
Struts 2.0
Mapping documents:
server.xml
appliation-context.xml
persistence.xml
orion-application.xml
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Operation failed with error: [mkclsets:mkclsets] - Exception creating EntityManagerFactory using PersistenceProvider class oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider for persistence unit mkclsetsPersistenceUnit.
Name and version of the database you are using:Oracle 10g
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Dear All,
From last 2 days I am facing a problem in deployment of our application in oc4j client of oracle app server.
I am getting the following exception
Code:
Operation failed with error: [mkclsets:mkclsets] - Exception creating EntityManagerFactory using PersistenceProvider class oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider for persistence unit mkclsetsPersistenceUnit.
When I am deploying the same application in tomcat app server its working fine. But I am unable to deploy the same in oc4j.
I am using the following technologies
Spring 2.0
Struts 2.0
Hibernate 3.3
JPA 1.0
OC4J 10.1.3.3.0
My persistence.xml
Code:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="mkclsetsPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<!-- jta-data-source>mkclDS</jta-data-source-->
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<!-- properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.OC4JTransactionManager"/>
</properties-->
</persistence-unit>
</persistence>
Datasource-context.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" lazy-init="true"/>
<!-- following code is for using oracle -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" lazy-init="true">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>jdbc:oracle:thin:@//xxxx.xxxx.xxxx.xxxx:1521/mydb</value>
</property>
<property name="username">
<value>tpsadmin</value>
</property>
<property name="password">
<value>tpsadmin</value>
</property>
</bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" lazy-init="true">
<property name="persistenceUnitName" value="mkclsetsPersistenceUnit"/>
<property name="dataSource" ref="dataSource"/>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" lazy-init="true">
<property name="database" value="ORACLE"/>
<property name="showSql" value="true"/>
</bean>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" lazy-init="true">
<property name="entityManagerFactory" ref="entityManagerFactory"></property>
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>
Server.xml (oc4j/j2ee/home/config)
Code:
<?xml version="1.0"?>
<application-server xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/application-server-10_1.xsd" application-directory="../applications"
check-for-updates="adminClientOnly"
deployment-directory="../application-deployments"
connector-directory="../connectors"
schema-major-version="10" schema-minor-version="0" >
<shared-library name="global.libraries" version="1.0" library-compatible="true">
<code-source path="../applib"/>
</shared-library>
<shared-library name="global.tag.libraries" version="1.0" library-compatible="true">
<code-source path="../../home/jsp/lib/taglib/"/>
<code-source path="../../../j2ee/home/jsp/lib/taglib/"/>
<code-source path="../../../lib/dsv2.jar"/>
<import-shared-library name="oracle.xml"/>
<import-shared-library name="oracle.jdbc"/>
<import-shared-library name="oracle.cache"/>
<import-shared-library name="soap"/>
</shared-library>
<shared-library name="oracle.persistence" version="1.0" library-compatible="true">
<code-source path="../../../toplink/jlib/toplink-essentials.jar"/>
<import-shared-library name="oracle.jdbc"/>
</shared-library>
<shared-library name="hibernatejpa" version="1.0">
<code-source path="ejb3-persistence.jar"/>
<code-source path="hibernate3.jar"/>
<code-source path="hibernate-annotations.jar"/>
<code-source path="hibernate-commons-annotations.jar"/>
<code-source path="hibernate-entitymanager.jar"/>
<code-source path="jboss-archive-browsing.jar"/>
<code-source path="jta.jar"/>
</shared-library>
<shared-library name="db" version="1.0">
<code-source path="ojdbc14.jar"/>
</shared-library>
<shared-library name="displaytab" version="1.0">
<code-source path="commons-beanutils-1.7.0.jar"/>
<code-source path="commons-lang-2.3.jar"/>
<code-source path="displaytag-1.1.1.jar"/>
</shared-library>
<shared-library name="ehCache" version="1.0">
<code-source path="backport-util-concurrent.jar"/>
<code-source path="ehcache-1.4.0-beta2.jar"/>
<code-source path="jsr107cache-1.0.jar"/>
</shared-library>
<shared-library name="json" version="1.0">
<code-source path="ezmorph-1.0.4.jar"/>
<code-source path="json.jar"/>
</shared-library>
<shared-library name="other_sets" version="1.0">
<code-source path="commons-fileupload-1.1.jar"/>
<code-source path="dom4j-1.6.1.jar"/>
<code-source path="dwr.jar"/>
<code-source path="javassist.jar"/>
<code-source path="log4j-1.2.13.jar"/>
</shared-library>
<shared-library name="spring2" version="1.0">
<code-source path="aspectjrt.jar"/>
<code-source path="aspectjweaver.jar"/>
<code-source path="cglib-nodep-2.1_3.jar"/>
<code-source path="spring.jar"/>
</shared-library>
<shared-library name="struts2" version="1.0">
<code-source path="antlr-2.7.2.jar"/>
<code-source path="commons-collections.jar"/>
<code-source path="commons-io-1.1.jar"/>
<code-source path="commons-logging-1.0.4.jar"/>
<code-source path="freemarker-2.3.8.jar"/>
<code-source path="ognl-2.6.11.jar"/>
<code-source path="struts2-core-2.0.9.jar"/>
<code-source path="struts2-spring-plugin-2.0.9.jar"/>
<code-source path="xwork-2.0.4.jar"/>
</shared-library>
<rmi-config path="./rmi.xml" />
<jms-config path="./jms.xml" />
<javacache-config path="../../../javacache/admin/javacache.xml" />
<j2ee-logging-config path="./j2ee-logging.xml" />
<log>
<file path="../log/server.log" />
</log>
<java-compiler name="javac" in-process="false" options="-J-Xmx1024m -encoding UTF8" extdirs="C:\Program Files\Java\jdk1.5.0_07\jre\lib\ext" />
<global-application name="default" path="application.xml" parent="system" start="true" />
<application name="javasso" path="../../home/applications/javasso.ear" parent="default" start="false" />
<application name="ascontrol" path="../../home/applications/ascontrol.ear" parent="system" start="true" />
<application name="Test" path="../applications\Test.ear" parent="default" start="true" />
<application name="OraTest" path="../applications\OraTest.ear" parent="default" start="true" />
<global-web-app-config path="global-web-application.xml" />
<transaction-manager-config path="transaction-manager.xml" />
<web-site default="true" path="./default-web-site.xml" />
<cluster id="6745699755968" />
</application-server>
Orion-application.xml (oc4j/j2ee/home/config)
Code:
<?xml version="1.0"?>
<orion-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-application-10_0.xsd" deployment-version="10.1.3.1.0" default-data-source="jdbc/OracleDS" component-classification="external"
schema-major-version="10" schema-minor-version="0" >
<imported-shared-libraries>
<import-shared-library name="hibernatejpa"/>
<import-shared-library name="db"/>
<import-shared-library name="displaytab"/>
<import-shared-library name="ehCache"/>
<import-shared-library name="json"/>
<import-shared-library name="other_sets"/>
<import-shared-library name="spring2"/>
<import-shared-library name="struts2"/>
</imported-shared-libraries>
</orion-application>
Please help to deploy my application, I created one application with struts2 and spring2 and that is working fine, but when I try to add JPA with hibernate 3.3 I am unable to deploy it.
Thanks a lot in advance.