Skip to content

Providers loaded by FileSystemProvider not handled correctly in native image #5134

Open
@OlgaMaciaszek

Description

@OlgaMaciaszek

Providers loaded by java.nio.file.spi.FileSystemProvider (such as BouncyCastleProvider or SftpFileSystemProvider) cause native image compilation to fail with No instances of xxx are allowed in the image heap as this class should be initialized at image runtime.. However, adding --initialize-at-run-time=java.nio.file.spi.FileSystemProvider to setup results in Error: The class java.nio.file.spi.FileSystemProvider has already been initialized (from command line with 'java.nio.file.spi.FileSystemProvider'); it is too late to register java.nio.file.spi.FileSystemProvider for build-time initialization..

You can use this demo branch as a sample.
Run with ./mvnw clean package -Pnative -DskipTests.

Metadata

Metadata

Assignees

Labels

bugspringspring related issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions