Hello Colin, could you provide the mapping you are using?
alex Wednesday, June 11, 2003, 11:34:18 AM, Colin McFarlane wrote: CM> I seem to be unable to use a CMP bean that has persistent fields of type java.util.Calendar with a mySQL database. (I am using XDoclet to generate the bean). I can create the bean class and CM> deploy it okay and the table is created with the correct SQL columns. But when I try to create an instance of the bean I get a ClassCastException (see below). I can use a java.util.Date okay but CM> I'm trying to integrate the bean with an Axis service which requires Calendar not Date. CM> I converted the fields to dates and tried to create extra methods in the bean that take/return a calendar object and set/get the date fields but this causes the value objects to fail at CM> compilation as the data object doesn't contain all the methods. Besides I would prefer not to have an extra layer converting between date & calendar. CM> Does anyone have any suggestions? CM> 2003-06-08 13:05:14,795 ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException, causedBy: CM> javax.ejb.CreateException: Could not create entity:javax.ejb.EJBException: Internal error setting parameters for field test; CausedByException is: CM> Cannot convert class java.util.GregorianCalendar to SQL type requested due to java.lang.ClassCastException - null CM> at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractVendorCreateCommand.insertEntity(JDBCAbstractVendorCreateCommand.java:136) CM> at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractVendorCreateCommand.execute(JDBCAbstractVendorCreateCommand.java:76) CM> at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:569) CM> at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:225) CM> at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:270) CM> at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:571) CM> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) CM> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) CM> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) CM> at java.lang.reflect.Method.invoke(Method.java:324) CM> at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:998) CM> at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88) CM> at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:188) CM> at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215) CM> at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88) CM> at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:91) CM> at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61) CM> at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28) CM> at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88) CM> at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243) CM> at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:74) CM> at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92) CM> at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120) CM> at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93) CM> at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:477) CM> at org.jboss.ejb.Container.invoke(Container.java:694) CM> at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:272) CM> at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110) CM> at $Proxy40.create(Unknown Source) CM> at com.incito.mirror.ejb.TicketMasterBean.issue(TicketMasterBean.java:100) CM> at com.incito.mirror.ejb.TicketMasterBean.issue(TicketMasterBean.java:61) CM> <snipped/> ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
