Gradle, Ebean: Service loader didn't find a SpiContainerFactory?

Hey, I'm having a problem with Ebean at the moment and hope someone here is able to help. It's the first time I'm using Gradle and the first time I'm using Ebean in private, so sorry if there's any obvious mistakes. This is the config I had using the "Getting Started" documentation:
plugins {
id("io.ebean") version "15.8.0"
}

dependencies {
implementation("com.mysql:mysql-connector-j:9.1.0")
implementation("io.ebean:ebean:15.8.0")
implementation("io.ebean:ebean-querybean:15.8.0")
annotationProcessor("io.ebean:querybean-generator:15.8.0")
}
plugins {
id("io.ebean") version "15.8.0"
}

dependencies {
implementation("com.mysql:mysql-connector-j:9.1.0")
implementation("io.ebean:ebean:15.8.0")
implementation("io.ebean:ebean-querybean:15.8.0")
annotationProcessor("io.ebean:querybean-generator:15.8.0")
}
Then I got an error message stating I should use driver specific packages (since Ebean 13+), which wasn't documented for gradle, so I checked out the Maven page and came up with this:
plugins {
id("io.ebean") version "15.8.0"
}

dependencies {
implementation("com.mysql:mysql-connector-j:9.1.0")
implementation("io.ebean:ebean-api:15.8.0") // fuer io.ebean.service.SpiContainer(Factory)
implementation("io.ebean:ebean-platform-mysql:15.8.0")
implementation("io.ebean:ebean-querybean:15.8.0")
annotationProcessor("io.ebean:querybean-generator:15.8.0")
}
plugins {
id("io.ebean") version "15.8.0"
}

dependencies {
implementation("com.mysql:mysql-connector-j:9.1.0")
implementation("io.ebean:ebean-api:15.8.0") // fuer io.ebean.service.SpiContainer(Factory)
implementation("io.ebean:ebean-platform-mysql:15.8.0")
implementation("io.ebean:ebean-querybean:15.8.0")
annotationProcessor("io.ebean:querybean-generator:15.8.0")
}
Now I'm getting an error about SpiContainerFactory not being found, even though the class is part of my jar. DatabaseProvider: https://paste.helpch.at/igogeyiraf.java Error: https://paste.helpch.at/dihajofopi.rb (also without shading)
10 Replies
JavaBot
JavaBot•3w ago
⌛ This post has been reserved for your question.
Hey @Aze! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
stechy1
stechy1•3w ago
Hello, do you know how the SPI works? Providing a class in your jar is just one part. As a second part, you have to configure META-INF/services to inform java about your class...
Aze
AzeOP•3w ago
No, I never had to deal with that before Are you able to recommend some resource I can use to read up on that topic?
stechy1
stechy1•3w ago
I hope I will not get banned by posting this link 🙂 https://www.baeldung.com/java-spi
Baeldung
Java Service Provider Interface | Baeldung
Have a look at the components of the Java Service Provider Interface with a practical use case.
Aze
AzeOP•3w ago
Thanks! I’ll give this a go later 😄
JavaBot
JavaBot•3w ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts. 💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Aze
AzeOP•3w ago
Again thanks for the link, but I feel like this is not the proper approach for the issue I'm facing, perhaps I'm just misunderstanding this. So what I took from the website is that I'd have to create some META-INF files, but they would all point to library internal files, since I'm not actually the one provisioning the SpiContainer stuff? The ebean docs also don't mention any of this stuff afaik
JavaBot
JavaBot•3w ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Aze
AzeOP•3w ago
I was missing ebean-core and ebean-datasource :facepalm:
JavaBot
JavaBot•3w ago
Post Closed
This post has been closed by <@398509167351955456>.
Want results from more Discord servers?
Add your server