Failed to launch Spring boot application into Linux server

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm trying to deploy my application spring boot into Linux server, so I followed this link, and the bellow file represent my unit declaration service:



#change this to your workspace
WorkingDirectory=/home/user1/myApp.dev/API/
[Service]
User=user1
ExecStart=/usr/bin/java -jar /home/user1/myApp.dev/API/myApp.jar
SuccessExitStatus=143
ExecStop=/bin/kill -INT $MAINPID
ExecReload=/bin/kill -TERM $MAINPID
# In case if it gets stopped, restart it immediately
Restart = always

Type = simple
[Install]
WantedBy=multi-user.target


when I launch my application I have the bellow error:




java.io.FileNotFoundException: logs/myLogs-api.log (No such file or directory).......Failed to create parent directories for
[/logs/myLogs-api.log]




My application cannot find the logs folder, but it already exist in the same directory of my jar folder /home/user1/myApp.dev/API/ .



My logback config



<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>$LOG_PATH:-logs/myLogs-api.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>$LOG_PATH:-logs/myLogs-api.%dyyyy-MM-dd.log</fileNamePattern>
</rollingPolicy>
<append>false</append>
<encoder>
<pattern>%ddd-MM-yyyy HH:mm:ss.SSS %magenta([%thread]) %highlight(%-5level) %logger36.%M - %msg%n</pattern>
</encoder>
</appender>



<root level="info">
<appender-ref ref="FILE" />
</root>
</configuration>


My prop file of spring is under WorkingDirectory=/home/user1/myApp.dev/API/
but when I launch the service it cannot get it.










share|improve this question

























    up vote
    0
    down vote

    favorite












    I'm trying to deploy my application spring boot into Linux server, so I followed this link, and the bellow file represent my unit declaration service:



    #change this to your workspace
    WorkingDirectory=/home/user1/myApp.dev/API/
    [Service]
    User=user1
    ExecStart=/usr/bin/java -jar /home/user1/myApp.dev/API/myApp.jar
    SuccessExitStatus=143
    ExecStop=/bin/kill -INT $MAINPID
    ExecReload=/bin/kill -TERM $MAINPID
    # In case if it gets stopped, restart it immediately
    Restart = always

    Type = simple
    [Install]
    WantedBy=multi-user.target


    when I launch my application I have the bellow error:




    java.io.FileNotFoundException: logs/myLogs-api.log (No such file or directory).......Failed to create parent directories for
    [/logs/myLogs-api.log]




    My application cannot find the logs folder, but it already exist in the same directory of my jar folder /home/user1/myApp.dev/API/ .



    My logback config



    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>$LOG_PATH:-logs/myLogs-api.log</file>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
    <fileNamePattern>$LOG_PATH:-logs/myLogs-api.%dyyyy-MM-dd.log</fileNamePattern>
    </rollingPolicy>
    <append>false</append>
    <encoder>
    <pattern>%ddd-MM-yyyy HH:mm:ss.SSS %magenta([%thread]) %highlight(%-5level) %logger36.%M - %msg%n</pattern>
    </encoder>
    </appender>



    <root level="info">
    <appender-ref ref="FILE" />
    </root>
    </configuration>


    My prop file of spring is under WorkingDirectory=/home/user1/myApp.dev/API/
    but when I launch the service it cannot get it.










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm trying to deploy my application spring boot into Linux server, so I followed this link, and the bellow file represent my unit declaration service:



      #change this to your workspace
      WorkingDirectory=/home/user1/myApp.dev/API/
      [Service]
      User=user1
      ExecStart=/usr/bin/java -jar /home/user1/myApp.dev/API/myApp.jar
      SuccessExitStatus=143
      ExecStop=/bin/kill -INT $MAINPID
      ExecReload=/bin/kill -TERM $MAINPID
      # In case if it gets stopped, restart it immediately
      Restart = always

      Type = simple
      [Install]
      WantedBy=multi-user.target


      when I launch my application I have the bellow error:




      java.io.FileNotFoundException: logs/myLogs-api.log (No such file or directory).......Failed to create parent directories for
      [/logs/myLogs-api.log]




      My application cannot find the logs folder, but it already exist in the same directory of my jar folder /home/user1/myApp.dev/API/ .



      My logback config



      <?xml version="1.0" encoding="UTF-8"?>
      <configuration>

      <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <file>$LOG_PATH:-logs/myLogs-api.log</file>
      <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>$LOG_PATH:-logs/myLogs-api.%dyyyy-MM-dd.log</fileNamePattern>
      </rollingPolicy>
      <append>false</append>
      <encoder>
      <pattern>%ddd-MM-yyyy HH:mm:ss.SSS %magenta([%thread]) %highlight(%-5level) %logger36.%M - %msg%n</pattern>
      </encoder>
      </appender>



      <root level="info">
      <appender-ref ref="FILE" />
      </root>
      </configuration>


      My prop file of spring is under WorkingDirectory=/home/user1/myApp.dev/API/
      but when I launch the service it cannot get it.










      share|improve this question













      I'm trying to deploy my application spring boot into Linux server, so I followed this link, and the bellow file represent my unit declaration service:



      #change this to your workspace
      WorkingDirectory=/home/user1/myApp.dev/API/
      [Service]
      User=user1
      ExecStart=/usr/bin/java -jar /home/user1/myApp.dev/API/myApp.jar
      SuccessExitStatus=143
      ExecStop=/bin/kill -INT $MAINPID
      ExecReload=/bin/kill -TERM $MAINPID
      # In case if it gets stopped, restart it immediately
      Restart = always

      Type = simple
      [Install]
      WantedBy=multi-user.target


      when I launch my application I have the bellow error:




      java.io.FileNotFoundException: logs/myLogs-api.log (No such file or directory).......Failed to create parent directories for
      [/logs/myLogs-api.log]




      My application cannot find the logs folder, but it already exist in the same directory of my jar folder /home/user1/myApp.dev/API/ .



      My logback config



      <?xml version="1.0" encoding="UTF-8"?>
      <configuration>

      <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <file>$LOG_PATH:-logs/myLogs-api.log</file>
      <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>$LOG_PATH:-logs/myLogs-api.%dyyyy-MM-dd.log</fileNamePattern>
      </rollingPolicy>
      <append>false</append>
      <encoder>
      <pattern>%ddd-MM-yyyy HH:mm:ss.SSS %magenta([%thread]) %highlight(%-5level) %logger36.%M - %msg%n</pattern>
      </encoder>
      </appender>



      <root level="info">
      <appender-ref ref="FILE" />
      </root>
      </configuration>


      My prop file of spring is under WorkingDirectory=/home/user1/myApp.dev/API/
      but when I launch the service it cannot get it.







      linux ubuntu java






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 25 at 12:41









      BERGUIGA Mohamed Amine

      1012




      1012

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f471312%2ffailed-to-launch-spring-boot-application-into-linux-server%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f471312%2ffailed-to-launch-spring-boot-application-into-linux-server%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?