0

Hello i m using oracle database but i get some errors , with spring boot : the erors is :

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to open JDBC Connection for DDL execution

my application properties is :

 spring.jpa.database-platform=org.hibernate.dialect.Oracle10gDialect
 spring.datasource.url= jdbc:oracle:thin:@localhost:1521:XE
 spring.datasource.username=Sys
 spring.datasource.password=admin
 spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.jpa.hibernate.ddl-auto=create

server.port = 8080
spring.jpa.show-sql=true
spring.servlet.multipart.max-file-size=-1
user404
  • 1,934
  • 1
  • 16
  • 32
  • Can you please post the whole stacktrace? – Simon Martinelli Apr 23 '20 at 15:49
  • Does this answer your question? [Error creating bean with name 'entityManagerFactory' defined in class path resource : Invocation of init method failed](https://stackoverflow.com/questions/40058001/error-creating-bean-with-name-entitymanagerfactory-defined-in-class-path-resou) – backdoor Apr 23 '20 at 15:49

1 Answers1

0

Which Java version you are using? Can you check if you have added dependencies in your build file?

<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.0</version>
</dependency>

Reference Link : https://www.baeldung.com/java-9-jaxbexception

  • after adding the dépandance i get this error : java.sql.SQLRecoverableException: Erreur d'E/S: The Network Adapter could not establish the connection – ELMANDPURAMINE Apr 23 '20 at 19:22
  • Is oracle installed and running on your machine?Also, is the Oracle TNS listener configured and running? your JDBC URL points to localhost so I assume you have all this running on your local machine. This error is suggesting that it has issue in connecting to oracle. – Rajneesh Prakash Apr 24 '20 at 05:42