0

I am trying to add progress as a secondary DataSource to my application

Here are the properties of the dataSource:

spring.datasource2.jdbcUrl=jdbc:datadirect:openedge://host:port;databaseName=db;
spring.second-datasource.username=username
spring.second-datasource.password=password
spring.second-datasource.driver-class-name=com.ddtek.jdbc.openedge.OpenEdgeDriver
spring.second-datasource.jpa.hibernate.ddl-auto=create
spring.second-datasource.database-platform=org.hibernate.dialect.SQLServerDialect
spring.jpa.hibernate.naming.physical-strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy
spring.jpa.hibernate.naming.implicit-strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy

this is the datasource config I am using

@Configuration
@EnableTransactionManagement
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
@EnableJpaRepositories(
        basePackages = "com.demo.myapp.progress.progressRepositories.*",
        entityManagerFactoryRef = "progressEntityManager",
        transactionManagerRef = "progressTransactionManager")
public class ProgressDbConfig {

    @Bean
    @ConfigurationProperties(prefix = "spring.second-database")
    public DataSource progressDataSource() {
        return DataSourceBuilder.create().build();
    }
}

This is the error I was getting

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine suitable jdbc url


Action:

Consider the following:
    If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
    If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

Please help me solve this issue

Tom Bascom
  • 13,405
  • 2
  • 27
  • 33
veer
  • 11
  • 2
  • Does this answer your question? [Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured](https://stackoverflow.com/questions/51221777/failed-to-configure-a-datasource-url-attribute-is-not-specified-and-no-embedd) – Mohsin M Feb 11 '22 at 13:45
  • put `spring.second-datasource.jdbcUrl=` in your `application.properties` and try again – ankur pramanik Feb 12 '22 at 12:48
  • jdbcUrl was already present missed it while adding in the question, tried solutions in the link mentioned above Tried adding h2 dependency was getting this error Parameter 0 of method entityManagerFactory in com.ovh.revman.ipms.config.DbConfig required a bean of type 'org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder' that could not be found. – veer Feb 14 '22 at 09:23

0 Answers0