jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fard <maurice.f...@gmail.com>
Subject Re: Annotating a java.io.File type field in OCM
Date Fri, 14 Nov 2008 14:33:26 GMT

Hello Christophe,

As I explained the type of the field is java.lang.Object but I assigned a
String type variable to it. This variable could be any primitive type or any
type I had created. On the other hand I used @Field Converter and I got the
below error as i expected because when I use @Field Converter for a field
the type of that field should be one of Atomic Type but the type is
java.lang.Object. Is it any way that I solve my problem.

Regards
Maurice Fard

Start the tutorial ...
Insert a press release in the repository
Exception in thread "main"
org.apache.jackrabbit.ocm.exception.RepositoryException: null; nested
exception is
org.apache.jackrabbit.ocm.exception.IncorrectAtomicTypeException: No
registered converter for a field based on the class :'class
java.lang.Object'
org.apache.jackrabbit.ocm.exception.IncorrectAtomicTypeException: No
registered converter for a field based on the class :'class
java.lang.Object'
	at
org.apache.jackrabbit.ocm.manager.atomictypeconverter.impl.AtomicTypeConverterProviderImpl.getAtomicTypeConverter(AtomicTypeConverterProviderImpl.java:73)
	at
org.apache.jackrabbit.ocm.manager.objectconverter.impl.SimpleFieldsHelper.getAtomicTypeConverter(SimpleFieldsHelper.java:333)
	at
org.apache.jackrabbit.ocm.manager.objectconverter.impl.SimpleFieldsHelper.storeSimpleField(SimpleFieldsHelper.java:264)
	at
org.apache.jackrabbit.ocm.manager.objectconverter.impl.SimpleFieldsHelper.storeSimpleFields(SimpleFieldsHelper.java:230)
	at
org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:223)
	at
org.apache.jackrabbit.ocm.manager.beanconverter.impl.DefaultBeanConverterImpl.insert(DefaultBeanConverterImpl.java:53)
	at
org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insertBeanFields(ObjectConverterImpl.java:810)
	at
org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:224)
	at
org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:153)
	at
org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.insert(ObjectContentManagerImpl.java:406)
	at org.apache.jackrabbit.ocm.Main.startTutorial(Main.java:60)
	at org.apache.jackrabbit.ocm.Main.main(Main.java:134)


Christophe Lombart wrote:
> 
> Because @Bean cannot be used with primitive types (or their wrapper
> classes). You should use @Field.
> 
> 
> 
> On Thu, Nov 13, 2008 at 15:52, Fard <maurice.fard@gmail.com> wrote:
> 
>>
>> Hi Christophe,
>>
>> Thank you for replay. I have another problem that I could not solve it.
>> One
>> of my field has java.lang.Object type and I would like to map it. I
>> downloaded second tutorial code sample "How to map associations between
>> objects" and I added one field to Author class as Object type and I used
>> Bean Converter for it
>>
>>        @Bean private Object value;
>>                 { setter and getter }
>>
>> In the startTutorial method of Main class I added
>>
>>        String value = new String("This is a value for Object.");
>>        pressRelease.getAuthor().setValue(value);
>>
>> As you Know Author class is a field of PressRelease class that has the
>> Bean
>> Converter.
>>
>> I got the below error. I hope there is a solution for this problem.
>> Thanks
>> for any help.
>>
>> Regards
>> Maurice
>>
>> Start the tutorial ...
>> Insert a press release in the repository
>> Exception in thread "main"
>> org.apache.jackrabbit.ocm.exception.RepositoryException: null; nested
>> exception is
>> org.apache.jackrabbit.ocm.exception.IncorrectPersistentClassException:
>> Class
>> of type: java.lang.String has no descriptor.
>> org.apache.jackrabbit.ocm.exception.IncorrectPersistentClassException:
>> Class
>> of type: java.lang.String has no descriptor.
>>        at
>>
>> org.apache.jackrabbit.ocm.mapper.impl.AbstractMapperImpl.getClassDescriptorByClass(AbstractMapperImpl.java:203)
>>        at
>>
>> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insertBeanFields(ObjectConverterImpl.java:810)
>>        at
>>
>> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:224)
>>        at
>>
>> org.apache.jackrabbit.ocm.manager.beanconverter.impl.DefaultBeanConverterImpl.insert(DefaultBeanConverterImpl.java:53)
>>        at
>>
>> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insertBeanFields(ObjectConverterImpl.java:810)
>>        at
>>
>> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:224)
>>        at
>>
>> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:153)
>>        at
>>
>> org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.insert(ObjectContentManagerImpl.java:406)
>>        at org.apache.jackrabbit.ocm.Main.startTutorial(Main.java:60)
>>        at org.apache.jackrabbit.ocm.Main.main(Main.java:134)
>>
>>
>>
>> Christophe Lombart wrote:
>> >
>> > JCR doesn't support java.io.File but you can create a utility method to
>> > get
>> > the InputStream from a File.
>> > InputStream is supported in Jackrabbit OCM.
>> >
>> > Christophe
>> >
>> >
>> > On Thu, Nov 13, 2008 at 01:42, Fard <maurice.fard@gmail.com> wrote:
>> >
>> >>
>> >> Hello there,
>> >>
>> >> One of my filed has java.io.File type. I don't know how can I annotate
>> it
>> >> in
>> >> OCM. It is not @Field and it is not @Bean.
>> >>
>> >> Thanks for any help
>> >>
>> >> Maurice
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Annotating-a-java.io.File-type-field-in-OCM-tp20472733p20472733.html
>> >> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Annotating-a-java.io.File-type-field-in-OCM-tp20472733p20481630.html
>> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Annotating-a-java.io.File-type-field-in-OCM-tp20472733p20501582.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message