#Error JDBC Connection

1 messages ยท Page 1 of 1 (latest)

proven islandBOT
#

โŒ› This post has been reserved for your question.

Hey @grizzled spoke! 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 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.

somber violet
#

How are you configuring/setting up the DB?

grizzled spoke
somber violet
#

Is that the IP of another device in your network?

grizzled spoke
#

Yes i'm using external server for databse

somber violet
#

Which resources folder?

somber violet
grizzled spoke
grizzled spoke
somber violet
#

What's the exact error?

grizzled spoke
somber violet
grizzled spoke
somber violet
#

yes

grizzled spoke
#

I retried again, with and without ```@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)


With  : โŒ 
Without : ![check](https://cdn.discordapp.com/emojis/759740404941455440.webp?size=128 "check")
somber violet
#

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 ...

grizzled spoke
#

Probably because the "clean" is not working

somber violet
#

Can you maybe create a minimal reproducer for your original issue?

grizzled spoke
#

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

somber violet
#

i.e. you create a copy of the project and you remove stuff from that copy as long as you can reproduce the issue

grizzled spoke
somber violet
#

and with minimal, I really mean minimal

grizzled spoke
#

It's realy minimal

somber violet
#

then yeah I might be able to try and reproduce it

grizzled spoke
#

change the username and password in ressources folders

#

do you want the SQL ?

somber violet
#

The DB password isn't important, right?

grizzled spoke
#

no no

somber violet
#

because you included it :)

grizzled spoke
#

Yeah no problem

#

Oh to run all test I write in the terminal: mvn clean verify

somber violet
#

It's not that simple but yeah

#

Can you try updating Spring Boot from 3.2.4 to 3.2.5 in the meantime?

grizzled spoke
somber violet
#

Why do you have H2 in your dependencies?

grizzled spoke
somber violet
#

I mean, try removing it

grizzled spoke
#

ok I retry, thanks you btw for the time spending, rly kind ๐Ÿ™‚

#

so I have the dupplicate key error again

grizzled spoke
#

in my case

somber violet
#

oh I meant with your original thing

grizzled spoke
#

the first test pass but the second doesn't

grizzled spoke
#

Thx for your time, it's okay I'll follow the turorial

somber violet
#

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