Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 4.0.0
    • Fix Version/s: 4.0.1
    • Component/s: Build
    • Labels:
      None
    • Environment:
      OS: MacOS High Sierra version 10.13.2
      Java: Oracle JDK 1.8.0_151
      Timezone: Brussels (Central European Time)
      Git revision: 19160b42963adf156d22f2ca1f8b5f3b5d6a9ead

      Description

      The build is failing when the default timezone of the JVM is CET:

      ~/projects/spring-batch$ ./gradlew build
      Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
      
      ...
      
      org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapperTests > testDefaultConversion FAILED
          org.springframework.validation.BindException at BeanWrapperFieldSetMapperTests.java:475
      
      1474 tests completed, 1 failed, 1 skipped
      :spring-batch-infrastructure:test FAILED
      
      FAILURE: Build failed with an exception.
      
      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
      
      BUILD FAILED
      
      Total time: 1 mins 41.117 secs
      

      The failing test is the following:

      org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapperTests#testDefaultConversion
      

      Here is the complete stack trace:

      org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
      Field error in object 'target' on field 'varDate': rejected value [Thu Jan 04 09:05:50 CET 2018]; codes [typeMismatch.target.varDate,typeMismatch.varDate,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [target.varDate,varDate]; arguments []; default message [varDate]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'varDate'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.util.Date] for value 'Thu Jan 04 09:05:50 CET 2018'; nested exception is java.lang.IllegalArgumentException]
      
      	at org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapper.mapFieldSet(BeanWrapperFieldSetMapper.java:200)
      	at org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapperTests.testDefaultConversion(BeanWrapperFieldSetMapperTests.java:475)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
      	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
      	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
      	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
      

        Attachments

          Activity

            People

            • Assignee:
              mbenhassine Mahmoud Ben Hassine
              Reporter:
              mbenhassine Mahmoud Ben Hassine
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: