R
Railway14mo ago
krish

Error: Unable to access jarfile target/*jar

https://job-seeking-production.up.railway.app I'm using spring boot application with mysql ..all process done but it application failed to respond that i hava use dockerfile
35 Replies
Brody
Brody14mo ago
you say spring boot, but then why do you also have uvicorn in there?
krish
krishOP14mo ago
ok what i do
Brody
Brody14mo ago
explain why you have it like that, what is uvicorn doing in a dockerfile for a spring boot app? uvicorn is typically used to run fastapi python apps
krish
krishOP14mo ago
ok ,that is 1st time i try to deploy the application so i try all method
Brody
Brody14mo ago
do you use python at all in this project?
krish
krishOP14mo ago
no
Brody
Brody14mo ago
then I don't see the purpose of including uvicorn
krish
krishOP14mo ago
ok now i remove it
Brody
Brody14mo ago
okay
krish
krishOP14mo ago
ok,what keyword to use for host and post in docker hello brody help me man CMD webservice:app --host 0.0.0.0 --port $PORT
Brody
Brody14mo ago
you said you didn't use python at all in this project, why are you using uvicorn?? do you use python in this project, yes or no
krish
krishOP14mo ago
no
Brody
Brody14mo ago
okay your CMD keyword should start the java server
krish
krishOP14mo ago
okay what keyword should i used FROM maven:3-openjdk-17 AS build COPY . . RUN mvn clean package -DskipTests FROM openjdk:17.0.1-jdk-slim COPY --from=build /target/jobseeking-0.0.1-SNAPSHOT.war jobseeking.war EXPOSE 8080 ENTRYPOINT ["java", "-jar", "jobseeking.war"]
Brody
Brody14mo ago
why even use a dockerfile? maybe nixpacks can build your app just fine
krish
krishOP14mo ago
ok, how to use nixpacks ?
Brody
Brody14mo ago
remove the dockerfile
krish
krishOP14mo ago
now show like that brody
No description
krish
krishOP14mo ago
bro are you there?
Brody
Brody14mo ago
are you building a jar file? if so, you likely have your paths wrong when you build or run the jar file
krish
krishOP14mo ago
how to correct the paths
Brody
Brody14mo ago
i strongly recommend you familurelize yourself with the technologies you are trying to use
krish
krishOP14mo ago
Can you tell me the way to learn this technique?
Brody
Brody14mo ago
same way you learn anything now-a-days, youtube videos
krish
krishOP14mo ago
Any youtube videos you recommend?
Brody
Brody14mo ago
i dont know java and i dont personally watch programming youtube videos anyway
krish
krishOP14mo ago
Where do you learn from?
Brody
Brody14mo ago
stack overflow
krish
krishOP14mo ago
it successfully run but it show application failed to response
No description
krish
krishOP14mo ago
brody thank it's done
Brody
Brody14mo ago
awesome
Brody
Brody14mo ago
thank you
William Fontelas
49a1e42c-c61d-4f9c-973d-8528e0cf1a81
Want results from more Discord servers?
Add your server