I'm using a SQL Server database with the following JAWS.XML type mapping

  <mapping>
    <java-type>java.sql.Date</java-type>
    <jdbc-type>DATE</jdbc-type>
    <sql-type>SMALLDATETIME</sql-type>
  </mapping>

I have a java.sql.Date field in a CMP Entity Bean. When I try to find an
instance and access the business methods of the object I get the following
exception:

java.rmi.ServerException: Load failed; nested exception is:
java.rmi.ServerException: Load failed; nested exception is:
java.lang.IllegalArgumentException: field type mismatch
java.rmi.ServerException: Load failed; nested exception is:
java.lang.IllegalArgumentException: field type mismatch
java.lang.IllegalArgumentException: field type mismatch
at java.lang.reflect.Field.set(Native Method)
at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.loadEntity(
JAWSPersistenceManager.java:784)
at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPer
sistenceManager.java:180)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke
(EntitySynchronizationInterceptor.java:218)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(Entity
InstanceInterceptor.java:100)
at org.jboss.ejb.plugins.TxInterceptor$RunInvoke.run(TxIntercept
or.java:342)
at org.jboss.ejb.plugins.TxInterceptor.runWithTransactions(TxInt
erceptor.java:223)
at org.jboss.ejb.plugins.TxInterceptor.invoke(TxInterceptor.java
:98)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInte
rceptor.java:93)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.ja
va:154)
at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:313
)
at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke
(JRMPContainerInvoker.java:172)
at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke
(JRMPContainerInvoker.java:156)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Sou
rce)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unkn
own Source)
at java.lang.Thread.run(Unknown Source)

I added some log.debug calls to verify that it was the DATE type that was
causing the failure so the line numbers may be a bit out in
JAWSPersistenceManager so here's the matching code:

               // Load primitive

               // TODO: this probably needs to be fixed for BLOB's etc.
               ((Field)cmpFields.get(i)).set(ctx.getInstance(),
rs.getObject(idx++));


Is my mapping OK, or ?



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to