Я пытаюсь подключиться к базе данных Oracle с помощью SpringJPA.и получить следующую ошибку:
SLF4J: Подробнее см. http://www.slf4j.org/codes.html#StaticLoggerBinder.org.springframework.beans.factory.BeanCreationException: Ошибка при создании bean-компонента с именем entityManagerFactoryBean, определенным в файле [C: \ Users \ Shivani.kumari \ ssdp \ SSDP_DB \ spring.xml]: сбой создания объекта;вложенное исключение - org.springframework.beans.BeanInstantiationException: не удалось создать экземпляр [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: конструктор вызвал исключение;Вложенное исключение - java.lang.NoClassDefFoundError: Не удалось инициализировать класс org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager в org.springframework.beans.factory.support.AbstractAutowireCapableBeanbeans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance (AbstractAutowireCapableBeanFactory.java:1197) при org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:555) при org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515) по адресу org.springframework.beans.factory.support.AbstractBeanFactory.lambda $ doGetBean $ 0 (AbstractBeanFactory.java:320) в org.springflanttoneeg: 222) в org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318) в org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199) в org.springframework.по адресу org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:867) по адресу org.springframework.context.support.AbstractApplicationContext.ref.conf.conf.FileSystemXmlApplicationContext.java:142) по адресу org.springframework.context.support.FileSystemXmlApplicationContext. (FileSystemXmlApplicationContext.java:85) по адресу com.avaya.ssdp.db.Testing.main (Testing.javaing: or.beans.BeanInstantiationException: Не удалось создать экземпляр [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: конструктор сгенерировал исключение;Вложенное исключение - java.lang.NoClassDefFoundError: Не удалось инициализировать класс org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager в org.springframework.beans.BeanUtils.instantiateClass (BeanUtils.jworkg.pring.prg) .4support.SimpleInstantiationStrategy.Класс org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean. (LocalContainerEntityManagerFactoryBean.java:News_Imp_Light.Omp_Live.Omp(NativeConstructorAccessorImpl.java:62) в sun.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45) в java.lang.reflect.Constructor.newInstance (Constructor.java:423) в org.springframework.beans.BeanUtils.instantiateClass (BeanUtils.java:172) ... еще 15
НИЖЕ МОЙ POM.XML:
http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.test.test test_db 0.0.1-SNAPSHOT
<!-- JUnit testing framework -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.hynnet</groupId>
<artifactId>oracle-driver-ojdbc14</artifactId>
<version>12.1.0.1</version>
</dependency>
<!-- Spring AOP dependency -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2</version>
</dependency>
<!-- MySQL database driver -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
</dependency>
<!-- Hibernate framework -->
<dependency>
<groupId>hibernate</groupId>
<artifactId>hibernate3</artifactId>
<version>3.2.3.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>4.0.4.Final</version>
</dependency>
<!-- Hibernate library dependecy start -->
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.1.GA</version>
</dependency>
<!-- Hibernate library dependecy end -->
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>5.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>5.1.6.RELEASE</version>
</dependency>
<!-- CGLIB is required to process @Configuration classes -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.11.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.9.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-tx -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.1.9.Final</version>
</dependency>
</dependencies>
НИЖЕ МОЯ ВЕСНА.XML:
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">
<context:component-scan base-package="com.test.test.db"></context:component-scan>
<jpa:repositories base-package="com.test.test.db.repository"
entity-manager-factory-ref="entityManagerFactoryBean"></jpa:repositories>
<!--EntityManagerFactory -->
<beans:bean id="entityManagerFactoryBean"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<beans:property name="dataSource" ref="dataSource" />
<!-- This makes /META-INF/persistence.xml is no longer necessary -->
<beans:property name="packagesToScan" value="com.test.test.db.repository" />
<beans:property name="jpaVendorAdapter">
<beans:bean
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
</beans:property>
<beans:property name="jpaProperties">
<beans:props>
<beans:prop key="hibernate.hbm2ddl.auto">update</beans:prop>
<beans:prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect
</beans:prop>
</beans:props>
</beans:property>
</beans:bean>
<beans:bean id="transactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
<beans:property name="entityManagerFactory" ref="entityManagerFactoryBean" />
</beans:bean>
<beans:bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<beans:property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<beans:property name="url"
value="jdbc:com.test.test.db:1521:qa1test " />
<beans:property name="username" value="testuser" />
<beans:property name="password" value="testpassword" />
</beans:bean>