error when trying to run billing process

Greg Straub's Avatar

Greg Straub

09 Dec, 2015 03:06 PM

Whenever I try to run the billing process from the configuration page, I am getting the following error in the log file.

2015-12-09 08:48:08,030 1412328 ERROR [com.sapienter.jbilling.server.process.BillingProcessSessionBean] (Thread-24:) Job # generateInvoicesJob with parameters # {entityId=10, billingDate=1449468000000, periodValue=1, periodType=1, review=0}colud not be launched:
org.springframework.dao.DataAccessResourceFailureException: Could not increment identity; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'BATCH_JOB_EXECUTION_SEQ'.
at org.springframework.jdbc.support.incrementer.SqlServerMaxValueIncrementer.getNextKey(SqlServerMaxValueIncrementer.java:124)
at org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer.nextLongValue(AbstractDataFieldMaxValueIncrementer.java:128)
at org.springframework.batch.core.repository.dao.JdbcJobExecutionDao.saveJobExecution(JdbcJobExecutionDao.java:150)
at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:145)
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:497)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean$1.invoke(AbstractJobRepositoryFactoryBean.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy112.createJobExecution(Unknown Source)
at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:125)
at com.sapienter.jbilling.server.process.BillingProcessSessionBean.processEntity(BillingProcessSessionBean.java:247)
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:497)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy107.processEntity(Unknown Source)
at com.sapienter.jbilling.server.process.BillingProcessSessionBean.processEntity(BillingProcessSessionBean.java:582)
at com.sapienter.jbilling.server.process.BillingProcessSessionBean.trigger(BillingProcessSessionBean.java:494)
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:497)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy107.trigger(Unknown Source)
at com.sapienter.jbilling.server.util.WebServicesSessionSpringBean$2.run(WebServicesSessionSpringBean.java:5141)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'BATCH_JOB_EXECUTION_SEQ'.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1635)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:865)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:762)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:6276)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1793)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:184)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:159)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeUpdate(SQLServerStatement.java:687)
at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:64)
at org.springframework.jdbc.support.incrementer.SqlServerMaxValueIncrementer.getNextKey(SqlServerMaxValueIncrementer.java:108)
... 50 more

Am I missing a db script or something?

Thanks

  1. 1 Posted by Vikas@WebDataTe... on 09 Dec, 2015 03:39 PM

    Vikas@WebDataTechnologiesLLP's Avatar

    The problem I think is that jBilling by default comes with HSQL database. Which has case sensitive table names. If not, it could be a missing script. Can you confirm the jBilling Version, minimum steps to reproduce.

    Thanks
    Vikas

  2. 2 Posted by Greg Straub on 09 Dec, 2015 03:44 PM

    Greg Straub's Avatar

    jbilling community 4.1.1

    I've changed the jdbc to use with sql server. I've ran the create db script but I'm not seeing any BATCH_JOB_EXECUTION_SEQ table. Only BATCH_JOB_EXECUTION, BATCH_JOB_EXECUTION_CONTEXT, and BATCH_JOB_EXECUTION_PARAMS.

    Is there another db script that I could download to see if it contains that table?

    Thanks!

  3. 3 Posted by Vikas@WebDataTe... on 09 Dec, 2015 05:03 PM

    Vikas@WebDataTechnologiesLLP's Avatar

    Not sure about it. Can you try building from source? Use instructions at https://github.com/WebDataConsulting/billing/wiki/Installing-jBilling-Binary-and-or-from-Source

    Or try downloading binary from http://webdataconsulting.github.io/

    Vikas@WebData

  4. 4 Posted by ahmed.drira@gma... on 09 Dec, 2015 09:29 PM

    ahmed.drira@gmail.com's Avatar

    Hi
    jbilling contains scheduled job wish run to perform batch task like the
    billing ,
    the billing process need to be configured from the config tab , some
    plugins need to be configured also , the documentation describe how to
    configure
    there is no db batch script ,
    my billing process is running since six month, i ve configured it to run
    the 1st day of every month at 01h:00 mm

  5. 5 Posted by Vikas@WebDataTe... on 10 Dec, 2015 04:53 AM

    Vikas@WebDataTechnologiesLLP's Avatar

    @Ahmed - you are right. And that scheduled job basically triggers a Spring Batch job. What Greg is facing is failure of Billing Process due to the failure of the Spring Batch job due to a missing table. This problem is quite familiar and as far as I can tell it is a db issue. Most likely HSQL. But could reproduce on other DBs.

    What Greg should share is:
    1. Type of DB - I guess it is MS-SQL
    2. Steps Greg may have used to initialize the above DB.

    Hope that helps.
    Vikas

  6. 6 Posted by Vikas@WebDataTe... on 10 Dec, 2015 05:49 AM

    Vikas@WebDataTechnologiesLLP's Avatar

    Invalid object name

    Could it be that MS-SQL does not assume a default schema and therefore would require a schemaName in order to function correctly and find this sequence? Please check.

  7. 7 Posted by Greg Straub on 10 Dec, 2015 02:45 PM

    Greg Straub's Avatar

    After further research, I found that this object is actually a sequence in the database. And I can see it in my database so thats not an issue. I'll have to do some more research to see if Vikas is correct about assuming the default schema. That's what I'm leaning towards.
    Since I'm new to the code, I'm trying to find the place in the code where it actually calls this batch job. I have searched for the sequence name (BATCH_JOB_EXECUTION_SEQ) in the source and could not find it. Does anyone know the filename that controls that?

    Thanks again for the help!

  8. 8 Posted by Greg Straub on 30 Mar, 2016 04:10 PM

    Greg Straub's Avatar

    After finding the place to change the default schema, I'm still having the same issue. Is anyone having issues running the billing process on SQL Server? I'm guessing there is a config problem.

    getting this error:
    org.springframework.dao.DataAccessResourceFailureException: Could not increment identity; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'dbo.BATCH_JOB_SEQ'.

    The sequence is in the db. For some reason, the Spring batch cannot see it.

  9. 9 Posted by Vikas@WebDataTe... on 04 Apr, 2016 02:49 AM

    Vikas@WebDataTechnologiesLLP's Avatar

    Hello Greg,

    This error is most likely caused by case sensitive table name comparision
    behaviour of MS SQL Server. Check if you can simply turn off case sensitive
    table names in MS SQL Server?

    Otherwise, you may have to confirm to DBs constraint on table name case.

    Please share your findings here. Appreciate it.

    Regards
    Vikas Bodani @ Web Data Technologies LLP

  10. 10 Posted by Greg Straub on 04 Apr, 2016 02:10 PM

    Greg Straub's Avatar

    Thanks for the reply.

    Unfortunately, that doesn't seem to be the issue. I am using SQL_Latin1_General_CP1_CI_AS as the collation, so it's not case sensitive on the db or tables. I did rename the batch_job_seq and batch_job_execution_seq to uppercase to test if it was case sensitive, but I'm still getting the same error.

  11. 11 Posted by Vikas@WebDataTe... on 09 Apr, 2016 12:02 PM

    Vikas@WebDataTechnologiesLLP's Avatar

    Thanks Greg. Can you explain the schema name 'dbo' prefix?

    May be the jBilling db is required to be instantiated with a schema
    explicitly or otherwise, spring configuration has to be informed about the
    schema name?

    I googled the error and found this explanation:
    http://stackoverflow.com/questions/909599/java-mssql-java-sql-sqlexception-invalid-object-name-tablename

    Vikas

  12. 12 Posted by saud qureshi on 19 Aug, 2019 09:28 PM

    saud qureshi's Avatar

    Hi Greg, I am trying to install JBilling 4.1 with MS SQL server. Can you please guide me with the correct steps, and any gotchas. please.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac