How Can jBilling Help You?
Who’s Using jBilling?

“jBilling is a very solid and flexible piece of software.”
Francis Champoux
Stream The World Inc.
See all testimonials >

Exception in BasicOrderPeriodTask

I get the exception below when trying to generate an invoice, either manually or by the billing process. I noticed that this is only happening for post-paid orders, when the order period exceeds the billing period. For example, I get an exception if I have a monthly order and set the billing period to 15 days. If I change the billing period to 1 month then the invoice is generated with no issues.

Here's the stacktrace:

com.sapienter.jbilling.server.pluggableTask.TaskException: Error calculating for order 213
at com.sapienter.jbilling.server.pluggableTask.BasicOrderPeriodTask.calculateEnd(BasicOrderPeriodTask.java:213)
at com.sapienter.jbilling.server.process.task.ProRateOrderPeriodTask.calculateEnd(ProRateOrderPeriodTask.java:71)
at com.sapienter.jbilling.server.process.BillingProcessBL.addOrderToInvoice(BillingProcessBL.java:774)
at com.sapienter.jbilling.server.process.BillingProcessBL.processOrdersForUser(BillingProcessBL.java:588)
at com.sapienter.jbilling.server.process.BillingProcessBL.processOrdersForUser(BillingProcessBL.java:633)
at com.sapienter.jbilling.server.process.BillingProcessBL.generateInvoice(BillingProcessBL.java:305)
at com.sapienter.jbilling.server.process.BillingProcessSessionBean.processUser(BillingProcessSessionBean.java:523)
at sun.reflect.GeneratedMethodAccessor746.invoke(Unknown Source)
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:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy16.processUser(Unknown Source)
at com.sapienter.jbilling.server.process.BillingProcessSessionBean.processEntity(BillingProcessSessionBean.java:252)
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:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy16.processEntity(Unknown Source)
at com.sapienter.jbilling.server.process.BillingProcessSessionBean.trigger(BillingProcessSessionBean.java:712)
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:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy16.trigger(Unknown Source)
at com.sapienter.jbilling.client.process.Trigger.execute(Trigger.java:197)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)

Any insight what might be going wrong?

Thanks