输入字符串Junifer导入的NumberFormatException

我在将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)

对于基于XML提供的信息如何获得成功的阅读,有任何建议吗?

pcccainao 回答:输入字符串Junifer导入的NumberFormatException

基于该堆栈跟踪,我想说<CreditScore></CreditScore>应该包含一个整数值,例如<CreditScore>0</CreditScore>

顺便说一句,对于<DirectDebitPayment>

339.204英镑似乎有太多小数位

<AgreementReference><BrokerAgentReference>是可为空的文本字段,因此不太可能(尽管不是错误)它们必须包含十进制值。

本文链接:https://www.f2er.com/3150244.html

大家都在问