cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Wrong number of Arguments Error
Date Tue, 17 Jul 2007 16:09:02 GMT

My fix is committed.  

You would need to rebuild the common/common stuff.   The aegis binding 
was OK, it's just the XMLDepthStreamReader thing from common-utilities 
that it used was a problem.

Dan



On Tuesday 17 July 2007 11:52, Clough, Samuel (USPC.PRG.Atlanta) wrote:
> Wow, thanks for that.  Should I go ahead and build my own patched
> Aegis, or should I wait for you to finish your testing to make sure
> this is all we need?   What project owns the Aegis code now?
>
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Tuesday, July 17, 2007 11:47 AM
> To: cxf-user@incubator.apache.org
> Cc: Clough, Samuel (USPC.PRG.Atlanta)
> Subject: Re: Wrong number of Arguments Error
>
>
> Samuel,
>
> I managed to track this down.  It's a bug in the DepthXMLStreamReader
> that isn't getting the "END_ELEMENT" events lined up correctly in the
> Aegis binding.    Thus, while reading the first object, it's sucking
> in all the rest of the data so it doesn't deserialize the second
> parameter.
>
> It then tries to invoke your method with only one parameter.
>
> I'm testing a fix now.    It's a very simple fix.  Change the
> getElementText() method to look like:
>
>     public String getElementText() throws XMLStreamException {
>         String ret = reader.getElementText();
>         depth--;
>         return ret;
>     }
>
> According to the spec, the getElementText() method consumes the
> characters and end events and leaves it in the "end" position.   This.
> takes care of keeping the depth correct.
>
> In anycase, this probably affects Aegis really badly.  Not sure how
> much
>
> of anything in Aegis has worked.
>
> Dan
>
> On Tuesday 17 July 2007 08:46, Clough, Samuel (USPC.PRG.Atlanta) wrote:
> > Every time I send this with a code zip attached it is bounced as
> > spam, so I'll try to send you the code zip offline.
> >
> > This is a java first case.  What we are doing is hooking up
> > applications that are completely internal, so the wsdl is not so
> > much of a concern per se for this application because there are no
> > outside consumers. We're simply trying to connect a few applications
> > in a loosely coupled way.
> >
> > Any help would be GREATLY appreciated as I was in the middle of the
> > Xfire learning curve and decided to switch to CXF for the future
> > growth and I'm a little lost and this error is so vague I can't get
> > anything on it and google hasn't helped much.   We're firing up the
> > service using these calls:
> >
> > AegisDatabinding binding = new AegisDatabinding();
> > DefaultTypeMappingRegistry tmr =
> > 	(DefaultTypeMappingRegistry) binding.getTypeMappingRegistry();
> > Configuration config = tmr.getConfiguration();
> > config.setDefaultMinOccurs(1);
> > config.setDefaultNillable(false);
> > sf.getServiceFactory().setDataBinding(binding);
> > sf.setServiceBean(serviceBean);
> > sf.setServiceClass(serviceClass);
> > sf.setAddress("http://localhost:8192/omnitranmanager/2007/07/OmniTra
> >nS er vice");
> > sf.create();
> >
> > The stack trace:
> >
> > INFO: Interceptor has thrown exception, unwinding now
> > org.apache.cxf.interceptor.Fault: wrong number of arguments
> >         at
> > org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoke
> >r. ja va:88)
> >         at
> > org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoke
> >r. ja va:56)
> >         at
> > org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceIn
> >vo ke rInterceptor.java:56)
> >         at
> > org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExec
> >ut or .java:37)
> >         at
> > org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(S
> >er vi ceInvokerInterceptor.java:87)
> >         at
> > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercep
> >to rC hain.java:206)
> >         at
> > org.apache.cxf.transport.MultipleEndpointObserver.onMessage(Multiple
> >En dp ointObserver.java:82)
> >         at
> > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequ
> >es t( JettyHTTPDestination.java:253)
> >         at
> > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(J
> >et ty HTTPDestination.java:213)
> >         at
> > org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTT
> >PH an dler.java:54)
> >         at
> > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
> >71 2) at
> > org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHan
> >dl er Collection.java:211)
> >         at
> > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
> >13 9) at org.mortbay.jetty.Server.handle(Server.java:285)
> >         at
> > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:5
> >02 ) at
> > org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnecti
> >on .j ava:835)
> >         at
> > org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:641) at
> > org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:202)
> >         at
> > org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)
> >         at
> > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.j
> >av a: 368)
> >         at
> > org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPoo
> >l. ja va:442)
> > Caused by: java.lang.IllegalArgumentException: wrong number of
> > arguments at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method) at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
> >.j av a:39)
> >         at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
> >ss or Impl.java:25)
> >         at java.lang.reflect.Method.invoke(Method.java:585)
> >         at
> > org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoke
> >r. ja va:69)
> >
> > -----Original Message-----
> > From: Daniel Kulp [mailto:dkulp@apache.org]
> > Sent: Monday, July 16, 2007 4:23 PM
> > To: cxf-user@incubator.apache.org
> > Subject: Re: Wrong number of Arguments Error
> >
> >
> > Is this a "java first" case or a "wsdl first" case?   Are there
> > headers or soap w/ attachments involved?   Also, is it a "wrapped"
> > doc/lit, "bare" doc/lit, or rpc/lit?
> >
> > If it's a java first case with a wrapped doc/lit endpoint, can you
> > try running java2wsdl with the "-s dir" flags to generate the
> > wrapper types.
> >
> > That SHOULD work better.
> >
> > Is there anyway you can send along the wsdl and the service
> > interface/class?   (You can send to me privately if that's
> > preferred)
> >
> > If I can get a reproduceable test case, it should be much easier to
> > debug.
> >
> > Dan
> >
> > On Monday 16 July 2007 15:56, Clough, Samuel (USPC.PRG.Atlanta) 
wrote:
> > > I'm looking for any help I can get on debugging a "wrong number of
> > > arguments error."  I'm getting from a cxf service hosted via the
> > > embedded Jetty server.  We just started a new project and used
> > > XFire for the web services and then ripped it out and put in CXF
> > > and don't have much experience with either so I'm definitely on
> > > the wrong end of the learning curve.  Anyway, for one service that
> > > takes an simple object as a parameter is constantly throwing
> > > "wrong number of arguments"  The stack track points all the way
> > > down the Sun reflection calls.  I've tried stripping out the
> > > boolean and Date properties until I'm left with just 7 String
> > > properties and I'm still getting the error every time the service
> > > is called.  Does anyone have any idea how I can debug this
> > > further?  I just can't find what is causing the problem and I've
> > > spent about 7 hours on this now.  Other calls on the same service
> > > class work fine and if I strip the parameter class down to just
> > > one or two string properties it works.  Any help would be greatly
> > > appreciated!
> > > --------------------------------------------------------

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Mime
View raw message