java – jibx:缺少必需的对象异常
作者:互联网
我正在使用JiBX来编组一些类.它运行良好,直到我得到一个IllegalStateException
java.lang.IllegalStateException: Missing required object
at org.jibx.runtime.impl.MarshallingContext.pushObject(MarshallingContext.java:1181)
at com.dreipplus.profiler.importer.binding.trans.JiBX_binding0MungeAdapter.JiBX_binding0_marshalAttr_1_18()
at com.dreipplus.profiler.importer.binding.trans.JiBX_binding0RoomProductVO_access.marshal()
at com.dreipplus.profiler.importer.binding.trans.LibRoomObjectImport.JiBX_binding0_marshal_3_0(LibRoomObjectImport.java)
at com.dreipplus.profiler.importer.binding.trans.JiBX_binding0LibRoomObjectImport_access.marshal()
at com.dreipplus.profiler.importer.binding.trans.LibRoomObjectImport.marshal(LibRoomObjectImport.java)
at com.dreipplus.profiler.importer.binding.trans.JiBX_binding0MungeAdapter.JiBX_binding0_marshal_1_3()
at com.dreipplus.profiler.importer.binding.trans.LibraryImport.JiBX_binding0_marshal_2_0(LibraryImport.java)
at com.dreipplus.profiler.importer.binding.trans.JiBX_binding0LibraryImport_access.marshal()
at com.dreipplus.profiler.importer.binding.trans.LibraryImport.marshal(LibraryImport.java)
at com.dreipplus.profiler.importer.binding.trans.JiBX_binding0MungeAdapter.JiBX_binding0_marshal_1_0()
at com.dreipplus.profiler.importer.binding.trans.Libraries.JiBX_binding0_marshal_2_0(Libraries.java)
at com.dreipplus.profiler.importer.binding.trans.JiBX_binding0Libraries_access.marshal()
at com.dreipplus.profiler.importer.binding.trans.Libraries.marshal(Libraries.java)
at org.jibx.runtime.impl.MarshallingContext.marshalRoot(MarshallingContext.java:1021)
at org.jibx.runtime.impl.MarshallingContext.marshalDocument(MarshallingContext.java:1083)
at com.dreipplus.profiler.library.LibraryTest.testExportLibrary(LibraryTest.java:186)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:70)
xml输出停在另一个(更远)位置(可能它没有被刷新):
...
<objectsmaterial>
<material>
<name>
<localizedtext size="1">
<entry key="de_AT">Furnier Kanadische Ahorn</entry>
</localizedtext>
</name>
<longtext>
<localizedtext size="1">
<entry key="de_AT">
[EOF]
使用=“可选”未设置是否有问题? JiBX期待一个领域不存在吗?我在JiBX上缺少调试输出,但这已经被报告为他们的JIRA中的错误.
如果有人知道什么是错的,或者我怎么能弄清楚什么是错的,拜托!
这是我的binding0.xml binding0.xml pastebin
提前致谢
Florian Huber
解决方法:
如果字段为空,则IllegalArgumentException会出现,如果它具有(XML-)Subelements.
我仔细检查了代码,然后发现了这个错误.
标签:java,xml,jibx 来源: https://codeday.me/bug/20190521/1147644.html