0 Replies Latest reply on Mar 28, 2002 5:07 PM by wchao

    JBoss 3.0 beta CMP 2.0 handling of Date fields

    wchao

      Has anyone else experienced problems with the 2002-02-21 beta of JBoss 3.0 when using Date fields in entity beans (CMP)? I keep getting the following error:

      2002-03-28 16:34:32,302 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCo
      mmand.UserBean] Could not create entity
      java.sql.SQLException: ERROR: Bad date external representation '\254\355\000\00
      5sr\000\031java.rmi.MarshalledObject|\275\036\227\355c\374>\002\000\003I\000\004
      hash[\000\010locBytest\000\002[B[\000\010objBytesq\000~\000\001xp3\377\314\177ur
      \000\002[B\254\363\027\370\006\010T\340\002\000\000xp\000\000\000-\254\355\000\0
      05t\000!http://juniper.wchao.hn.org:8083/q\000~\000\000uq\000~\000\003\000\000\0
      00J\254\355\000\005sr\000\015java.sql.Date\024\372Fh?5f\227\002\000\000xr\000\01
      6java.util.Datehj\201\001KYt\031\003\000\000xpw\010\000\000\000\354\336\334wPx'

      The above error is the result of a call to setCreationDate(d) where d = new Date(System.currentTimeMillis()). I've set up jbosscmp-jdbc.xml and ejb-jar.xml with entries for creationDate, and I defined the public abstract getter and setter to be of type java.sql.Date. Does anyone know how to fix the Date problem? I'm using PostgreSQL 7.1.2 with the PostgreSQL JDBC driver, version 7.2.