isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GESCONSULTOR - Óscar Bou <o....@gesconsultor.com>
Subject Re: Unable to re-create a view model
Date Mon, 09 Feb 2015 14:48:42 GMT
Hi all.

One of the properties is another View Model.



> El 9/2/2015, a las 15:40, Martin Grigorov <mgrigorov@apache.org> escribió:
> 
> On Mon, Feb 9, 2015 at 4:35 PM, Dan Haywood <dan@haywood-associates.co.uk>
> wrote:
> 
>> My guess, then, is that the @ViewModel isn't handling references to other
>> view models.  I suspect that anything that isn't a simple value (int,
>> string, date etc) is being processed as an entity, and a bookmark is being
>> created for it.  But on rehydration this bookmark is converted to an oid
>> and then being (incorrectly) given to the JDO object store.
>> 
> 
> This is correct!
> I've seen in the stacktrace a code that looks up: propertyId + ".bookmark".
> 
> 
>> 
>> If I'm right, hopefully is fixable.  Feel free to take a look in the
>> ViewModelFacet implementations, see what you can make of it.
>> 
>> The workaround is for the view model object to explicitly implement
>> ViewModel, and return a memento; ie handle the viewmodel -> viewmodel
>> reference manually.
>> 
>> HTH
>> Dan
>> 
>> 
>> On 9 February 2015 at 14:30, Martin Grigorov <mgrigorov@apache.org> wrote:
>> 
>>> Hi Dan,
>>> 
>>> The commit was a minor optimization.
>>> The problem is still there.
>>> 
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>> 
>>> On Mon, Feb 9, 2015 at 4:20 PM, Dan Haywood <
>> dan@haywood-associates.co.uk>
>>> wrote:
>>> 
>>>> Hi Martin,
>>>> 
>>>> I saw a commit from you on JdoObjectIdSerializer following on from this
>>>> mail, so did you sort out the issue (or do I need to take a look
>>> tonight?)
>>>> 
>>>> Cheers
>>>> Dan
>>>> 
>>>> 
>>>> On 9 February 2015 at 08:17, Martin Grigorov <mgrigorov@apache.org>
>>> wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> What could be the reason a ViewModel cannot be recreated with the
>>>> exception
>>>>> below ?
>>>>> Looking
>>>>> at
>>>>> 
>>>> 
>>> 
>> org.apache.isis.objectstore.jdo.datanucleus.persistence.spi.JdoObjectIdSerializer#toJdoObjectId()
>>>>> it tries to find '_' separator and use the string before it to decide
>>>> what
>>>>> class to load (byte, int, UUID, ...).
>>>>> 
>>>>> In my case the ViewModel extends from an abstract ViewModel. The
>> parent
>>>> one
>>>>> is annotated with @ViewModel and the child one with
>>> @DomainObject(nature
>>>> =
>>>>> Nature.VIEW_MODEL).
>>>>> I've tried different combinations with the annotations but it always
>>>> leads
>>>>> to this exception.
>>>>> 
>>>>> Caused by:
>>>>> org.apache.isis.core.runtime.persistence.PojoRecreationException:
>> Could
>>>> not
>>>>> recreate pojo for oid oid
>>>>> 
>>>>> 
>>>> 
>>> 
>> KIVM:PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPG1lbWVudG8-PGtpdC5ib29rbWFyaz5LSVRfOkxfMTwva2l0LmJvb2ttYXJrPjxpbnB1dEVsZW1lbnQuYm9va21hcms-SU5IRVJJVEVEX0NPTkRJVElPTjpMXzE0MzwvaW5wdXRFbGVtZW50LmJvb2ttYXJrPjwvbWVtZW50bz4=
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.runtime.persistence.adaptermanager.AdapterManagerDefault.adapterFor(AdapterManagerDefault.java:320)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.runtime.persistence.adaptermanager.AdapterManagerDefault.adapterFor(AdapterManagerDefault.java:305)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.runtime.persistence.container.DomainObjectContainerResolve.adapterFor(DomainObjectContainerResolve.java:104)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.runtime.persistence.container.DomainObjectContainerResolve.lookup(DomainObjectContainerResolve.java:55)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession$7.lookup(RuntimeContextFromSession.java:211)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.metamodel.services.bookmarks.BookmarkServiceDefault.lookup(BookmarkServiceDefault.java:59)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.metamodel.facets.object.recreatable.RecreatableObjectFacetDeclarativeAbstract.initialize(RecreatableObjectFacetDeclarativeAbstract.java:89)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.runtime.persistence.adaptermanager.PojoRecreatorDefault.recreatePojo(PojoRecreatorDefault.java:49)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.runtime.persistence.adaptermanager.PojoRecreatorForDataNucleus.recreatePojo(PojoRecreatorForDataNucleus.java:34)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.runtime.persistence.adaptermanager.PojoRecreatorUnified.recreatePojo(PojoRecreatorUnified.java:38)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.runtime.persistence.adaptermanager.AdapterManagerDefault.adapterFor(AdapterManagerDefault.java:317)
>>>>> ... 54 more
>>>>> Caused by: java.lang.StringIndexOutOfBoundsException: String index
>> out
>>> of
>>>>> range: -1
>>>>> at java.lang.String.substring(String.java:1958)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.objectstore.jdo.datanucleus.persistence.spi.JdoObjectIdSerializer.toJdoObjectId(JdoObjectIdSerializer.java:112)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusObjectStore.loadPojo(DataNucleusObjectStore.java:410)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.runtime.persistence.adaptermanager.PojoRecreatorForDataNucleus.recreatePojo(PojoRecreatorForDataNucleus.java:36)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.runtime.persistence.adaptermanager.PojoRecreatorUnified.recreatePojo(PojoRecreatorUnified.java:38)
>>>>> at
>>>>> 
>>>>> 
>>>> 
>>> 
>> org.apache.isis.core.runtime.persistence.adaptermanager.AdapterManagerDefault.adapterFor(AdapterManagerDefault.java:317)
>>>>> ... 64 more
>>>>> 
>>>>> Martin Grigorov
>>>>> Wicket Training and Consulting
>>>>> https://twitter.com/mtgrigorov
>>>>> 
>>>> 
>>> 
>> 


Óscar Bou Bou
Responsable de Producto
Auditor Jefe de Certificación ISO 27001 en BSI
CISA, CRISC, APMG ISO 20000, ITIL-F

   902 900 231 / 620 267 520
   http://www.twitter.com/oscarbou <http://www.twitter.com/oscarbou>

   http://es.linkedin.com/in/oscarbou <http://es.linkedin.com/in/oscarbou>

   http://www.GesConsultor.com <http://www.gesconsultor.com/> 




Este mensaje y los ficheros anexos son confidenciales. Los mismos contienen información reservada
que no puede ser difundida. Si usted ha recibido este correo por error, tenga la amabilidad
de eliminarlo de su sistema y avisar al remitente mediante reenvío a su dirección electrónica;
no deberá copiar el mensaje ni divulgar su contenido a ninguna persona.
Su dirección de correo electrónico junto a sus datos personales constan en un fichero titularidad
de Gesdatos Software, S.L. cuya finalidad es la de mantener el contacto con Ud. Si quiere
saber de qué información disponemos de Ud., modificarla, y en su caso, cancelarla, puede
hacerlo enviando un escrito al efecto, acompañado de una fotocopia de su D.N.I. a la siguiente
dirección: Gesdatos Software, S.L. , Paseo de la Castellana, 153 bajo - 28046 (Madrid), y
Avda. Cortes Valencianas num. 50, 1ºC - 46015 (Valencia). Asimismo, es su responsabilidad
comprobar que este mensaje o sus archivos adjuntos no contengan virus informáticos, y en
caso que los tuvieran eliminarlos.






Mime
View raw message