• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Error while defining Constructor argument

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i've defined my constructor as

public DefaultValidationService(Map<DomainType, Map<PaymentScheme, List<ValidationRule<Object>>>> ruleMap, boolean failFast) {
this.ruleMap = ruleMap;
this.failFast = failFast;
}

When i define my constructor argument in spring file like

<constructor-arg>
<map>
<entry key="SUBMISSION">
<map>
<entry key="B2B">
<list>
<bean class="com.voca.csm.dd.validation.rules.pacs.header.ClearingSystemProprietaryRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs.header.SubmittingBICValidRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs.header.SettlementMethodRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.header.InterBankSettDateOneProcessingDayRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.header.InterbankSettlementAmountWithinClearingLimitRule" parent="abstractValidationRule"/>
</list>
</entry>
</map>
</entry>
<entry key="INSTRUCTION">
<map>
<entry key="B2B">
<list>
<bean class="com.voca.csm.dd.validation.rules.pacs.instruction.TransactionIdentificationRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs.instruction.InstructingAgentExistsInBodyOrGrpHeaderRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs.instruction.InstructingAgentValidInBodyOrGrpHeaderRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.OriginalDebtorAgentSeqTypeFRSTRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs.instruction.DebtorAgentReachableRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.SequenceTypeFRSTOnlyRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.CreditorSchemePrivateIdOtherValueModCheckRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.InterBankSettDateCalendarDaysWarehouseRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.OriginalCreditorSchemePrivateIdOtherValueModCheckRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.OriginalMandateIdentificationRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.OriginalCreditorSchemeIdentificationNameRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.OriginalDebtorAccountValidIBANRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.DebtorAccountValidIBANRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.CreditorAccountValidIBANRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs.instruction.InstructingAgentSubmittingBICRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.SequenceTypeExistsInBodyOrGrpHeaderRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.AmendmentInformationDetailsPresentRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.SequenceTypeExistsOnlyInBodyOrGrpHeaderRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.PaymentTypeInfoExistsOnlyInBodyOrGrpHeaderRule" parent="abstractValidationRule"/>
<bean class="com.voca.csm.dd.validation.rules.pacs003.instruction.CreditorSchemePrivateIdOtherIDSEPACheckRule" parent="abstractValidationRule"/>
</list>
</entry>
</map>
</entry>
</map>
</constructor-arg>


I get this error

Unsatisfied dependency expressed through constructor argument with index 0 of type [java.util.Map]: Could not convert constructor argument value of type [java.util.LinkedHashMap] to required type [java.util.Map]: Failed to convert value of type [java.util.LinkedHashMap] to required type [java.util.Map]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.util.ArrayList] to required type [java.util.Map] for property 'null': no matching editors or conversion strategy found">org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pacs003Parser' defined in class path resource [spring/parser.xml]: Cannot resolve reference to bean 'arrivalPacs003ValidationService' while setting bean property 'validationService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'arrivalPacs003ValidationService' defined in class path resource [spring/validation.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.util.Map]: Could not convert constructor argument value of type [java.util.LinkedHashMap] to required type [java.util.Map]: Failed to convert value of type [java.util.LinkedHashMap] to required type [java.util.Map]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.util.ArrayList] to required type [java.util.Map] for property 'null': no matching editors or conversion strategy found

Any suggestions please.
 
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you have some typos in that post.

public DefaultValidationService(Map<DomainType, Map><PaymentScheme,

What are the names of the constructor args, and why aren't you even using them in the code in the constructor?

Also, when you post code or configuration files, please use the CODE tags so that the formatting stays and it is readable. Right now I can't read your config stuff, and there appears to be some typos there too, like no closing tags.

Mark>
 
meraj zia
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe it's there



The name are ruleMap and failFast

Spring file entry



 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Map<DomainType, Map><PaymentScheme, List><ValidationRule><Object>>>> is so confusing, can you rewrite you code?
 
That's a very big dog. I think I want to go home now and hug this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!