Issue Type: Bug Bug
Affects Versions: JiBX 1.2.4
Assignee: Unassigned
Components: core
Created: 08/Oct/12 11:23 AM
Description:

It's very easy to reproduce

  • Create custom stream writer (MyWriter) extends UTF8StreamWriter
  • set it to context (ctx.setXmlWriter(new MyWriter())

in the snippet of the MarshallingContext class we can see that if the writer instance of UTF8StreamWriter the m_byteBuffer variable is not initialized and because it's private effectively the JIBX developer can't control it

if ("UTF-8".equalsIgnoreCase(enc)) {

// handle UTF-8 output to stream directly
if (!(m_writer instanceof UTF8StreamWriter)) {
if (m_byteBuffer == null) { m_byteBuffer = new OutByteBuffer(); }
UTF8StreamWriter wrtr = new UTF8StreamWriter(m_uris);
m_writer = wrtr;
wrtr.setBuffer(m_byteBuffer);
wrtr.setIndentSpaces(m_indentCount, m_newLine,
m_indentChar);
}
reset();
m_byteBuffer.setOutput(outs);

java.lang.NullPointerException
at org.jibx.runtime.impl.MarshallingContext.setOutput(MarshallingContext.java:240)
at org.jibx.runtime.impl.MarshallingContext.startDocument(MarshallingContext.java:459)
at org.springframework.oxm.jibx.JibxMarshaller.marshalOutputStream(JibxMarshaller.java:254)
at org.springframework.oxm.support.AbstractMarshaller.marshalStreamResult(AbstractMarshaller.java:267)
at org.springframework.oxm.support.AbstractMarshaller.marshal(AbstractMarshaller.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy48.marshal(Unknown Source)
at com.espacenet.ops.webservice.endpoints.marshalling.jibx.OpsOpdMarshallerSelector.marshal(OpsOpdMarshallerSelector.java:33)
at com.espacenet.ops.webservice.rest.internal.provider.jibx.JibxWorldPatentDataWriter.writeTo(JibxWorldPatentDataWriter.java:70)
at org.jboss.resteasy.core.interception.MessageBodyWriterContextImpl.proceed(MessageBodyWriterContextImpl.java:117)
at org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor.write(GZIPEncodingInterceptor.java:48)
at org.jboss.resteasy.core.interception.MessageBodyWriterContextImpl.proceed(MessageBodyWriterContextImpl.java:123)
at org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:186)
... 49 more

Project: JiBX
Priority: Critical Critical
Reporter: Alex Khval
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to