On Friday 25 June 2010 12:44:49 pm Dennis Sosnoski wrote:
> Hi Nilupa,
> 
> Looking at the stack trace, I'm wondering how you're passing the
> XMLStreamReader to JiBX. The way the code is set up, you need to create
> the StAXReaderWrapper *before* you reach the start tag of the element
> that's going to be processed by JiBX (so in the case of processing a
> SOAP message body, you'd need to do this while the XMLStreamReader is
> positioned on the Body start tag). If you create the StAXReaderWrapper
> when you're already positioned at the start tag of the element it looks
> like it would cause this problem when you reach the end tag.

Hmm..   that's likely going to be a problem if we do the full "use wrappers" 
approach.   We need to get the element nam to be able figure out the operation 
name and map that to the right class to use and such. Thus, by the time the 
databinding gets it, it would be positioned AT the start element, not before 
it.

Dan


 > If you can't take this approach with CXF I can change the
> StAXReaderWrapper to give you a workaround. It should be enough to just
> make the startTag() method public, so that after constructing the
> StAXReaderWrapper you call this method to initialize the state for the
> current element start tag.
> 
>   - Dennis
> 
> Nilupa Bandara wrote:
> > Hi,
> > 
> > I'm getting the following error (for both the simple types case and
> > complex types case) when I feed the XMLStreamReader to Unmarshalling
> > context without the following workaround[2]. It seems that the problem
> > occurs when the XMLStreamReader is used by JiBX framework to access an
> > element which a part of a larger element or document. I found something
> > similar has been reported[3]. Is this the same issue or is it different
> > ? Any suggestions on what the solution should be ?
> > 
> > Thanks in advance !!
> > Nilupa
> > 
> > 
> > [1]
> > java.lang.ArrayIndexOutOfBoundsException: Attempt to peek past end of
> > stack at org.jibx.runtime.IntStack.peek(IntStack.java:231)
> > at org.jibx.runtime.IntStack.peek(IntStack.java:245)
> > at
> > org.jibx.runtime.impl.StAXReaderWrapper.endTag(StAXReaderWrapper.java:159
> > ) at
> > org.jibx.runtime.impl.StAXReaderWrapper.nextToken(StAXReaderWrapper.java:
> > 182) at
> > org.jibx.runtime.impl.UnmarshallingContext.parseContentText(Unmarshalling
> > Context.java:880) at
> > org.jibx.runtime.impl.UnmarshallingContext.parseElementText(Unmarshalling
> > Context.java:955) at
> > com.sosnoski.ws.library.types.BookInformation.JiBX_binding_unmarshal_1_0(
> > BookInformation.java) at
> > com.sosnoski.ws.library.types.JiBX_bindingBookInformation_access2.unmarsh
> > al() at
> > org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unmarshalling
> > Context.java:2732) at
> > org.apache.xcf.jibx.JibxDataReader.read(JibxDataReader.java:61) at
> > org.apache.xcf.jibx.JibxDataReader.read(JibxDataReader.java:1) at
> > org.apache.cxf.interceptor.DocLiteralInInterceptor.getPara(DocLiteralInIn
> > terceptor.java:251) at
> > org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiter
> > alInInterceptor.java:127) at
> > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCh
> > ain.java:243) at
> > org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiatio
> > nObserver.java:110) at
> > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(J
> > ettyHTTPDestination.java:313) at
> > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyH
> > TTPDestination.java:277) at
> > org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHand
> > ler.java:70)
> > 
> > [2]
> > Document element = StaxUtils.read(reader);
> > reader = StaxUtils.createXMLStreamReader(element);
> > 
> > [3] http://www.mail-archive.com/u...@xfire.codehaus.org/msg00447.html

-- 
Daniel Kulp
dk...@apache.org
http://dankulp.com/blog

Reply via email to