0 Replies Latest reply on Nov 12, 2003 4:22 PM by Elena Neroslavskaya

    Oracle CMP Boolean Mapping exception

    Elena Neroslavskaya Newbie

      Hello,
      I'm trying to write CMP which have one of the fields
      boolean getActive();
      but when running this CMP in Oracle it gives excpetion below. Does anyboy have any clue to that problem ?
      I have tried to add mappings to my jbosscmp-jdbc.xml
      <jdbc-type>BIT</jdbc-type>
      <sql-type>NUMBER(1)</sql-type>
      gives same problem:


      [DBUserEJB.ejbCreate] Executing SQL: INSERT INTO USERS (userid, username, passwd, firstName, middleName, lastName, emailAddress, languageId, timeZoneId, createDate, lastLoginDate, lastLoginIP, active, workflow, company, phone) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      2003-11-12 17:15:53,119 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException, causedBy:
      java.lang.ClassCastException: java.lang.Boolean
      at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:1965)
      at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2052)
      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.setObject(WrappedPreparedStatement.java:607)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.setParameter(JDBCUtil.java:292)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setArgumentParameters(JDBCAbstractCMPFieldBridge.java:301)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setInstanceParameters(JDBCAbstractCMPFieldBridge.java:280)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.insertEntity(JDBCCreateEntityCommand.java:317)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:209)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:569)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:225)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:270)
      at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:571)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:998)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)