#Error JDBC Connection
1 messages ยท Page 1 of 1 (latest)
โ This post has been reserved for your question.
Hey @grizzled spoke! Please use
/closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed 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.
How are you configuring/setting up the DB?
the ressources folder is in the test folder
Is that the IP of another device in your network?
Yes i'm using external server for databse
Which resources folder?
And this is a test database?
yes
What's the exact error?
org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection
Can you show the complete stack trace?
this ?
yes
I retried again, with and without ```@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)
With : โ
Without : 
Can you try AFTER_EACH_TEST_METHOD?
maybe it's related to https://commerce-engineer.rakuten.careers/entry/en/tech/0054
Hi, this is Trueman, an Application Engineer working at Rakuten Group's Branch. I want to share a story about an issue that took 2 whole days of investigating and troubleshooting to resolve. Hopefully this can save you the time and frustration if you happen to run into the same problem. This technical problem and solution is sort of specific to ...
New error about duplicate key
Probably because the "clean" is not working
Can you maybe create a minimal reproducer for your original issue?
what do you mean ?
I can make a git repo for you, also the werid thing it that I followed a tutorial and in the video, no such problem
2:41:55 when he writes this
essentially the smallest possible project so you still get the issue
i.e. you create a copy of the project and you remove stuff from that copy as long as you can reproduce the issue
ok want me to put it on github ?
When you have a minimal reproducer, sure
and with minimal, I really mean minimal
It's realy minimal
then yeah I might be able to try and reproduce it
The DB password isn't important, right?
no no
because you included it :)
It's not that simple but yeah
Can you try updating Spring Boot from 3.2.4 to 3.2.5 in the meantime?
Ok, I just change in the pom xml the version ?
Why do you have H2 in your dependencies?
yes
Well, I dont realy know, I followed the tuto but He used postgresql and I work with mysql so I just followed what he did but it's probable not necessary
I mean, try removing it
ok I retry, thanks you btw for the time spending, rly kind ๐
so I have the dupplicate key error again
It's looks like the AFTER doesn't works well
in my case
oh I meant with your original thing
the first test pass but the second doesn't
Same thing
Thx for your time, it's okay I'll follow the turorial
If you use AFTER_EACH_TEST_METHOD, you get an exception for duplicate keys, right?
I was able to reproduce your issue with fewer code
using the AFTER thing seems to work
and the duplicate key thing seems to be an issue with your code I think
actually let me check that
ok so I can explain the issue you got with the duplicate key
you are using an actual database
so everything you insert into the DB will actually be inserted
oh nvm they left