You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by chongma <ma...@nbmlaw.co.uk> on 2018/08/17 19:28:14 UTC

Re: Johnzon is going to infinite loop on JPA entities with OneToMany relationship

i was trying to output some JPA objects to json today.  after adding
johnzon.deduplicateObjects = true to system.properties and restarting TomEE
i still get
javax.json.stream.JsonGenerationException: Invalid json
	at
org.apache.johnzon.core.JsonGeneratorImpl.close(JsonGeneratorImpl.java:454)
	at org.apache.johnzon.mapper.Mapper.writeObject(Mapper.java:147)
	at uk.me.kissy.sales.dao.LeadScriptDao.marshall(LeadScriptDao.java:435)
is there any way to get a deeped debug?



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html

Re: Johnzon is going to infinite loop on JPA entities with OneToMany relationship

Posted by Romain Manni-Bucau <rm...@gmail.com>.
You can implement a custom converter/adapter to do that

Le ven. 17 août 2018 22:18, Matthew Broadhead
<ma...@nbmlaw.co.uk.invalid> a écrit :

> is there an annotation which will tell johnzon to return only the id of
> the jpa object and not the whole thing?
>
> On 17/08/18 22:05, Matthew Broadhead wrote:
> > no. i will add those and try again.
> >
> > i also changed the entry in system.properties to
> > org.apache.johnzon.deduplicateObjects = true to match
> > org.apache.johnzon.max-string-length = 8192
> >
> >
> > On 17/08/18 21:56, Romain Manni-Bucau wrote:
> >> Do you have a valid equals/hashcode?
> >>
> >> Le ven. 17 août 2018 21:28, chongma <ma...@nbmlaw.co.uk> a
> >> écrit :
> >>
> >>> i was trying to output some JPA objects to json today.  after adding
> >>> johnzon.deduplicateObjects = true to system.properties and
> >>> restarting TomEE
> >>> i still get
> >>> javax.json.stream.JsonGenerationException: Invalid json
> >>>          at
> >>>
> org.apache.johnzon.core.JsonGeneratorImpl.close(JsonGeneratorImpl.java:454)
> >>>
> >>>          at
> >>> org.apache.johnzon.mapper.Mapper.writeObject(Mapper.java:147)
> >>>          at
> >>> uk.me.kissy.sales.dao.LeadScriptDao.marshall(LeadScriptDao.java:435)
> >>> is there any way to get a deeped debug?
> >>>
> >>>
> >>>
> >>> --
> >>> Sent from:
> >>> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
> >>>
> >
>
>

Re: Johnzon is going to infinite loop on JPA entities with OneToMany relationship

Posted by Matthew Broadhead <ma...@nbmlaw.co.uk.INVALID>.
is there an annotation which will tell johnzon to return only the id of 
the jpa object and not the whole thing?

On 17/08/18 22:05, Matthew Broadhead wrote:
> no. i will add those and try again.
>
> i also changed the entry in system.properties to 
> org.apache.johnzon.deduplicateObjects = true to match 
> org.apache.johnzon.max-string-length = 8192
>
>
> On 17/08/18 21:56, Romain Manni-Bucau wrote:
>> Do you have a valid equals/hashcode?
>>
>> Le ven. 17 août 2018 21:28, chongma <ma...@nbmlaw.co.uk> a
>> écrit :
>>
>>> i was trying to output some JPA objects to json today.  after adding
>>> johnzon.deduplicateObjects = true to system.properties and 
>>> restarting TomEE
>>> i still get
>>> javax.json.stream.JsonGenerationException: Invalid json
>>>          at
>>> org.apache.johnzon.core.JsonGeneratorImpl.close(JsonGeneratorImpl.java:454) 
>>>
>>>          at 
>>> org.apache.johnzon.mapper.Mapper.writeObject(Mapper.java:147)
>>>          at
>>> uk.me.kissy.sales.dao.LeadScriptDao.marshall(LeadScriptDao.java:435)
>>> is there any way to get a deeped debug?
>>>
>>>
>>>
>>> -- 
>>> Sent from:
>>> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>>>
>


Re: Johnzon is going to infinite loop on JPA entities with OneToMany relationship

Posted by Matthew Broadhead <ma...@nbmlaw.co.uk.INVALID>.
no.  i will add those and try again.

i also changed the entry in system.properties to 
org.apache.johnzon.deduplicateObjects = true to match 
org.apache.johnzon.max-string-length = 8192


On 17/08/18 21:56, Romain Manni-Bucau wrote:
> Do you have a valid equals/hashcode?
>
> Le ven. 17 août 2018 21:28, chongma <ma...@nbmlaw.co.uk> a
> écrit :
>
>> i was trying to output some JPA objects to json today.  after adding
>> johnzon.deduplicateObjects = true to system.properties and restarting TomEE
>> i still get
>> javax.json.stream.JsonGenerationException: Invalid json
>>          at
>> org.apache.johnzon.core.JsonGeneratorImpl.close(JsonGeneratorImpl.java:454)
>>          at org.apache.johnzon.mapper.Mapper.writeObject(Mapper.java:147)
>>          at
>> uk.me.kissy.sales.dao.LeadScriptDao.marshall(LeadScriptDao.java:435)
>> is there any way to get a deeped debug?
>>
>>
>>
>> --
>> Sent from:
>> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>>


Re: Johnzon is going to infinite loop on JPA entities with OneToMany relationship

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Do you have a valid equals/hashcode?

Le ven. 17 août 2018 21:28, chongma <ma...@nbmlaw.co.uk> a
écrit :

> i was trying to output some JPA objects to json today.  after adding
> johnzon.deduplicateObjects = true to system.properties and restarting TomEE
> i still get
> javax.json.stream.JsonGenerationException: Invalid json
>         at
> org.apache.johnzon.core.JsonGeneratorImpl.close(JsonGeneratorImpl.java:454)
>         at org.apache.johnzon.mapper.Mapper.writeObject(Mapper.java:147)
>         at
> uk.me.kissy.sales.dao.LeadScriptDao.marshall(LeadScriptDao.java:435)
> is there any way to get a deeped debug?
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>