Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如果对象中的项太多,JAXB编组对象会截断结果字符串_Jaxb_Marshalling_Truncated - Fatal编程技术网

如果对象中的项太多,JAXB编组对象会截断结果字符串

如果对象中的项太多,JAXB编组对象会截断结果字符串,jaxb,marshalling,truncated,Jaxb,Marshalling,Truncated,我目前有: JAXBContext jaxbContext = JAXBContext.newInstance(javaObject.getClass()); Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); StringWriter strin

我目前有:

JAXBContext jaxbContext = JAXBContext.newInstance(javaObject.getClass());
        Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
        jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
        StringWriter stringWriter = new StringWriter();
        jaxbMarshaller.marshal(javaObject, stringWriter);
        String xml = stringWriter.toString();
该对象包含数据对象的列表。只要数据对象列表少于17项,我就会得到完整的xml响应。一旦我有了更多,xml就会被截断。它不会抛出错误。xml字符串的末尾只有“…”

<DataDetailObject xmlns:xsi="...

..
可能是调试器或查看器的行为,您正使用该调试器或查看器对
字符串进行内省。如果您将其写入
System.out
中,您应该可以看到一切都正常工作。

您在哪里看到结尾处带有
的值?您是在调试器中检查
字符串
,还是将其写入System.out?我没有想到通过System.out输入字符串。在我这样做之后,我发现它工作正常。我当时发现的是一个行为不端的安全模块。元帅没有问题。谢谢你的时间,我已经把我的评论变成了一个答案。