Skip to content

[Bug]: Unable to create a ConnectionFactory for 'ConnectionFactoryOptions{options={driver=tc #5855

Description

@sneakythr0ws

Module

PostgreSQL

Testcontainers version

1.17.3

Using the latest Testcontainers version?

Yes

Host OS

Linux

Host Arch

x86

Docker version

20.10.17

What happened?

Unable to create a ConnectionFactory for 'ConnectionFactoryOptions{options={driver=tc, TC_IMAGE_TAG=9.6.8, protocol=postgresql, database=databasename}}'. Available drivers: [ postgresql, pool ]

dependencies:
spring boot 2.7.3

implementation 'org.springframework.boot:spring-boot-starter-data-r2dbc'
runtimeOnly 'org.postgresql:r2dbc-postgresql:0.9.2.RELEASE'
testImplementation "org.testcontainers:postgresql:1.17.3"
testImplementation "org.testcontainers:junit-jupiter:1.17.3"

config:

spring:
  r2dbc:
    url: r2dbc:tc:postgresql:///databasename?TC_IMAGE_TAG=9.6.8

Relevant log output

No response

Additional Information

No response

Activity

  1. hariohmprasath commented on Sep 21, 2022

    @hariohmprasath
    Contributor

    Hi @sneakythr0ws,
    Looks like you might be missing this dependency in your gradle file which could be causing this issue:
    testImplementation "org.testcontainers:r2dbc:1.17.3"

    Can you add this and give it a try?

    If you want to use testcontainers in your main spring boot application rather than test class then you may need to change the scope of this dependency to runtime

  2. locked and limited conversation to collaborators on Sep 24, 2022
  3. converted this issue into a discussion #5863 on Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions