Bugs item #562004, was opened at 2002-05-29 14:11 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=562004&group_id=22866
Category: JBossCMP Group: CVS HEAD Status: Open Resolution: None Priority: 5 Submitted By: Justin Casp (jcasp) Assigned to: Nobody/Anonymous (nobody) Summary: 'Error setting column value' using dependent value classes w Initial Comment: I posted this problem a few weeks ago on jboss.org forums, but it's down right now so I can't reference that post. I figured out how to create a simple test case that reliably reproduces the problem. The error message 'Error setting column value' occurs when I have an existing CMP bean that reads existing records from a datasource. The bean uses a dependent value class, although I'm not sure if this problem is specific to dependent value classes or just any cmp bean with fields mapped to columns. If I create the record externally (e.g., using psql, the postgres command line tool) and only set a few of the columns to non-null values, when I attempt to load that bean instance with a finder, jboss throws the following exception on the server: 12:03:56,650 ERROR [STDERR] java.lang.NullPointerException 12:03:56,652 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 12:03:56,652 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 12:03:56,653 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 12:03:56,653 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324) 12:03:56,653 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCTypeComplexProperty.setColumnValue(JDBCTypeComplexProperty.java:142) 12:03:56,654 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCTypeComplex.setColumnValue(JDBCTypeComplex.java:158) 12:03:56,654 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCTypeComplex.setColumnValue(JDBCTypeComplex.java:133) 12:03:56,654 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadArgumentResults(JDBCAbstractCMPFieldBridge.java:352) 12:03:56,655 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadInstanceResults(JDBCAbstractCMPFieldBridge.java:304) 12:03:56,655 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:140) 12:03:56,655 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62) 12:03:56,655 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:496) 12:03:56,656 ERROR [STDERR] at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:410) 12:03:56,656 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:314) 12:03:56,656 ERROR [STDERR] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:310) 12:03:56,657 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:147) 12:03:56,657 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:193) 12:03:56,657 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107) 12:03:56,658 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69) 12:03:56,658 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96) 12:03:56,658 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167) 12:03:56,659 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61) 12:03:56,659 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129) 12:03:56,659 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166) 12:03:56,659 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:145) 12:03:56,660 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:482) 12:03:56,660 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:694) 12:03:56,660 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1024) 12:03:56,661 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549) 12:03:56,661 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:321) 12:03:56,661 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor186.invoke(Unknown Source) 12:03:56,699 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 12:03:56,700 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324) 12:03:56,700 ERROR [STDERR] ================================================ and this stack trace on the client: Beginning Example: result size: 1 java.lang.reflect.UndeclaredThrowableException at $Proxy1.getOrderID(Unknown Source) at examples.local_objects.ClientDemoDependentObject.main(Unknown Source) Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.ServerException: Error setting column value Embedded Exception null; nested exception is: javax.ejb.EJBException: Error setting column value Embedded Exception null at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292) at sun.rmi.transport.Transport$1.run(Transport.java:148) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:144) 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:536) at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133) at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source) at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:127) at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:92) at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:51) at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:48) at org.jboss.proxy.ejb.EntityInterceptor.invoke(EntityInterceptor.java:115) at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:83) ... 2 more Caused by: java.rmi.ServerException: Error setting column value Embedded Exception null; nested exception is: javax.ejb.EJBException: Error setting column value Embedded Exception null at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:119) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:145) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:482) at org.jboss.ejb.Container.invoke(Container.java:694) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1024) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549) at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:321) at sun.reflect.GeneratedMethodAccessor186.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) at sun.rmi.transport.Transport$1.run(Transport.java:148) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:144) 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:536) Caused by: javax.ejb.EJBException: Error setting column value Embedded Exception null at org.jboss.ejb.plugins.cmp.jdbc.JDBCTypeComplex.setColumnValue(JDBCTypeComplex.java:161) at org.jboss.ejb.plugins.cmp.jdbc.JDBCTypeComplex.setColumnValue(JDBCTypeComplex.java:133) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadArgumentResults(JDBCAbstractCMPFieldBridge.java:352) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadInstanceResults(JDBCAbstractCMPFieldBridge.java:304) at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:140) at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:496) at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:410) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:314) at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:310) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:147) at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:193) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107) at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96) ... 20 more ===================================== instructions to reproduce this error: 1) deploy the attached ear (dvc-bug.ear, uses java:/PostgresDS as the datasource) 2) execute the following sql commands with psql or a similar tool: insert into orders (order_id) values ('100'); ( 'ant run-client' at this point to confirm the app is working if you want) update orders set address_state='FL' where order_id='100'; 3) run the client using the ant script provided ('ant run-client') let me know what I can do to help resolve this bug, as it is stopping my project right now. ---------------------------------------------------------------------- >Comment By: Justin Casp (jcasp) Date: 2002-06-03 20:26 Message: Logged In: YES user_id=555248 I agree, that makes sense. I still think JBoss should, at the very least, return a more descriptive error message perhaps giving a hint to the user that something like this is going on. I was just following the examples in the JBossCMP docs (which use DVC primitive fields), and based my testcase on that example. It just seems like an easy mistake to make, particularly for beginners like myself. ---------------------------------------------------------------------- Comment By: Dan Christopherson (danch) Date: 2002-06-03 11:54 Message: Logged In: YES user_id=51915 No, I don't think this can/should be fixed - if a nullable column were mapped to a primitive field, how could the application tell the difference between null and a legitimate value? Sure you can use flag values, but these have to be application dependent. From the standpoint of relational theory it's just a bad idea. ---------------------------------------------------------------------- Comment By: Justin Casp (jcasp) Date: 2002-06-02 22:12 Message: Logged In: YES user_id=555248 Changing from int to Integer worked... Great thought! I guess it's still a bug though, as JBoss ought to handle this case (which seems fairly common?) a little better. Perhaps it can just be low priority. I was going to attempt to fix it myself, but now that there is a workaround, I can use this bug as a starting point for learning the JBoss codebase as time permits. ---------------------------------------------------------------------- Comment By: Harald Gliebe (hagl) Date: 2002-06-02 13:02 Message: Logged In: YES user_id=31131 The exception probably occurs when you try to load a database NULL value into a primitive field ( the zip attribute of AddressDVC in your example). Could you try to change the type of zip from int to Integer and see if the Exception still occurs. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=562004&group_id=22866 _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development