ClassCastException thrown by ejbCreate()
dmartin Oct 10, 2002 11:23 AMI am using JBoss3.0.2 with DB2. I have a simple EntityBean with 2 CMP fields alert_id and batch_id both of type integer.
public Integer ejbCreate (Integer batch_id, Integer alert_id) throws CreateException {
System.out.println ("[TestTableBean] Starting create method...");
System.out.println("[TestTableBean] Values ="+batch_id.toString() + alert_id.toString());
setAlert_id (alert_id);
setBatch_id (batch_id);
System.out.println ("[TestTableBean] Finishing create method...");
return null;
}
When this method is executed the following exception is thrown.
2002-10-10 14:13:43,843 INFO [STDOUT] [TestTableBean] Starting create method...
2002-10-10 14:13:43,859 INFO [STDOUT] [TestTableBean] Values =44
2002-10-10 14:13:43,859 INFO [STDOUT] [TestTableBean] Finishing create method...
2002-10-10 14:13:43,859 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.TestTable] Create: pk=4
2002-10-10 14:13:43,859 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.TestTable] Executing SQL: SELECT COUNT(*) FROM ALR.TESTTABLE WHERE alert_id=?
2002-10-10 14:13:43,859 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.TestTable] Executing SQL: INSERT INTO ALR.TESTTABLE (alert_id, batch_id) VALUES (?, ?)
2002-10-10 14:13:43,859 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.TestTable] Rows affected = 1
2002-10-10 14:13:43,875 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException:
java.lang.ClassCastException: $Proxy507
at $Proxy501.create(Unknown Source)
at com.searchspace.research.onlineservices.ejb.alert.session.AlertDelegateBean.createAlert(AlertDelegateBean.java:91)
at java.lang.reflect.Method.invoke(Native Method)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
at org.jboss.ejb.Container.invoke(Container.java:720)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:370)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
at sun.rmi.transport.Transport$1.run(Transport.java:147)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:479)
I am using the correct DB2 type mappings as far as I know (I am using the db2-service.xml template supplied in the release).
Any help would be greatly appreciated!