jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Mucha" <sing...@gmx.net>
Subject Re: java.lang.String has no descriptor in case of mapping a map
Date Tue, 30 Jun 2009 16:11:20 GMT
Hi Christophe ,

thanks for your reply.
I changed the type from String to a bean type.
This is ok for me in the current situation .

Thanks for your effort.
Best regards.
Andreas .

-------- Original-Nachricht --------
> Datum: Tue, 30 Jun 2009 17:21:50 +0200
> Von: Christophe Lombart <christophe.lombart@gmail.com>
> An: users@jackrabbit.apache.org
> Betreff: Re: java.lang.String has no descriptor in case of mapping a map

> By default, @Collection is not supporting maps based on <String, String>,
> the elements have to be beans based classes, not primitive types. If you
> want to use primitive types or wrapper classes, you have to use the
> collection converter "MultiValueCollectionConverterImpl".
> 
> There is a exemple in the unit test, see the classes :
> - MultiValueWithObjectCollection, this class contains a collection for
> String.
> - AnnotationMultiValueWithObjectCollectionConverterImplTest : this is the
> unit test.
> Unfortunatly, we have not unit test with Maps. We should add one.
> 
> Please, make a test with the converter "MultiValueWithObjectCollection"
> and
> let me know if it is not working with maps.
> 
> br,
> Christophe
> 
> 
> 2009/6/30 Andreas Mucha <singtur@gmx.net>
> 
> > Hello all,
> >
> > i have the following mapping problem (jackrabbit 1.5.6 , ocm 1.5.3).
> > My class contains the following map annotated as collection :
> >
> > @Node
> > public class MyClass
> > {
> >   ...
> >   @Collection private Map<String,String> amap = new
> > HashMap<String,String>();
> > }
> >
> > Inserting this via the object content mapper leads to the following
> > exception :
> >
> > 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.collectionconverter.impl.DefaultCollectionConverterImpl.doInsertCollection(DefaultCollectionConverterImpl.java:116)
> >        at
> >
> org.apache.jackrabbit.ocm.manager.collectionconverter.impl.AbstractCollectionConverterImpl.insertCollection(AbstractCollectionConverterImpl.java:80)
> >        at
> >
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insertCollectionFields(ObjectConverterImpl.java:906)
> >        at
> >
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:227)
> >        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:844)
> >        at
> >
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:226)
> >        at
> >
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:155)
> >        at
> >
> org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.insert(ObjectContentManagerImpl.java:406)
> >
> > I don't know where to configure additional mapping for java.lang.String.
> > Actually i even don't why to configure something for atomic / basic
> types.
> >
> > Can anybody help here ?
> >
> > Thanks in advance.
> > Andreas
> > --
> > Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
> > für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02
> >

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

Mime
View raw message