作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我将XML文件导入名为Junifer的外部系统时遇到问题。系统已设置为根据我们预先定义的内容接受某些字符串,整数和值。
正在上传的XML文件如下:
<Customer>
<UniqueId>1001</UniqueId>
<ContractId>10012</ContractId>
<ExternalCustomerReference>CustomerREF</ExternalCustomerReference>
<CustomerReference></CustomerReference>
<CompanyName>Name of Company</CompanyName>
<CompanyRegistrationNumber>0000000</CompanyRegistrationNumber>
<CustomerClass>Non Micro</CustomerClass>
<CreditScore></CreditScore>
<BusinessStartDate>12/05/2009</BusinessStartDate>
<BusinessType>Limited</BusinessType>
<Account>
<Contact>
<ContactType>Primary Customer</ContactType>
<IsPrimaryContact>True</IsPrimaryContact>
<ContactSurname>Surname</ContactSurname>
<ContactFirstname>Name</ContactFirstname>
<ContactTitle>Mr</ContactTitle>
<ContactEmailAddress>me@me.com</ContactEmailAddress>
<ContactDateOfBirth></ContactDateOfBirth>
<ContactPrimaryTelephoneNumber>01234567890</ContactPrimaryTelephoneNumber>
<ContactSecondaryTelephoneNumber>01234567890</ContactSecondaryTelephoneNumber>
<BillDeliveryMethod>E-bill</BillDeliveryMethod>
<CommunicationDeliveryMethod>Email</CommunicationDeliveryMethod>
<Address1>Line1</Address1>
<Address2>Line2</Address2>
<Address3>Line3</Address3>
<Address4>Line4</Address4>
<Address5></Address5>
<AddressPostcode>PC1 2PC</AddressPostcode>
</Contact>
<PaymentMethod>
<PaymentMethod>Direct Debit</PaymentMethod>
<BillingCycle></BillingCycle>
<BankAccountName>Bank</BankAccountName>
<BankAccountNumber>22222222</BankAccountNumber>
<BankSortCode>111111</BankSortCode>
<DirectDebitPaymentDay>1</DirectDebitPaymentDay>
<DirectDebitPayment>339.204</DirectDebitPayment>
</PaymentMethod>
<Property>
<PropertyAddress1>Property</PropertyAddress1>
<PropertyAddress2></PropertyAddress2>
<PropertyAddress3>Property3</PropertyAddress3>
<PropertyAddress4>Property4</PropertyAddress4>
<PropertyAddress5>Property5</PropertyAddress5>
<PropertyAddressPostcode>PC1 2PC</PropertyAddressPostcode>
<SupplyCapacity>0.00</SupplyCapacity>
<MeterPoint>
<MeterPointIdentifier>1234567890</MeterPointIdentifier>
<ProfileClass>03</ProfileClass>
<Fuel>Electricity</Fuel>
<TprMappingSet>Tracker</TprMappingSet>
<HhRateDefinition></HhRateDefinition>
<AnnualConsumptions>
<Consumption>20000kWh</Consumption>
<RateName>Standard</RateName>
</AnnualConsumptions>
<Agreement>
<AgreementReference>0.0</AgreementReference>
<AgreementStartDate>27/11/2019</AgreementStartDate>
<AgreementEndDate>26/11/2022</AgreementEndDate>
<AgreementTerm>36</AgreementTerm>
<ProductBundleRef>ElecTracker</ProductBundleRef>
<BrokerCode>BROKER1</BrokerCode>
<BrokerAgentReference>0.0</BrokerAgentReference>
<BrokerReference>Broker</BrokerReference>
<DateOfSale>28/10/2019</DateOfSale>
<ProductItems>
<ProductItem>
<ProductItemReference>ENERGY</ProductItemReference>
<Rates>
<Rate>
<Rate>19.75</Rate>
<RateName>Standard</RateName>
</Rate>
</Rates>
</ProductItem>
<ProductItem>
<ProductItemReference>STANDING-CHARGE</ProductItemReference>
<Rates>
<Rate>
<Rate>33.00</Rate>
</Rate>
</Rates>
</ProductItem>
</ProductItems>
</Agreement>
</MeterPoint>
</Property>
</Account>
</Customer>
</Customers>
java.lang.NumberFormatException: For input string: "
"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.junifer.thor.processing.task.enrolment.CommercialEnrolmentContext.getInteger(CommercialEnrolmentContext.java:492)
at com.junifer.thor.processing.task.enrolment.CommercialEnrolmentContext.resolveCustomerElement(CommercialEnrolmentContext.java:140)
at com.junifer.thor.processing.task.enrolment.CommercialEnrolmentContext.build(CommercialEnrolmentContext.java:94)
at com.junifer.thor.processing.task.enrolment.CommercialEnrolmentOperationsImpl.lambda$buildEnrolmentContextsFromFile$933(CommercialEnrolmentOperationsImpl.java:185)
at com.junifer.thor.processing.task.core.DefaultTaskExecutionContext.executeSubTask(DefaultTaskExecutionContext.java:132)
at com.junifer.thor.processing.task.core.DefaultTaskExecutionContext.executeSubTask(DefaultTaskExecutionContext.java:119)
at com.junifer.thor.processing.task.enrolment.CommercialEnrolmentOperationsImpl.buildEnrolmentContextsFromFile(CommercialEnrolmentOperationsImpl.java:181)
at com.junifer.thor.processing.task.enrolment.CommercialEnrolmentImportTask.executeProcessFile(CommercialEnrolmentImportTask.java:49)
at com.junifer.thor.processing.task.core.LogicalFileBatchTaskComponent.lambda$execute$17(LogicalFileBatchTaskComponent.java:80)
at com.junifer.thor.processing.task.core.DefaultTaskExecutionContext.executeSubTask(DefaultTaskExecutionContext.java:132)
at com.junifer.thor.processing.task.core.LogicalFileBatchTaskComponent.execute(LogicalFileBatchTaskComponent.java:71)
at com.junifer.thor.processing.task.core.TaskExecutor$TaskRunnable.executeTask(TaskExecutor.java:674)
at com.junifer.thor.processing.task.core.TaskExecutor$TaskRunnable.runWithLogging(TaskExecutor.java:623)
at com.junifer.thor.processing.task.core.TaskExecutor$TaskRunnable.run(TaskExecutor.java:595)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:113)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
最佳答案
基于该堆栈跟踪,我想说<CreditScore></CreditScore>
应该包含一个整数值,例如<CreditScore>0</CreditScore>
顺便说一句,£339.204 对于<DirectDebitPayment>
似乎小数点太多<AgreementReference>
和<BrokerAgentReference>
是可为空的文本字段,因此它们不太可能需要包含十进制值(尽管不是错误)。
关于xml - 输入字符串Junifer导入的NumberFormatException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58735240/
我是一名优秀的程序员,十分优秀!