java.lang.UnsupportedOperationException: Cannot convert to Days as this period contains months and months vary in length

Kuali JIRA | Venkat PremChandran | 5 years ago
  1. 0

    Getting "UnsupportedOperationException: Cannot convert to Days as this period contains months and months vary in length" from AcademicCalendarServiceImpl.getInstructionalDaysForTerm() when start and end date has different months. It's working fine when the date range is within the same month java.lang.UnsupportedOperationException: Cannot convert to Days as this period contains months and months vary in length at org.joda.time.Period.checkYearsAndMonths(Period.java:1482) at org.joda.time.Period.toStandardDays(Period.java:1341) at org.kuali.student.enrollment.class2.acal.service.impl.AcademicCalendarServiceImpl.getInstructionalDaysForTerm(AcademicCalendarServiceImpl.java:1925) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy266.getInstructionalDaysForTerm(Unknown Source) at org.kuali.student.enrollment.class2.acal.service.decorators.AcademicCalendarServiceDecorator.getInstructionalDaysForTerm(AcademicCalendarServiceDecorator.java:710) at org.kuali.student.enrollment.class2.acal.service.impl.AcademicCalendarViewHelperServiceImpl.populateInstructionalDays(AcademicCalendarViewHelperServiceImpl.java:807) at org.kuali.student.enrollment.class2.acal.service.impl.AcademicCalendarViewHelperServiceImpl.populateInstructionalDays(AcademicCalendarViewHelperServiceImpl.java:795)

    Kuali JIRA | 5 years ago | Venkat PremChandran
    java.lang.UnsupportedOperationException: Cannot convert to Days as this period contains months and months vary in length
  2. 0

    Getting "UnsupportedOperationException: Cannot convert to Days as this period contains months and months vary in length" from AcademicCalendarServiceImpl.getInstructionalDaysForTerm() when start and end date has different months. It's working fine when the date range is within the same month java.lang.UnsupportedOperationException: Cannot convert to Days as this period contains months and months vary in length at org.joda.time.Period.checkYearsAndMonths(Period.java:1482) at org.joda.time.Period.toStandardDays(Period.java:1341) at org.kuali.student.enrollment.class2.acal.service.impl.AcademicCalendarServiceImpl.getInstructionalDaysForTerm(AcademicCalendarServiceImpl.java:1925) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy266.getInstructionalDaysForTerm(Unknown Source) at org.kuali.student.enrollment.class2.acal.service.decorators.AcademicCalendarServiceDecorator.getInstructionalDaysForTerm(AcademicCalendarServiceDecorator.java:710) at org.kuali.student.enrollment.class2.acal.service.impl.AcademicCalendarViewHelperServiceImpl.populateInstructionalDays(AcademicCalendarViewHelperServiceImpl.java:807) at org.kuali.student.enrollment.class2.acal.service.impl.AcademicCalendarViewHelperServiceImpl.populateInstructionalDays(AcademicCalendarViewHelperServiceImpl.java:795)

    Kuali JIRA | 5 years ago | Venkat PremChandran
    java.lang.UnsupportedOperationException: Cannot convert to Days as this period contains months and months vary in length
  3. 0

    How to compare two Joda time Periods

    Stack Overflow | 5 years ago | Persimmonium
    java.lang.UnsupportedOperationException: Cannot convert to Days as this period contains months and months vary in length
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Not able to run simple Tranquality example

    Google Groups | 2 years ago | siddhartha dutta
    java.lang.UnsupportedOperationException: Cannot convert to Duration as this period contains months and months vary in length
  6. 0

    Cannot create a scheduled job with a monthly period and a start date in the past

    GitHub | 2 years ago | sdwr98
    java.lang.UnsupportedOperationException: Cannot convert to Seconds as this period contains months and months vary in length

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.UnsupportedOperationException

      Cannot convert to Days as this period contains months and months vary in length

      at org.joda.time.Period.checkYearsAndMonths()
    2. Joda-Time
      Period.toStandardDays
      1. org.joda.time.Period.checkYearsAndMonths(Period.java:1482)
      2. org.joda.time.Period.toStandardDays(Period.java:1341)
      2 frames
    3. org.kuali.student
      AcademicCalendarServiceImpl.getInstructionalDaysForTerm
      1. org.kuali.student.enrollment.class2.acal.service.impl.AcademicCalendarServiceImpl.getInstructionalDaysForTerm(AcademicCalendarServiceImpl.java:1925)
      1 frame
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    5. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      3 frames
    6. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
      1 frame
    7. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      1 frame
    8. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
      1 frame
    9. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      2 frames
    10. Unknown
      $Proxy266.getInstructionalDaysForTerm
      1. $Proxy266.getInstructionalDaysForTerm(Unknown Source)
      1 frame
    11. org.kuali.student
      AcademicCalendarViewHelperServiceImpl.populateInstructionalDays
      1. org.kuali.student.enrollment.class2.acal.service.decorators.AcademicCalendarServiceDecorator.getInstructionalDaysForTerm(AcademicCalendarServiceDecorator.java:710)
      2. org.kuali.student.enrollment.class2.acal.service.impl.AcademicCalendarViewHelperServiceImpl.populateInstructionalDays(AcademicCalendarViewHelperServiceImpl.java:807)
      3. org.kuali.student.enrollment.class2.acal.service.impl.AcademicCalendarViewHelperServiceImpl.populateInstructionalDays(AcademicCalendarViewHelperServiceImpl.java:795)
      3 frames