freelec-springboot2-webservice icon indicating copy to clipboard operation
freelec-springboot2-webservice copied to clipboard

[오류] p.305,306 nohup.out 에러

Open leenclair opened this issue 2 years ago • 1 comments

기존에 올라온 질문이 아닌지 먼저 검색해주세요!

가장 자주 나온 제보

어떤 오류인가요?

오류설명:Error 메시지가 나오며 책과 같이 진행되지 않습니다. 동일한 에러를 보지 못해서 질문드려요. 혹시 이미 있던 질문이라면 죄송합니다.

Error: Invalid or corrupt jarfile /home/ec2-user/app/step1/

이렇게 메시지가 나옵니다.

+++++++++++++++++++++++++++++++++++++ deploy.sh 내용입니다.

#!/bin/bash

REPOSITORY=/home/ec2-user/app/step1 PROJECT_NAME=springbootWebservice

cd $REPOSITORY/$PROJECT_NAME/

echo "> Git Pull"

git pull

echo "> 프로젝트 Build 시작"

./gradlew build

echo ">step1 디렉토리로 이동"

cd $REPOSITORY

echo "> Build 파일복사"

cp $REPOSITORY/$PROJECT_NAME/build/libs/*.jar $REPOSITORY/

echo "> 현재 구동중인 애플리케이션 pid 확인"

CURRENT_PID=$(pgrep -f ${PROJECT_NAME}.*.jar)

echo "현재 구동중인 애플리케이션 pid 확인"

if [ -z "$CURRENT_PID" ]; then echo "> 현재 구동 중인 애플리케이션이 없으므로 종료하지 않습니다." else echo "> kill -15 $CURRENT_PID" kill -15 $CURRENT_PID sleep 5 fi

echo "> 새 애플리케이션 배포"

JAR_NAME=$(ls -tr $REPOSITORY/ | grep jar | tail -n 1)

echo "> JAR Name: $JAR_NAME"

nohup java -jar -Dspring.config.location=classpath:/application.properties,/home/ec2-user/app/application-oauth.properties /home/ec2-user/app/step1/$JAR_NAME 2>&1 &

프로젝트 주소

Github에 오류가 난 프로젝트를 올려주세요.
Github 주소를 작성해주지 않으시면 답변해드릴수가 없어요!

  • Github URL: https://github.com/Leenclair/springboot-webservice.git

오류 로그

어떤 오류인지 캡쳐해주세요. image image

leenclair avatar Nov 10 '22 14:11 leenclair

/home/ec2-user/app/step1/build/libs 안에 jar 파일이 뭐뭐 있는지 확인하셔야 될 것 같아요

KORDayDream avatar Nov 16 '22 15:11 KORDayDream