Supabase-storage installation problem
Hello,
I have a Kotlin Spring Boot project.
I'm trying to install supabase storage but I'm having problems
Here is my Supabase configuration file:
I use the Supabase client in my service :
The error occurs when I try to call my endpoint :
I think it must come from the Ktor configuration
I just put the dependencies in my pom.xml
Any idea ?
Thanks
I have a Kotlin Spring Boot project.
I'm trying to install supabase storage but I'm having problems
Here is my Supabase configuration file:
@Configuration
class SupabaseConfiguration {
@Bean
fun supabaseClient(): SupabaseClient {
return createSupabaseClient(
supabaseUrl = "http://XX.XX.XX.XX:8000/",
supabaseKey = "XXXXX"
) {
install(Auth)
install(Postgrest)
install(Storage) {
transferTimeout = 90.seconds // Default: 120 seconds
}
defaultSerializer = KotlinXSerializer(Json)
}
}
}I use the Supabase client in my service :
@Service
class BucketService(
) {
@Autowired
private lateinit var supabaseClient: SupabaseClient
suspend fun getBucketById(): String {
val bucket = supabaseClient.storage.retrieveBucketById("data") ?: throw IllegalArgumentException("No data found")
return bucket.name
}
}The error occurs when I try to call my endpoint :
Error: (Supabase-Core) GET request to endpoint /storage/v1/bucket/data failed with exception Parameter specified as non-null is null: method io.ktor.client.engine.apache5.BasicResponseConsumer.consumeResponse, parameter httpContext
java.lang.NullPointerException: Parameter specified as non-null is null: method io.ktor.client.engine.apache5.BasicResponseConsumer.consumeResponse, parameter httpContext
I think it must come from the Ktor configuration
I just put the dependencies in my pom.xml
Any idea ?
Thanks