Systemd Service Unit Unable to Access Jarfile in Ubuntu When Running SSM Document

I am working on a project where I need to install the Spring Boot application Pet Clinic onto an Ubuntu 22 server using SSM Documents. I have attached the Systems Manager Run Document. The error below comes from the command sudo journalctl -u spring-petclinic.service. I tried giving any and all access, running as root, and it still isn’t working.

Any idea on how to get this application to stay running?

May 17 21:52:36 ip-10-0-4-141 systemd[1]: spring-petclinic.service: Failed with result 'exit-code'.
May 17 21:52:36 ip-10-0-4-141 systemd[1]: spring-petclinic.service: Scheduled restart job, restart counter is at 3.
May 17 21:52:36 ip-10-0-4-141 systemd[1]: Stopped Spring PetClinic Application.
May 17 21:52:36 ip-10-0-4-141 systemd[1]: Started Spring PetClinic Application.
May 17 21:52:36 ip-10-0-4-141 java[7076]: Error: Unable to access jarfile /clinic/spring-petclinic/target/*.jar
May 17 21:52:36 ip-10-0-4-141 systemd[1]: spring-petclinic.service: Main process exited, code=exited, status=1/FAILURE
May 17 21:52:36 ip-10-0-4-141 systemd[1]: spring-petclinic.service: Failed with result 'exit-code'.
May 17 21:52:36 ip-10-0-4-141 systemd[1]: spring-petclinic.service: Scheduled restart job, restart counter is at 4.
May 17 21:52:36 ip-10-0-4-141 systemd[1]: Stopped Spring PetClinic Application.
May 17 21:52:36 ip-10-0-4-141 systemd[1]: Started Spring PetClinic Application.
May 17 21:52:36 ip-10-0-4-141 java[7077]: Error: Unable to access jarfile /clinic/spring-petclinic/target/*.jar
May 17 21:52:36 ip-10-0-4-141 systemd[1]: spring-petclinic.service: Main process exited, code=exited, status=1/FA
---
schemaVersion: '2.2'
description: Install Java 17 and run the Spring PetClinic application
parameters: {}
mainSteps:
- name: InstallJava17
  action: aws:runShellScript
  inputs:
    runCommand:
    - |
      #!/bin/bash
      
      # Check if Java is installed
      if java -version > /dev/null 2>&1; then
        echo "Java is installed. No need to restart"
      else
        echo "Java is not installed. Restarting after install...."
        # Update package lists
        sudo apt-get update
        
        # Install OpenJDK 17
        sudo apt-get install -y openjdk-17-jdk
          
        # Verify Java installation
        java -version

        exit 194
      fi
      
- name: DownloadApplication
  action: aws:runShellScript
  inputs:
    runCommand:
    - |
      #!/bin/bash
      
      # clean the environment file
      cat /dev/null > /etc/environment
      
      # set the full path
      echo "PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$JAVA_HOME/bin"" | sudo tee -a /etc/environment
      
      # grab the java home and set it in the environment
      JAVA_HOME=$(sudo update-alternatives --config java | grep -o -E '/usr/lib/jvm/[a-zA-Z0-9-]+') 
      echo "JAVA_HOME="$JAVA_HOME"" | sudo tee -a /etc/environment
      
      # update the variables
      source /etc/environment
        
      echo "whoami?"
      sudo whoami
      
      # Create and move into new folder
      sudo mkdir /clinic
      cd /clinic
      
      # Download the repository
      echo "# Download the repository"
      sudo git clone https://github.com/spring-projects/spring-petclinic.git
      
      # Move into the folder
      echo "# Move into the folder"
      cd spring-petclinic
      
      # Start the Maven build
      echo "# Start the Maven build"
      ./mvnw package
      
- name: CreateSystemdService
  action: aws:runShellScript
  inputs:
    runCommand:
    - |
      #!/bin/bash
      
      # clean the environment file
      cat /dev/null > /etc/environment
      
      # set the full path
      echo "PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$JAVA_HOME/bin"" | sudo tee -a /etc/environment
      
      # grab the java home and set it in the environment
      JAVA_HOME=$(sudo update-alternatives --config java | grep -o -E '/usr/lib/jvm/[a-zA-Z0-9-]+') 
      echo "JAVA_HOME="$JAVA_HOME"" | sudo tee -a /etc/environment
      
      # update the variables
      source /etc/environment
      
      # Create systemd service unit
      echo "# Create systemd service unit"
      sudo tee /etc/systemd/system/spring-petclinic.service <<EOF
      [Unit]
      Description=Spring PetClinic Application
      After=network.target
      
      echo "THIS IS THE PATH"
      echo $PATH
      
      echo "THIS IS THE JAVA_HOME"
      echo $JAVA_HOME
      
      [Service]
      ExecStart=/usr/lib/jvm/java-17-openjdk-amd64/bin/java -jar /clinic/spring-petclinic/target/*.jar
      Restart=always
      User=root
      
      [Install]
      WantedBy=multi-user.target
      EOF
      
      echo "whoami?"
      sudo whoami
      
      # Reload systemd and start the service
      echo "# Reload systemd and start the service"
      
      echo "whoami?"
      sudo whoami

      echo "daemon is reloading"
      sudo systemctl daemon-reload
      
      echo "whoami?"
      sudo whoami
      
      echo "enabling spring-petclinic"
      sudo systemctl enable spring-petclinic
      
      echo "whoami?"
      sudo whoami
      
      echo "starting spring-petclinic"
      sudo systemctl start spring-petclinic

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật