Hi Team,
I am trying to use hibernate 4 and jpa 2.1 for connecting oracle database through weblogic JNDI in a standalone application and i face the below issue.
------------------------------------------------------------------------------- Jul 23, 2014 3:56:16 PM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation INFO: HHH000204: Processing PersistenceUnitInfo [ name: JPASamplesPU ...] Jul 23, 2014 3:56:16 PM org.hibernate.Version logVersion INFO: HHH000412: Hibernate Core {4.3.6.Final} Jul 23, 2014 3:56:16 PM org.hibernate.cfg.Environment <clinit> INFO: HHH000206: hibernate.properties not found Jul 23, 2014 3:56:16 PM org.hibernate.cfg.Environment buildBytecodeProvider INFO: HHH000021: Bytecode provider name : javassist Jul 23, 2014 3:56:16 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit> INFO: HCANN000001: Hibernate Commons Annotations {4.0.4.Final} Jul 23, 2014 3:56:23 PM org.hibernate.dialect.Dialect <init> INFO: HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect Exception in thread "main" java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index; at org.hibernate.cfg.annotations.EntityBinder.processComplementaryTableDefinitions(EntityBinder.java:936) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:824) at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3788) at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3742) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1410) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1844) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:75) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60) at test.JPATest.main(JPATest.java:39)
---------------------------------------------------------------------------------
Jars used: dom4j-1.6.1.jar hibernate-commons-annotations-4.0.4.jar hibernate-core-4.3.6.jar hibernate-entitymanager-4.3.6.jar hibernate-jpa-2.1-api.jar jandex1.1.0.jar javaassist-3.18.1.jar jboss-logging-3.1.3.jar ojdbc6.jar weblogic.jar
java: 1.6
Persistence.xml --------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <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="JPASamplesPU" transaction-type="JTA"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <properties> <property name="hibernate.show_sql" value="true" /> <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" /> <property name="hibernate.connection.datasource" value="MPAYUBIAPI" /> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup" />
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.WeblogicJtaPlatform" /> <property name="hibernate.transaction.factory.class" value="org.hibernate.transaction.JTATransactionFactory" /> <property name="hibernate.hibernate.session_factory_name" value="session_factory" />
<property name="hibernate.jndi.class" value="weblogic.jndi.WLInitialContextFactory" />
<property name="hibernate.jndi.url" value="t3://10.44.66.121:7010" />
<property name="hibernate.current_session_context_class" value="jta" />
<property name="hibernate.jta.UserTransaction" value="weblogic.transaction.UserTransaction" />
<property name="hibernate.generate_statistics" value="false" />
<property name="hibernate.connection.release_mode" value="auto" />
</properties> </persistence-unit> </persistence>
--------------------------------------------- Pojo:
package com.test.entity;
import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table;
@Entity @Table(name = "ACC_TYPE") public class AccType {
private String accType; private String accTypeDesc; /** * @return the accType */ @Id @Column(name = "ACC_TYPE") public String getAccType() { return accType; } /** * @param accType the accType to set */ public void setAccType(String accType) { this.accType = accType; } /** * @return the accTypeDesc */ @Column(name = "ACC_TYPE_DESC") public String getAccTypeDesc() { return accTypeDesc; } /** * @param accTypeDesc the accTypeDesc to set */ public void setAccTypeDesc(String accTypeDesc) { this.accTypeDesc = accTypeDesc; } }
Request your help in resolving the issue.
|