hey everyone, does anyone have experience running ...
# ktor
b
hey everyone, does anyone have experience running flyway + mysql inside of a shadow jar? i’ve really been struggling to get the two to work with ktor, we are also using micronaut and in there it seems to work fine but as far as I know they’re not using shadowJar to run the application
I get some wierd errors with the migration not being named correctly, or H2 drivers not being found
it runs perfectly locally (i.e through the IDE) but as soon as it’s turned into a jar everything goes crazy… I’ve tried a lot of things but none of them have seemed to work any help would be appreciated 🙏
a
An error about H2 might suggest your connection string is set to h2 rather than mysql. Is there any difference in how your config is injected between your IDE and jar invocations?
b
well both work locally! (H2 and MySQL jdbc)
I’m using an .env file to inject the env vars
Copy code
DATABASE_URL=jdbc:h2:mem:test;MODE=MySQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE;DB_CLOSE_DELAY=-1;
DATABASE_USER=sa
DATABASE_PASSWORD=

DATABASE_URL=jdbc:<mysql://localhost/solar?serverTimezone=UTC>
DATABASE_USER=root
DATABASE_PASSWORD=password
and then using the same env file inside of docker (that’s running the shadowJar) so as far as I know it’s all the same minus the fact that one is running in the IDE and the other is running inside of docker using the shadowJar
a
Are those two sets of vars in the same file?
b
oh sorry I have both of them in the above just to show the different configurations but they’re commented out based on which one I want to test
a
Not sure then 🤷 . Hope you get some help.
b
Me either sad panda
thanks tho!
a
You might get better help elsewhere though. This issue doesn't really have anything to do with ktor.
Maybe #server