org.ofbiz.core.entity.GenericNotImplementedException: Java type java.util.Date not currently supported. Sorry.

Atlassian JIRA | Verhás István | 1 decade ago
  1. 0

    The definiton of the Interface AttachmentManager contains the following method {code:title=http://www.atlassian.com/software/jira/docs/api/3.6.4/com/atlassian/jira/issue/AttachmentManager.html} public ChangeItemBean createAttachment(File file, String filename, String contentType, User remoteUser, org.ofbiz.core.entity.GenericValue issue, Map attachmentProperties, Date createdTime) throws AttachmentException, org.ofbiz.core.entity.GenericEntityException {code} Actually the {{Date createdTime}} refers to {{java.util.Date}} but the underlying ofbiz layer does not support it. Instead of {{java.util.Date}} it can persist {{java.sql.Date}} which is a subclass of it. The following stack trace shows what happens with {{java.util.Date}}: {noformat} org.ofbiz.core.entity.GenericNotImplementedException: Java type java.util.Date not currently supported. Sorry. at org.ofbiz.core.entity.jdbc.SqlJdbcUtil.getType(SqlJdbcUtil.java:720) at org.ofbiz.core.entity.jdbc.SqlJdbcUtil.setValue(SqlJdbcUtil.java:632) at org.ofbiz.core.entity.jdbc.SqlJdbcUtil.setValue(SqlJdbcUtil.java:601) at org.ofbiz.core.entity.jdbc.SqlJdbcUtil.setValues(SqlJdbcUtil.java:436) at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:114) at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:88) at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:63) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:470) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:450) at org.ofbiz.core.entity.GenericValue.create(GenericValue.java:77) at com.atlassian.core.ofbiz.util.EntityUtils.createValue(EntityUtils.java:61) at com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:101) at com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:202) ..... {noformat} I suppose that the definition of the method (and the other createAttachment method) and the implementing class should be changed to {{java.sql.Date}}. h4. Workaround Use {{java.sql.Date}} instead of {{java.util.Date}}

    Atlassian JIRA | 1 decade ago | Verhás István
    org.ofbiz.core.entity.GenericNotImplementedException: Java type java.util.Date not currently supported. Sorry.
  2. 0

    The definiton of the Interface AttachmentManager contains the following method {code:title=http://www.atlassian.com/software/jira/docs/api/3.6.4/com/atlassian/jira/issue/AttachmentManager.html} public ChangeItemBean createAttachment(File file, String filename, String contentType, User remoteUser, org.ofbiz.core.entity.GenericValue issue, Map attachmentProperties, Date createdTime) throws AttachmentException, org.ofbiz.core.entity.GenericEntityException {code} Actually the {{Date createdTime}} refers to {{java.util.Date}} but the underlying ofbiz layer does not support it. Instead of {{java.util.Date}} it can persist {{java.sql.Date}} which is a subclass of it. The following stack trace shows what happens with {{java.util.Date}}: {noformat} org.ofbiz.core.entity.GenericNotImplementedException: Java type java.util.Date not currently supported. Sorry. at org.ofbiz.core.entity.jdbc.SqlJdbcUtil.getType(SqlJdbcUtil.java:720) at org.ofbiz.core.entity.jdbc.SqlJdbcUtil.setValue(SqlJdbcUtil.java:632) at org.ofbiz.core.entity.jdbc.SqlJdbcUtil.setValue(SqlJdbcUtil.java:601) at org.ofbiz.core.entity.jdbc.SqlJdbcUtil.setValues(SqlJdbcUtil.java:436) at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:114) at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:88) at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:63) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:470) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:450) at org.ofbiz.core.entity.GenericValue.create(GenericValue.java:77) at com.atlassian.core.ofbiz.util.EntityUtils.createValue(EntityUtils.java:61) at com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:101) at com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:202) ..... {noformat} I suppose that the definition of the method (and the other createAttachment method) and the implementing class should be changed to {{java.sql.Date}}. h4. Workaround Use {{java.sql.Date}} instead of {{java.util.Date}}

    Atlassian JIRA | 1 decade ago | Verhás István
    org.ofbiz.core.entity.GenericNotImplementedException: Java type java.util.Date not currently supported. Sorry.

    Root Cause Analysis

    1. org.ofbiz.core.entity.GenericNotImplementedException

      Java type java.util.Date not currently supported. Sorry.

      at org.ofbiz.core.entity.jdbc.SqlJdbcUtil.getType()
    2. org.ofbiz.core
      GenericValue.create
      1. org.ofbiz.core.entity.jdbc.SqlJdbcUtil.getType(SqlJdbcUtil.java:720)
      2. org.ofbiz.core.entity.jdbc.SqlJdbcUtil.setValue(SqlJdbcUtil.java:632)
      3. org.ofbiz.core.entity.jdbc.SqlJdbcUtil.setValue(SqlJdbcUtil.java:601)
      4. org.ofbiz.core.entity.jdbc.SqlJdbcUtil.setValues(SqlJdbcUtil.java:436)
      5. org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:114)
      6. org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:88)
      7. org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:63)
      8. org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:470)
      9. org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:450)
      10. org.ofbiz.core.entity.GenericValue.create(GenericValue.java:77)
      10 frames
    3. com.atlassian.core
      EntityUtils.createValue
      1. com.atlassian.core.ofbiz.util.EntityUtils.createValue(EntityUtils.java:61)
      1 frame
    4. com.atlassian.jira
      DefaultAttachmentManager.createAttachment
      1. com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:101)
      2. com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:202)
      2 frames