XWiki:导入XAR时的StackOverflowError

时间:2016-09-30 12:47:04

标签: xwiki

我将xwiki更新为版本8.2.1。之后,每次尝试上传XAR时都会收到StackOverflowError。有谁知道这是从哪里来的?

    14:39:05.955 [https://localhost/ xwiki /bin/get/XWiki/XWikiPreferences?xpage=packagedescriptor&package=org.xwiki.platform_xwiki-platform-administration-ui-8.2.1.xar] ERROR org.xwiki.velocity.tools.JSONTool - Failed to serialize object to JSON
com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: java.util.UnmodifiableList[0]->org.xwiki.model.reference.EntityReference["reversedReferenceChain"]->java.util.UnmodifiableList[0]->org.xwiki.model.reference.EntityReference["reversedReferenceChain"]->java.util.UnmodifiableList[0]->org.xwiki.model.reference.EntityReference["reversedReferenceChain"]->java.util.UnmodifiableList[0]->org.xwiki.model.reference.EntityReference["reversedReferenceChain"]->java.util.UnmodifiableList[0]->org.xwiki.model.reference.EntityReference["reversedReferenceChain"]->java.util.UnmodifiableList[0]->org.xwiki.model.reference.EntityReference["reversedReferenceChain"]->[…]) 
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:677) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:156) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:132) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:94) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:24) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:575) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:663) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:156) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:132) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:94) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:24) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:575) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:663) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:156) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:132) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:94) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:24) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:575) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:663) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:156) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:132) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:94) ~[jackson-databind-2.5.0.jar:2.5.0]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:24) ~[jackson-databind-2.5.0.jar:2.5.0]
[…]

14:39:05.968 [https://localhost/xwiki/bin/get/XWiki/XWikiPreferences?xpage=packagedescriptor&package=org.xwiki.platform_xwiki-platform-administration-ui-8.2.1.xar] DEBUG o.x.v.internal.DefaultVelocityEngine - Null reference [template '76:/templates/packagedescriptor.vm', line 36, column 4] : $jsontool.serialize($json) cannot be resolved.

1 个答案:

答案 0 :(得分:1)

此错误似乎表明您的Jackson版本比XWiki WAR中应该提供的版本更旧。一个不支持@Transient,用于跳过EntityReference的序列化#getReversedReferenceChain()。

也许您的应用程序服务器带有旧版本的Jackson,您需要正确隔离XWiki。