Noted! Lee, I agree you should file a bug. Justin Fredrik Borgh <[EMAIL PROTECTED]> wrote: >Hey Lee > >I've experienced the same problem, and the error lies in >JAWSPersisteneceManager. The mappings i jaws.xml is compared to the >parameters and if you use java.util.Date, this equals the DATE type. >However, in JAWSPer.... a cast i made from the incoming Object to >java.sql.Date. Since java.sql.Date is a subclass of java.util.Date, this >causes a ClassCastException. I suggest you file this in Bugzilla, since this >has to be done something about. A quick workaround is to change > >stmt.setDate(idx,(Date)value); > >to >if(value instanceof java.util.Date) > stmt.setDate(idx, new Date( ((java.util.Date)value).getTime() ) ); >else > stmt.setDate(idx,(Date)value); > >As I said, it's is just a quick fix and this error should be discussed in >the jaws mailing list (hence the cc). > >Fredrik... > > >> Hi again, >> >> I have now deployed my 'User' Entity bean and was running it through some >> tests. I seem to be having a problem calling create() on my home >interface. >> I am getting a ClassCastException on the Date field in my bean. Here is >the >> server side trace: >> *********************************************** >> [JAWS] Create entity >> [User] UserBean : ejbCreate Called >> [JAWS] Create, id is bob >> [JAWS] Insert >> at >> org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.setParameter(JAWSPe >> rsistenceManager.java:1153) >> at >> org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.createEntity(JAWSPe >> rsistenceManager.java:383) >> at >> org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:271) >> at java.lang.reflect.Method.invoke(Native Method) >> at >> org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityC >> ontainer.java:377) >> at >> org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(Ent >> itySynchronizationInterceptor.java:133) >> at >> org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep >> tor.java:64) >> at >> org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInst >> anceInterceptor.java:65) >> at >> org.jboss.ejb.plugins.TxInterceptor.invokeHome(TxInterceptor.java:71) >> >> at >> org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:8 >> 8) >> at >> org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:205) >> at >> org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRM >> PContainerInvoker.java:111) >> at java.lang.reflect.Method.invoke(Native Method) >> at >> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241) >> at sun.rmi.transport.Transport$1.run(Transport.java:142) >> at java.security.AccessController.doPrivileged(Native Method) >> at sun.rmi.transport.Transport.serviceCall(Transport.java:139) >> at >> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4 >> 43) >> at >> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport >> .java:643) >> at java.lang.Thread.run(Thread.java:484) >> [User] java.lang.ClassCastException: java.util.Date >> *********************************************** >> >> The client side trace is as follows: >> *********************************************** >> java.lang.ClassCastException: java.util.Date >> at >> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream >> RemoteCall.java:245) >> at >> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java: >> 220) >> at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122) >> at >> org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invokeHom >> e(Unknown Source) >> at >> org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java >> :73) >> at >> org.jboss.proxy.ProxyCompiler$Runtime.invoke(ProxyCompiler.java:74) >> at >com.gilchrist.css.security.bo.user.UserHome$Proxy.create(Unknown >> Sour >> ce) >> at >> com.gilchrist.css.BeanTestSuit.testUserBean(BeanTestSuit.java:106) >> at com.gilchrist.css.BeanTestSuit.main(BeanTestSuit.java:335) >> *********************************************** >> >> From what I can see I must have made a mess of the mappings for my oracle >> database in my jaws.xml, but I am not sure where ??? If it will help, >here >> are my mappings: >> >> *********************************************** >> <name>Oracle</name> >> <mapping> >> <java-type>java.lang.Double</java-type> >> <jdbc-type>DOUBLE</jdbc-type> >> <sql-type>DOUBLE</sql-type> >> </mapping> >> <mapping> >> <java-type>java.sql.TimeStamp</java-type> >> <jdbc-type>TIMESTAMP</jdbc-type> >> <sql-type>TIMESTAMP</sql-type> >> </mapping> >> <mapping> >> <java-type>java.lang.Byte</java-type> >> <jdbc-type>TINYINT</jdbc-type> >> <sql-type>TINYINT</sql-type> >> </mapping> >> <mapping> >> <java-type>java.lang.Boolean</java-type> >> <jdbc-type></jdbc-type> >> <sql-type>BIT</sql-type> >> </mapping> >> <mapping> >> <java-type>java.lang.String</java-type> >> <jdbc-type>VARCHAR</jdbc-type> >> <sql-type>VARCHAR(256)</sql-type> >> </mapping> >> <mapping> >> <java-type>java.lang.Long</java-type> >> <jdbc-type>BIGINT</jdbc-type> >> <sql-type>BIGINT</sql-type> >> </mapping> >> <mapping> >> <java-type>java.lang.Integer</java-type> >> <jdbc-type>INTEGER</jdbc-type> >> <sql-type>INTEGER</sql-type> >> </mapping> >> <mapping> >> <java-type>java.util.Date</java-type> >> <jdbc-type>DATE</jdbc-type> >> <sql-type>DATE</sql-type> >> </mapping> >> <mapping> >> <java-type>java.lang.Char</java-type> >> <jdbc-type>CHAR</jdbc-type> >> <sql-type>CHAR</sql-type> >> </mapping> >> <mapping> >> <java-type>java.lang.Float</java-type> >> <jdbc-type>FLOAT</jdbc-type> >> <sql-type>FLOAT</sql-type> >> </mapping> >> <mapping> >> <java-type>java.lang.Short</java-type> >> <jdbc-type>INTEGER</jdbc-type> >> <sql-type>INTEGER</sql-type> >> </mapping> >> <mapping> >> <java-type>java.lang.Object</java-type> >> <jdbc-type>BLOB</jdbc-type> >> <sql-type>BLOB</sql-type> >> </mapping> >> <mapping> >> <java-type>java.lang.Object</java-type> >> <jdbc-type>CLOB</jdbc-type> >> <sql-type>CLOB</sql-type> >> </mapping> >> <mapping> >> <java-type>java.lang.Object</java-type> >> <jdbc-type>JAVA_OBJECT</jdbc-type> >> <sql-type>JAVA_OBJECT</sql-type> >> </mapping> >> *********************************************** >> >> TIA !!! >> Lee >> >> >> >> -- >> -------------------------------------------------------------- >> To subscribe: [EMAIL PROTECTED] >> To unsubscribe: [EMAIL PROTECTED] >> Problems?: [EMAIL PROTECTED] >> > >-- >This is the JAWS mailing list. Please send email to '[EMAIL PROTECTED]' >with the command 'unsubscribe jaws [email@address]' in the body of the mail >to be removed from this list. -- Justin Forder -- -------------------------------------------------------------- To subscribe: [EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
