juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Russell <apache....@gmail.com>
Subject Re: Apache Juneau question
Date Fri, 13 Oct 2017 12:45:29 GMT
Hi,

Can you use the SerializerContext.SERIALIZER_detectRecursions setting to help locate the loop?


Post the results back to this list and we can help you figure it out.

Regards,

Craig

> On Oct 13, 2017, at 5:08 AM, 曾瑞林 <hidder1984@gmail.com> wrote:
> 
> Hi ,
> 
> First of all, please forgive my poor Engish.
> 
> I created a sample microservice project based my-microservice-6.4.0-incubating, everything
is fine on my mac laptop, but i got a StackOverflowError exception when i copy the packaged
jar(flat) to a window machine, attached the sourcecode.
> 
> The exception stack as following:
> 
> Exception in thread "main" java.lang.RuntimeException: org.apache.juneau.serializer.SerializeException:
Stack overflow occurred.  This can occur when trying to serialize models containing loops.
 It's recommended you use the SerializerContext.SERIALIZER_detectRecursions setting to help
locate the loop.
>         at org.apache.juneau.serializer.WriterSerializer.toString(WriterSerializer.java:91)
>         at org.apache.juneau.internal.StringUtils.convertToReadable(StringUtils.java:1630)
>         at org.apache.juneau.internal.StringUtils.format(StringUtils.java:1619)
>         at org.apache.juneau.FormattedRuntimeException.<init>(FormattedRuntimeException.java:33)
>         at org.apache.juneau.microservice.RestMicroservice.createServer(RestMicroservice.java:312)
>         at org.apache.juneau.microservice.RestMicroservice.start(RestMicroservice.java:126)
>         at org.apache.juneau.microservice.RestMicroservice.main(RestMicroservice.java:99)
> Caused by: org.apache.juneau.serializer.SerializeException: Stack overflow occurred.
 This can occur when trying to serialize models containing loops.  It's recommended you use
the SerializerContext.SERIALIZER_detectRecursions setting to help locate the loop.
>         at org.apache.juneau.serializer.SerializerSession.serialize(SerializerSession.java:236)
>         at org.apache.juneau.serializer.WriterSerializerSession.serialize(WriterSerializerSession.java:76)
>         at org.apache.juneau.serializer.WriterSerializer.serialize(WriterSerializer.java:75)
>         at org.apache.juneau.serializer.WriterSerializer.toString(WriterSerializer.java:89)
>         ... 6 more
> Caused by: java.lang.StackOverflowError
>         at java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync.readerShouldBlock(Unknown
Source)
>         at java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryAcquireShared(Unknown
Source)
>         at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(Unknown
Source)
>         at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(Unknown Source)
>         at org.apache.juneau.ClassMeta.waitForInit(ClassMeta.java:199)
>         at org.apache.juneau.BeanContext.getClassMeta(BeanContext.java:1236)
>         at org.apache.juneau.BeanContext.getClassMeta(BeanContext.java:1199)
>         at org.apache.juneau.BeanContext.getClassMetaForObject(BeanContext.java:1467)
>         at org.apache.juneau.internal.StringUtils.convertToReadable(StringUtils.java:1628)
>         at org.apache.juneau.internal.StringUtils.format(StringUtils.java:1619)
>         at org.apache.juneau.FormattedRuntimeException.<init>(FormattedRuntimeException.java:33)
>         at org.apache.juneau.BeanRuntimeException.<init>(BeanRuntimeException.java:49)
>         at org.apache.juneau.BeanPropertyMeta.get(BeanPropertyMeta.java:460)
>         at org.apache.juneau.BeanMap.getValues(BeanMap.java:463)
>         at org.apache.juneau.json.JsonSerializerSession.serializeBeanMap(JsonSerializerSession.java:191)
>         at org.apache.juneau.json.JsonSerializerSession.serializeAnything(JsonSerializerSession.java:124)
>         at org.apache.juneau.json.JsonSerializerSession.serializeBeanMap(JsonSerializerSession.java:208)
>         at org.apache.juneau.json.JsonSerializerSession.serializeAnything(JsonSerializerSession.java:124)
>         at org.apache.juneau.json.JsonSerializerSession.serializeBeanMap(JsonSerializerSession.java:208)
>         at org.apache.juneau.json.JsonSerializerSession.serializeAnything(JsonSerializerSession.java:124)
>         at org.apache.juneau.json.JsonSerializerSession.serializeBeanMap(JsonSerializerSession.java:208)
>         at org.apache.juneau.json.JsonSerializerSession.serializeAnything(JsonSerializerSession.java:124)
>         at org.apache.juneau.json.JsonSerializerSession.serializeBeanMap(JsonSerializerSession.java:208)
> 
> 
> 
> -- 
> Best Regards
> Ruilin Zeng
> 
> <soucecode.zip>

Craig L Russell
clr@apache.org


Mime
View raw message