#Spring not connecting to a database / unable to obtain isolated JDBC connection [FATAL: Tenant or us
1 messages · Page 1 of 1 (latest)
I am having huge problems with spring and supabase
Completely lost and do not know what to do
Please ask full questions here, don't just link other sites.
I am working on a backend application and wanted to connect it to a Supabase database. I added all of the required information in application.properties, went to run the App and got an unable to obtain isolated JDBC connection [FATAL: Tenant or user not found] (full error at the end). I searched a bit online and found that it means that you entered wrong user or password in application.properties so I made sure I entered correct info. I am 100% sure I have actually entered the correct info since I was able to connect to that same database using that same information (url, password, username) using InteliJ built in database tool and pgAdmin. I even thought I was maybe banned from Supabase so I tried connecting to Neon database. Again, when running the Spring App I got an unable to obtain isolated JDBC connection [FATAL: Tenant or user not found], but I was able to connect to the Neon database using pgAdmin and InteliJ built in tool. At this point I asked my friend who knows Spring a lot better than I do for help. He was not able to find what is causing this issue but we came to a bit of a head scratching result. He made a simple Spring app consisting of:
DemoApplication
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
application.yml (I also tried with application.properties)
spring:
datasource:
url: jdbc:postgresql://aws-0-eu-central 1.pooler.supabase.com:port/postgres?prepareThreshold=0
username: postgres.id
password: pass
driver-class-name: org.postgresql.Driver
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
When he runs DemoApplication inside InteliJ (with port, id and pass being actual values of database information) it runs completely fine, connects to the database with no errors or warnings or anything. He sent me this project, I downloaded it, opened it in InteliJ and DID NOT CHANGE ANYTHING. Just clicked on the green arrow next to DemoApplication and I got an unable to obtain isolated JDBC connection [FATAL: Tenant or user not found]. Once again I checked if somehow the information for database changed in between file transfer but it is exact same as on his computer. I have since reinstalled InteliJ making sure that I delete any cache folders, installed the community version of it and every time I run this simple program it crashes with the exact same error every time. I completely lost my mind and do not know what to do.
FULL ERROR TEXT
anyone have any clue whats going on?