Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Upgrading Springboot IPF Project

44 views
Skip to first unread message

Marcus Olk

unread,
Apr 2, 2024, 6:17:38 AM4/2/24
to ipf-user
Hi there.

I am failing to upgrade a rather simple Maven based project to recent
versions of Java, Springboot and IPF.

Here are the crucial parts of the Maven pom:

<parent>
  <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-parent</artifactId>
   <version>3.2.4</version>
   <relativePath /> <!-- lookup parent from repository -->
</parent>

<dependencyManagement>
   <dependencies>
     <dependency>
       <groupId>org.openehealth.ipf</groupId>
       <artifactId>ipf-dependencies</artifactId>
       <version>
4.8.0</version>
       <type>pom</type>
       <scope>import</scope>
     </dependency>
   </dependencies>
</dependencyManagement>

The Springboot Application class is Standard.

@EnableAutoConfiguration
@ComponentScan(basePackages={"com.myapp"})
@SpringBootApplication
public  class MyApplication {
   public static void main(String[] args) {
     SpringApplication.run(XdsApplication.class, args);
   }
}

When running the JAR I end up with this rather useless error:

openjdk version "17.0.10" 2024-01-16 LTS
OpenJDK Runtime Environment Zulu17.48+15-CA (build 17.0.10+7-LTS)
OpenJDK 64-Bit Server VM Zulu17.48+15-CA (build 17.0.10+7-LTS, mixed mode, sharing)
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91)
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53)
        at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:58)
Caused by: java.lang.NoSuchMethodError: 'org.springframework.core.io.support.SpringFactoriesLoader org.springframework.core.io.support.SpringFactoriesLoader.forDefaultResourceLocation(java.lang.ClassLoader)'
        at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:483)
        at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:479)
        at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:293)
        at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:273)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
        at com.myapp.MyApplication.main(MyApplication.java:14)
        ... 7 more


The obvious and expected devices to "fix dependencies" don't  help here.

As I mentioned: I utilize the Spring parent POM and the "IPF dependencies" here,
as shown in the POM snippet.

Going back to JDK 8, Springboot 2.1.18.RELEASE and IPF 3.6.5 works.

Apart from this particular error:
is there any in-depth documentation on how to correctly
write your POM to safely bring IPF and Springboot into a working application?

Thanks.

Marcus

Thomas Papke

unread,
Apr 2, 2024, 1:22:44 PM4/2/24
to ipf-user
Hello Marcus,

IPF 4.8.0 use and support Spring-boot 2.7.x. You snippet show spring-boot 3.2. Spring-boot 3 support is currently under development in https://github.com/oehf/ipf/issues/414

If you look into your maven dependency tree (mvn dependency:tree), you will have mix of multiple spring boot versions, because the start-parent and the transitive dependencies of IPF might conflict each other.

In the blueprint application, I haved shared some minutes before (https://github.com/oehf/xds-registry-to-fhir), you will find an pom which also use spring-boot in combination with ipf 4.8.0, maybe this help.

Best regards,
Thomas

Marcus Olk

unread,
Apr 2, 2024, 6:13:32 PM4/2/24
to ipf-user
Hey Thomas.

That helped a lot, yes! Thanks!
I was not aware that IPF currently supports 2.7.x, only.

Thanks again,

Marcus

Christian Ohr

unread,
Apr 5, 2024, 5:41:47 AM4/5/24
to ipf-...@googlegroups.com
Hi,

IPF 4.8.0 is not yet compatible with Spring Boot 3.x. It still relies on the latest Spring Boot 2.7 version (2.7.18 I think).
There will be a IPF 5.0.0 release where the complete Jakarta EE and Spring stack is upgraded to the latest versions, and Java 17 will be required too. See #414 for the context.

best regards
Christian

--
You received this message because you are subscribed to the Google Groups "ipf-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ipf-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ipf-user/e5935283-488f-46f0-8de4-2af788e3d8e9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages