Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Method signature types for methods of javax.persistence.AttributeConverter no longer included in configuration. #1329

Closed
christophstrobl opened this issue Dec 2, 2021 · 2 comments
Labels
type: compatibility Native image compatibility issue
Milestone

Comments

@christophstrobl
Copy link
Contributor

spring-native: 0.11.0-SNAPSHOT

In the sample below, both MonetaryAmountAttributeConverter and MonetaryAmount are added to the configuration, but the more concrete return type org.javamoney.moneta.Money of convertToEntityAttribute(...) ist not.

@Converter(autoApply = true)
public class MonetaryAmountAttributeConverter implements AttributeConverter<MonetaryAmount, String> {

	@Override
	public String convertToDatabaseColumn(MonetaryAmount amount) {
		// ...
	}

	@Override
	public Money convertToEntityAttribute(String source) { // Money type not added to configuration

this leads to the following warn on startup

j.m.s.DefaultMonetaryAmountsSingletonSpi : Using Money as default amount type, because loading of configured org.javamoney.moneta.Money.defaults.amountType failed

java.lang.ClassNotFoundException: org.javamoney.moneta.Money
	at java.lang.Class.forName(DynamicHub.java:1433) ~[restbucks:na]
	at java.lang.Class.forName(DynamicHub.java:1408) ~[restbucks:na]
	at org.javamoney.moneta.spi.DefaultMonetaryAmountsSingletonSpi.loadDefaultAmountType(DefaultMonetaryAmountsSingletonSpi.java:66) ~[restbucks:1.4.2]
	at org.javamoney.moneta.spi.DefaultMonetaryAmountsSingletonSpi.<init>(DefaultMonetaryAmountsSingletonSpi.java:46) ~[restbucks:1.4.2]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
@sdeleuze
Copy link
Contributor

sdeleuze commented Dec 6, 2021

Could you a please share a minimal repro?

@sdeleuze sdeleuze added this to the 0.11.1 milestone Dec 6, 2021
@sdeleuze sdeleuze added the type: compatibility Native image compatibility issue label Dec 6, 2021
@christophstrobl
Copy link
Contributor Author

closed via: 906925e by #1347

@sdeleuze sdeleuze modified the milestones: 0.11.1, 0.11.0 Dec 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: compatibility Native image compatibility issue
2 participants