Tag: property-placeholder

Im Frühjahr, immer “java.lang.IllegalArgumentException: Konnte nicht aufgelöst werden Platzhalter" trotz definierter "PropertyPlaceholderConfigurer"

Anzahl der Antworten 2 Antworten
Ich bin mit Spring 3.2.11.VERSION mit Maven 3.3. Ich habe diese Definition in meinem Anwendungskontext Datei ... <bean id="localPropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:quickbase.properties</value> </list> </property> </bean> … <bean id=“myClient" class="org.mainco.subco.mysystem.MyClient"> <constructor-arg index="0" type="String" value="${quickbase.username}" /> <constructor-arg

Spring @Wert TypeMismatchException:Fehler beim konvertieren Wert vom Typ 'java.lang.String' , required Typ " java.lang.Doppel -'

Anzahl der Antworten 3 Antworten
Möchte ich die @Value-annotation zu injizieren einer Double-Eigenschaft wie: @Service public class MyService { @Value("${item.priceFactor}") private Double priceFactor = 0.1; //... und mit Spring-Eigenschaft Platzhalter (Properties-Dateien): item.priceFactor=0.1 Bekomme ich Exception: org.springframework.Bohnen.TypeMismatchException: Fehler beim konvertieren Wert vom Typ

@Value-Annotationstyp, der aus String in Ganzzahl umwandelt

Anzahl der Antworten 8 Antworten
Ich versuche zu casten die Ausgabe eines Werts an eine integer: @Value("${api.orders.pingFrequency}") private Integer pingFrequency; Oben den Fehler auslöst org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input