Subject JBoss 4.0.0 and Firebird CMP BigDecimal to zero decimal numeric field
Author tsangccn
Hello,

I am using JBoss 4.0.0 with Jaybird 1.5.5.

My table has a zero decimal numeric field defined as NUMERIC(15,0)

A CMP 2.0 entity EJB is defined on the table.
The field is defined as java.math.BigDecimal.

A record is created using the entity bean with no problem.

But when I get the field from the entity bean, it fails with the
following exception

Caused by: javax.ejb.TransactionRolledbackLocalException: Internal
error getting results for field member amount; CausedByException is:
Got a java.lang.Long[cl=0, value=550240] while looking for a
java.math.BigDecimal[cl=24384712]; CausedByException is:
Internal error getting results for field member amount;
CausedByException is:
Got a java.lang.Long[cl=0, value=550240] while looking for a
java.math.BigDecimal[cl=24384712]
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:232)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:149)
at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:514)
at org.jboss.ejb.Container.invoke(Container.java:854)
at
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:413)
at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:44)
at $Proxy425.getExpenseReportPostingVO(Unknown Source)
at
com.nsl.expenseReport.expenseReport.beans.ExpenseReportPostingExporter.export(ExpenseReportPostingExporter.java:63)
... 87 more

The problem also occurs in JBoss 4.0.1

Any help is appreciated.
Thanks.
C. N.