Skip to content

Failed to bind properties under 'rsa.public-key' to java.security.interfaces.RSAPublicKey #13771

@shivammalviya71234

Description

@shivammalviya71234

Describe the bug
I am getting the following error when I build my Spring Boot application:

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-09-02T12:34:26.525+05:30 ERROR 1128677 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to bind properties under 'rsa.public-key' to java.security.interfaces.RSAPublicKey:

    Property: rsa.public-key
    Value: "classpath:public.pem"
    Origin: class path resource [application.properties] - 1:17
    Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [java.security.interfaces.RSAPublicKey]

Action:

Update your application's configuration

Versions

  • Java: 17.0.7
  • Spring Boot: 3.1.3
  • Spring: 6.0.11

To Reproduce

Expected behavior
As mentioned in the description of ResourceKeyConverterAdapter , "By default, keys can be read from the file system, the classpath, and from HTTP endpoints.". However, it can be observed that no converter is found.

Sample
GitHub repository to reproduce issue: https://github.com/ContractSPAN/ConverterIssue

Metadata

Metadata

Assignees

Labels

for: stackoverflowA question that's better suited to stackoverflow.comin: coreAn issue in spring-security-core

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions