cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: JiBX databinding implementation
Date Tue, 25 May 2010 20:04:48 GMT
On Friday 21 May 2010 8:57:32 pm Nilupa Bandara wrote:
> Hello Everyone,
> 
> The code that I've written so far is available at[1], [2] and it for simple
> data types. I've used the Axis2 JiBX implementation as guide and now I am
> working on implementing the complex data type support.
> 
> However there seems to be an error when we present the XMLSteramReader
> obtained form CXF runtime to JiBX UnmashallingContext which needs work on
> process a part of an XML document not as a whole. However when we present
> an XMLStreamRead from which it can read the desired element as a whole
> document it seems to work.[4]. I suspect this is a bug in JiBX framework
> and I am willing to hear expert advice on this.

Not really sure what to suggest on this.   I know with XMLBeans in JAX-RS, we 
did have some issues if the XMLStreamReader wasn't positioned exactly where it 
wanted to be.   I think XMLBeans didn't want the start doc events or something 
so had to make sure it was "next" beyond that.     I would try fiddling with 
the stream reader in your standalone "full document" case to see if you can 
get it the same state as CXF presents it to see if that reproduces it and then 
kind of reverse you changes to see what may be doable to fix how CXF calls 
into JiBX.

Dan


> 
> Any suggestions, advice and tips will be much appreciated !!
> 
> 
> Thanks & Regards,
> Nilupa
> 
> [1] http://github.com/nilupa/cxf
> 
> [2] http://github.com/nilupa/cxf/tree/trunk/rt/databinding/jibx/
> 
> [3] Error output:
> 
> ava.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:18
> 2) at
> org.jibx.runtime.impl.UnmarshallingContext.accumulateText(UnmarshallingCont
> ext.java:840) at
> org.jibx.runtime.impl.UnmarshallingContext.parseContentText(UnmarshallingCo
> ntext.java:874) at
> org.jibx.runtime.impl.UnmarshallingContext.parseElementText(UnmarshallingCo
> ntext.java:936) at
> org.apache.xcf.jibx.JibxDataReader.read(JibxDataReader.java:57) at
> org.apache.xcf.jibx.JibxDataReader.read(JibxDataReader.java:1)
> at
> org.apache.cxf.interceptor.DocLiteralInInterceptor.getPara(DocLiteralInInte
> rceptor.java:251) at
> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteral
> InInterceptor.java:127) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
> n.java:243) at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationO
> bserver.java:110) at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(Jet
> tyHTTPDestination.java:313) at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTT
> PDestination.java:277) at
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandle
> r.java:70) at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCol
> lection.java:230) at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:326)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java
> :930) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
> at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409
> ) at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:58
> 2)
> 
> [4] Work around JibxDataReader.java : line 90
> 
>         try {
>             reader =
> StaxUtils.createXMLStreamReader(StaxUtils.read(reader));
>         } catch (Exception e) {
>             throw new RuntimeException(e);
>         }
> 
> 
> 
> 
> On Fri, Apr 30, 2010 at 11:30 AM, Nilupa Bandara
> <nilupa.manamperi@gmail.com
> 
> > wrote:
> > 
> > Hi,
> > 
> > At the moment, I am running the sample Web services in debug mode just to
> > get a deeper understanding of how the cxf data
> > 
> >  binding architecture works at runtime. I am also planning to look at how
> > 
> > its done for Axis2 and perhaps we might be able to reuse some of that
> > code there. As soon as I have something concrete, will post it to this
> > mailing list.
> > 
> > Thanks & Best Regards,
> > Nilupa
> > 
> > On Fri, Apr 30, 2010 at 2:00 AM, Dennis Sosnoski <dms@sosnoski.com> wrote:
> >> I'm curious how the JiBX databinding GSoC project is progressing...
> >> anything to discuss yet?
> >> 
> >> JiBX is pretty flexible in how it reads and writes XML, with its own
> >> org.jibx.runtime.IXMLReader and IXMLWriter interfaces used to decouple
> >> from the details of the parser and writer. Implementations of these
> >> interfaces are supplied for working with StAX XMLStreamReader and
> >> XMLStreamWriter, and the existing Axis2 support for JiBX should be a
> >> good guide for fitting the actual runtime hooks together.
> >> 
> >> Just to make sure I understand how this works, JAX-WS configuration can
> >> be used with any type of org.apache.cxf.databinding.DataBinding
> >> implementation, right? So someone wanting to use JiBX with a JAX-WS
> >> frontend would just need to specify this using their preferred
> >> configuration technique (such as cxf-client.xml on the client side).
> >> 
> >> Thanks,
> >> 
> >>  - Dennis

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

Mime
View raw message