jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ryanv78727 <rvanderw...@gmail.com>
Subject OCM: For some reason the ObjectConverterImpl thinks by Date is a collection
Date Fri, 17 Oct 2008 15:23:43 GMT

Hi, I am running OCM 1.4 - I am having a strange problem where my bean field
of type java.util.Date is being interpreted as a collection, resulting in a
JcrMappingException: Unsupported collection type error. I have stepped
through the debugger, and

by the time it gets here:
>private void insertCollectionFields(Session session, Object object,
ClassDescriptor classDescriptor, Node >objectNode) {
>		Iterator collectionDescriptorIterator =

The date is already in the collection descriptors. I'm assuming this should
not be here  at this point. I've tried to specify via annotation the Object
converter class, however it has no effect. 

Have I run into a bug? I have a collection in another field, and it seems to
be getting confused and putting my date objects in there when I try to do an
insert. Everything seemed fine until I tried to add the date fields. However
it seems it -should- work, as the OCM 5' example shows them being used.

Here is the stack trace:
org.apache.jackrabbit.ocm.exception.JcrMappingException: Unsupported
collection type :java.util.Date

my bean:
@Node(jcrMixinTypes = "mix:referenceable,mix:versionable,mix:lockable")
public class MediaFile extends BaseNode {
    @Field(path=true) String path;
    @Field(uuid = true) String uuid;
    @Field String fileName;
    @Field String title;
    @Field String abstractText;
    @Field int statusId;
    @Field String mimeType;
    @Field int displayOrder;
    @Field boolean requiresCaptcha;
    @Field int termsAndConditionsId;
    @Field String tcInternalName;
    @Field int oldDocId;
    @Field Date createdDate;
    @Field Date updatedDate;
    @Field int updatedBy;
    @Field int createdBy;
    @Field int relatedNodeCount;
    @Collection(elementClassName=Integer.class, collectionConverter =
MultiValueCollectionConverterImpl.class, jcrType = "Integer")
java.util.Collection<Integer> roleIds;

class being extended:
@Node(jcrMixinTypes = "mix:referenceable,mix:versionable")
public class BaseNode {
    String nodeType;
    @Field(converter = ObjectConverter.class) Date createdDate;
    @Field(converter = ObjectConverter.class) Date updatedDate;
    @Field(uuid = true)
    String uuid;
    @Field(path = true)
    String path;
    int updatedBy;
    int createdBy;
    int relatedNodeCount;

View this message in context: http://www.nabble.com/OCM%3A-For-some-reason-the-ObjectConverterImpl-thinks-by-Date-is-a-collection-tp20035446p20035446.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

View raw message