I'd suspect the encoding doesn't have anything to do with your problem.
From the backtrace on the NullPointerException it looks like one of the
(non-optional) fields you're using for text values has a null. I don't
know how this could happen, though, unless you're modifying the document
after it was unmarshalled (if you're missing a required value when you
unmarshal it should throw an exception immediately). Does that help?
- Dennis
Chris Huisman wrote:
Hello,
I am getting the following issue when trying to marshal a document:
java.lang.NullPointerException
at
org.jibx.runtime.impl.ISO88591StreamWriter.writeTextContent(ISO88591StreamWriter.java:215)
at
org.jibx.runtime.impl.MarshallingContext.element(MarshallingContext.java:650)
at
com.taylor.qseries.client.framework.data.Operation.JiBX_qSeriesDataBinding_marshal_4_0(Unknown
Source)
at
com.taylor.qseries.client.framework.JiBX_MungeAdapter.JiBX_qSeriesDataBinding_marshal_1_2()
at
com.taylor.qseries.client.framework.data.Order.JiBX_qSeriesDataBinding_marshal_2_0(Unknown
Source)
at
com.taylor.qseries.client.framework.JiBX_MungeAdapter.JiBX_qSeriesDataBinding_marshal_1_3()
at
com.taylor.qseries.client.framework.Orders.JiBX_qSeriesDataBinding_marshal_2_0(Unknown
Source)
at
com.taylor.qseries.client.framework.JiBX_qSeriesDataBindingOrders_access.marshal()
at com.taylor.qseries.client.framework.Orders.marshal(Unknown Source)
at
org.jibx.runtime.impl.MarshallingContext.marshalRoot(MarshallingContext.java:919)
at
org.jibx.runtime.impl.MarshallingContext.marshalDocument(MarshallingContext.java:967)
at
com.taylor.qseries.client.framework.TestJibx.main(TestJibx.java:268)
Exception in thread "main"
I am using beta 3c, on a windows machine. I am able to unmarshal the
document without any issues.
The call that produces the error is:
marshallingContext.marshalDocument(Orders.getInstance(), "ISO-8859-1",
null, new FileOutputStream("testOrders.xml"));
It also happens when I use UTF-8 for the encoding.
Here is a snippet of the offending xml:
<order id="1">
<number>101</number>
<routingId>1</routingId>
<quantity>100</quantity>
<operation id="1">
<number>1</number>
<stepId>1</stepId>
<startTime>02/09/2004 08:00:00</startTime>
<quantity>10</quantity>
<productionUpdate>
<percentage>0</percentage>
<date>02/09/2004 08:00:00</date>
</productionUpdate>
<machineId>10</machineId>
</operation>
<operation id="2">
<number>2</number>
<stepId>2</stepId>
<startTime>03/09/2004 08:00:00</startTime>
<quantity>20</quantity>
<productionUpdate>
<percentage>1</percentage>
<date>03/09/2004 08:00:00</date>
</productionUpdate>
<machineId>11</machineId>
</operation>
...
</order>
</order>
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users