をデバッグすることができJAXBとJavaオブジェクトにXMLをマーシャリング解除するとき、私はエラーを持っている:はどのように私はこのNullPointerExceptionが
java.lang.NullPointerException
at com.sun.xml.internal.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$1.parse(RuntimeBuiltinLeafInfoImpl.java:188)
at com.sun.xml.internal.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$1.parse(RuntimeBuiltinLeafInfoImpl.java:186)
at com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.parse(TransducedAccessor.java:230)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(LeafPropertyLoader.java:50)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.text(UnmarshallingContext.java:483)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.InterningXmlVisitor.text(InterningXmlVisitor.java:78)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.handleCharacters(StAXEventConnector.java:173)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.bridge(StAXEventConnector.java:127)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:392)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:368)
どのように私は原因を見つけることができますか?
いくつかの詳細は:私が解析しようとしているXMLの
一部は次のとおりです。
<member_resources>
<__field_location__>
<directive>
sun-sat
</directive>
<file>
null
</file>
<line>
0
</line>
</__field_location__>
<sun-sat>
00:00-24:00 tester2
</sun-sat>
<__field_location__>
<directive>
isLine
</directive>
<file>
null
</file>
<line>
0
</line>
</__field_location__>
<isLine>
true
</isLine>
</member_resources>
私が手にこれを原因となったイベントで停止する場合:まあ
next event <__field_location__>
next event <directive>
next event sun-sat
next event <file>
next event null
どのIDEを使用していますか? EclipseまたはNetbeansの場合は、デバッガを使用できます。 – talnicolas
コードを記入してください。 –
問題が見つかりました: 私は自分自身のXMLイベントを非マーシャルに使用しています。 keyが 'null'の場合には' new CharactersImpl(key) 'というコードでこの例外が発生します。 – oshai