Skip to main content

Connecting to a firstspirit server from an spring application inside a docker container

Comments

5 comments

  • Zendesk API User
    Author: Windmüller - 10/24/2024 21:15

    How exactly do you package your application? The runtime jar has to be unmodified because otherwise the signature will be invalid.

    0
  • Zendesk API User
    Author: David1 - 10/25/2024 11:46

    I am using gradle and the corrisponding gradle spring plugins to package my application with the bootJar Task. This results in the following folder structure:

    BOOT-INF

          ---------> classes

          ---------> lib -> This is where the isolated-runtime jar resides with the SIgnature present after unzipping

    META-INF

          ---------> services

          ---------> BOOT.SF

          ---------> MANIFEST.MF

    org

         ----------> To my understanding classes related for the spring classloader

    Plugins used:

    id 'org.springframework.boot' version '3.3.2' id 'io.spring.dependency-management' version '1.1.4'

    I did no modifications to the Spring related Tasks like bootJar as left them as is. 

    The library is included with the following Dependency Scope:

    implementation group: 'de.espirit.firstspirit', name: 'fs-isolated-runtime', version: 'Some Version'

     

    0
  • Zendesk API User
    Author: Windmüller - 10/25/2024 12:51

    I just remembered that I had the exact same issue over seven years ago. Please see Spring Boot #8704 for details and a possible solution.

    0
  • Zendesk API User
    Author: David1 - 10/25/2024 14:43

    That link was really helpful!

    I got my setup working with the following configuration:

    bootJar{ requiresUnpack('**/fs-isolated-runtime-*.jar') }

     

    Thank you for your help .

    0
  • Zendesk API User
    Author: hbarthel - 11/13/2024 15:30

    We are using a different approach since years now and the idea is, to not deliver the fs-isolated-runtime.jar within the SpringBoot application, but it resides in the file system of the server instead.

    In build.gradle we define the following:

    bootJar { archiveFileName = 'app.jar' // enables 'loader.path' system property for specifying location of FirstSpirit jar manifest { attributes 'Main-Class': 'org.springframework.boot.loader.launch.PropertiesLauncher' } }

    For Maven it looks like so in pom.xml:

    <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!-- enables 'loader.path' system property for specifying location of FirstSpirit jar --> <layout>ZIP</layout> ... </configuration> </plugin>

    And we start it like so:

    java -Dloader.path=path/to/fs-isolated-runtime-5.2.240312.jar -jar app.jar

     

    Maybe this helps somebody out.

    Cheers, Heiko

    0

Please sign in to leave a comment.