You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Vassilis Virvilis <v....@biovista.com> on 2008/12/18 17:18:52 UTC

problem using jaxws and cxf 2.1.3

Hi everybody,

I have a terrible problem trying to make jaxws annotations to work. Some background:
I am deploying wars in tomcat in debian stable using cxf 2.1.3 and java 1.5.x

The same service works like a charm if deployed with the simple frontend. Unfortunately we now require proper argument names instead of arg0, arg1 to be visible in the wsdl. So I am trying to deploy the class as a jaxws service.

The first problem is that my FOOService becomes FOOServiceService if I don't specify the serviceName in the SEI but maybe this is intentional.

Then i am getting an exception if I try to call a method with parameters. This happens also from a java client (simple frontend) and from soappy (python).

If I remove the WebParam annotation the java client works but soappy gives the same error.

So is this a problem in my end?

Please help I am desperate....

-------------------------------------

The steps I followed:

I annotated the SEI

package com.xxx.iface.FOOService

@WebService(serviceName="FOOService")
public interface FOOService {
    public String[] getBibliography(@WebParam(name="name") String name, @WebParam(name="type") String type, @WebParam(name="max_results") int max_results
    //public String[] getBibliography(String name, String type, int max_results);

    public String[] getAvailableTypes();
}

I annotated the implementation

package com.xxx.impl.FOOService

@WebService
public class FOOService implements com.xxx.iface.FOOService {
....
    public String[] getBibliography(String name, String type, int max_results){
	...
    }
}

I use the following configuration
        <bean id="FOOService" class="com.xxx.impl.FOOService">
        </bean>

        <jaxws:endpoint id="FOO" implementor="#FOOService" implementorClass="com.xxx.FOOService" address="/FOOService">
                <jaxws:serviceFactory>
                        <ref FOOn="jaxws-and-aegis-service-factory" />
                </jaxws:serviceFactory>
        </jaxws:endpoint>


and I get the following exception in my tomcat

INFO: Application has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: null while invoking public abstract java.lang.String[] com.xxx.iface.FOOService.getBibliography(java.lang.String,java.lang.String,int) with params [null, null, null].
        at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:121)
        at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:83)
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:113)
        at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:54)
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:68)
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56)
        at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:92)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)
        at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:92)
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:285)
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:168)
        at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:175)
        at org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:153)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
        at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
        at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
        at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:177)
        at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalArgumentException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:136)
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:82)
        ... 41 more
Dec 18, 2008 5:54:34 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept


Re: problem using jaxws and cxf 2.1.3

Posted by Vassilis Virvilis <v....@biovista.com>.
Benson thanks for the advise

On Thursday 18 December 2008, Benson Margulies wrote:
> FooServiceService is as per the JAX-WS specification.

Ah ok then.

> 
> Have you looked at the XML with logging or a spy? Most likely, the
> client isn't playing along with the parameter names. With the simple
> front end / Aegis, you must tell it to ingest the WSDL to get those
> parameter names. Does soap-py know how to read a WSDL?
> 

Nope the spy thing it's a little bit over my head.

Basically in soapy all you have to do is

from SOAPpy import SOAPProxy

bea_service = SOAPProxy("http://localhost/ws/FOOService")

#print bea_service.getBibliography("x1", "x2", 10)
print bea_service.getAvailableTypes()

The getAvailablesTypes since it has no parameters it works!
The getBibliography gives the error I send in the previous mail.

> You would probably be happier using .aegis.xml files to name the
> parameters instead of JAX-WS.
> 

Yes I am now :-). Thanks a bunch for the suggestion.

I took me however a lot of time googling for that since the documentation was not clear cut. What I did was:

  *** Howto to change a method's parameter name from arg0 to something meaningful with aegis.xml ***
<mappings>
  <mapping>
    <method name="getBibliography">
      <parameter index="0" mappedName="name"/>
      <parameter index="1" mappedName="type"/>
      <parameter index="2" mappedName="max_results"/>
    </method>
  </mapping>
</mappings>

      .bill

Re: problem using jaxws and cxf 2.1.3

Posted by Benson Margulies <bi...@gmail.com>.
FooServiceService is as per the JAX-WS specification.

Have you looked at the XML with logging or a spy? Most likely, the
client isn't playing along with the parameter names. With the simple
front end / Aegis, you must tell it to ingest the WSDL to get those
parameter names. Does soap-py know how to read a WSDL?

You would probably be happier using .aegis.xml files to name the
parameters instead of JAX-WS.


On Thu, Dec 18, 2008 at 11:18 AM, Vassilis Virvilis
<v....@biovista.com> wrote:
> Hi everybody,
>
> I have a terrible problem trying to make jaxws annotations to work. Some background:
> I am deploying wars in tomcat in debian stable using cxf 2.1.3 and java 1.5.x
>
> The same service works like a charm if deployed with the simple frontend. Unfortunately we now require proper argument names instead of arg0, arg1 to be visible in the wsdl. So I am trying to deploy the class as a jaxws service.
>
> The first problem is that my FOOService becomes FOOServiceService if I don't specify the serviceName in the SEI but maybe this is intentional.
>
> Then i am getting an exception if I try to call a method with parameters. This happens also from a java client (simple frontend) and from soappy (python).
>
> If I remove the WebParam annotation the java client works but soappy gives the same error.
>
> So is this a problem in my end?
>
> Please help I am desperate....
>
> -------------------------------------
>
> The steps I followed:
>
> I annotated the SEI
>
> package com.xxx.iface.FOOService
>
> @WebService(serviceName="FOOService")
> public interface FOOService {
>    public String[] getBibliography(@WebParam(name="name") String name, @WebParam(name="type") String type, @WebParam(name="max_results") int max_results
>    //public String[] getBibliography(String name, String type, int max_results);
>
>    public String[] getAvailableTypes();
> }
>
> I annotated the implementation
>
> package com.xxx.impl.FOOService
>
> @WebService
> public class FOOService implements com.xxx.iface.FOOService {
> ....
>    public String[] getBibliography(String name, String type, int max_results){
>        ...
>    }
> }
>
> I use the following configuration
>        <bean id="FOOService" class="com.xxx.impl.FOOService">
>        </bean>
>
>        <jaxws:endpoint id="FOO" implementor="#FOOService" implementorClass="com.xxx.FOOService" address="/FOOService">
>                <jaxws:serviceFactory>
>                        <ref FOOn="jaxws-and-aegis-service-factory" />
>                </jaxws:serviceFactory>
>        </jaxws:endpoint>
>
>
> and I get the following exception in my tomcat
>
> INFO: Application has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: null while invoking public abstract java.lang.String[] com.xxx.iface.FOOService.getBibliography(java.lang.String,java.lang.String,int) with params [null, null, null].
>        at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:121)
>        at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:83)
>        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:113)
>        at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:54)
>        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:68)
>        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56)
>        at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
>        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:92)
>        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
>        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)
>        at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:92)
>        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:285)
>        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:168)
>        at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:175)
>        at org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:153)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
>        at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
>        at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
>        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
>        at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:177)
>        at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
>        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
>        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
>        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
>        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
>        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
>        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>        at java.lang.Thread.run(Thread.java:595)
> Caused by: java.lang.IllegalArgumentException
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:136)
>        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:82)
>        ... 41 more
> Dec 18, 2008 5:54:34 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
>
>

Re: problem using jaxws and cxf 2.1.3

Posted by Julio Oliveira <ju...@gmail.com>.
Hi
1. Go to "http://fusesource.com"   then download and install " fuse Service
framework based in CXF"
2. Install and go to samples
3. There is a lot of examples
4. I try a lot of it, but the best i have working fine for  XML or JSON
response is "
.... \fuse-services-framework-2.1.3.1\samples\jax_rs\content_negotiation\"

Install it in Eclipse compile and run with ant, the you have a client and a
server example, put time to do it, and see   XML 500 ms  JSON 40 ms.

I normally use some interface to manage  the json data. ( AJAX approach for
WEB 2.0 )


On Fri, Dec 19, 2008 at 11:15 AM, Benson Margulies <bi...@gmail.com>wrote:

> Java does not store parameter names in the class file for an
> interface. Thus, you must either use .aegis.xml (for Simple/Aegis) or
> the WSDL (for Aegis or JAXWS/JAXB). We can't do it by magic.
>
> On Fri, Dec 19, 2008 at 9:07 AM, Vassilis Virvilis
> <v....@biovista.com> wrote:
> > On Thursday 18 December 2008, Daniel Kulp wrote:
> >>
> >> Try adding more information to the @WebService annotations on BOTH the
> SEI
> >> interface and the impl.  In particular, make sure there are
> targetNamespace
> >> attributes on both.   Also, make sure the endpointInterface attribute is
> >> specified on the impl.
> >>
> >> Dan
> >
> > HiDan,
> >
> > Thanks for the suggestion but this is really painful for me right now
> since I can't really guess correctly most of the values required.
> >
> > I really think annotating so hard is painfull and duplicating a lot of
> info but that's my just opinion and I am not really knowledgable in web
> services.
> >
> > Quick question: Isn't it possible for aegis to guess the parameter names?
> Is that because it looks in the interface and not in the implementing class?
> Couldn't java introspection help in this case?
> >
> > Thanks a lot anyway
> >
> >  .bill
> >
>



-- 
Saludos

Julio Oliveira - Buenos Aires

julio.julioOliveira@gmail.com

http://www.linkedin.com/in/juliomoliveira

Re: problem using jaxws and cxf 2.1.3

Posted by Julio Oliveira <ju...@gmail.com>.
Hi
1. Go to "http://fusesource.com"   then download and install " fuse Service
framework based in CXF"
2. Install and go to samples
3. There is a lot of examples
4. I try a lot of it, but the best i have working fine for  XML or JSON
response is "
.... \fuse-services-framework-2.1.3.1\samples\jax_rs\content_negotiation\"

Install it in Eclipse compile and run with ant, the you have a client and a
server example, put time to do it, and see   XML 500 ms  JSON 40 ms.

I normally use some interface to manage  the json data. ( AJAX approach for
WEB 2.0 )

Interface: (Response with a head and a body elements).
If u Accept  XML, can use xstream to convert it to java object on the fly,
but is more expensive in time, than JSON.
If u Accept default JSON, u have a String information, u can split with ":"
.
Then using StringTokenized u can have all the data in less time.

Remember to use String type for all data.

In the server side response head,  put the name of the bean u must use to
instance the data, and how many data beans u will receive.
This is a convention between the server and the client.  ( First part of the
response are a head info, and the other the body info ).
Also you can use the same approach from the client side, to send the server
a parameter code.
This parameter code is the type of data the server will put in the response.

I'm working with the example above if u need i can send next week.
My idea is to connect to java applications with this approach, and use for
all the WS only one type of Message Protocol:

Request:

Head -> parameters that inform:  (JSON  fixed quantity of elements )
-  the type of process the client need  (client and server know the codes)
-  the type of data a send to be processed by the server ( Value Object  -
VO)
-  how many VO the client send
-  a check sum for control ( any u like )

Body -> the data itself (JSON VO as be defined in the head parameters )

-------------------------------------------------------------

Response:

The same idea, more info off course ( error message, etc )

Head -> parameters that inform how is sending the body:

Body -> the data as is defined in the head
------------------------------------------------------------

If u use XML  use fixed name tags:

Head ->  H_1, H_2,.... H_n

Body ->  V_1, V_2....n

-------------------------------------------------------------

regards


On Fri, Dec 19, 2008 at 11:15 AM, Benson Margulies <bi...@gmail.com>wrote:

> Java does not store parameter names in the class file for an
> interface. Thus, you must either use .aegis.xml (for Simple/Aegis) or
> the WSDL (for Aegis or JAXWS/JAXB). We can't do it by magic.
>
> On Fri, Dec 19, 2008 at 9:07 AM, Vassilis Virvilis
> <v....@biovista.com> wrote:
> > On Thursday 18 December 2008, Daniel Kulp wrote:
> >>
> >> Try adding more information to the @WebService annotations on BOTH the
> SEI
> >> interface and the impl.  In particular, make sure there are
> targetNamespace
> >> attributes on both.   Also, make sure the endpointInterface attribute is
> >> specified on the impl.
> >>
> >> Dan
> >
> > HiDan,
> >
> > Thanks for the suggestion but this is really painful for me right now
> since I can't really guess correctly most of the values required.
> >
> > I really think annotating so hard is painfull and duplicating a lot of
> info but that's my just opinion and I am not really knowledgable in web
> services.
> >
> > Quick question: Isn't it possible for aegis to guess the parameter names?
> Is that because it looks in the interface and not in the implementing class?
> Couldn't java introspection help in this case?
> >
> > Thanks a lot anyway
> >
> >  .bill
> >
>



-- 
Saludos

Julio Oliveira - Buenos Aires

julio.julioOliveira@gmail.com

http://www.linkedin.com/in/juliomoliveira

Re: problem using jaxws and cxf 2.1.3

Posted by Benson Margulies <bi...@gmail.com>.
Java does not store parameter names in the class file for an
interface. Thus, you must either use .aegis.xml (for Simple/Aegis) or
the WSDL (for Aegis or JAXWS/JAXB). We can't do it by magic.

On Fri, Dec 19, 2008 at 9:07 AM, Vassilis Virvilis
<v....@biovista.com> wrote:
> On Thursday 18 December 2008, Daniel Kulp wrote:
>>
>> Try adding more information to the @WebService annotations on BOTH the SEI
>> interface and the impl.  In particular, make sure there are targetNamespace
>> attributes on both.   Also, make sure the endpointInterface attribute is
>> specified on the impl.
>>
>> Dan
>
> HiDan,
>
> Thanks for the suggestion but this is really painful for me right now since I can't really guess correctly most of the values required.
>
> I really think annotating so hard is painfull and duplicating a lot of info but that's my just opinion and I am not really knowledgable in web services.
>
> Quick question: Isn't it possible for aegis to guess the parameter names? Is that because it looks in the interface and not in the implementing class? Couldn't java introspection help in this case?
>
> Thanks a lot anyway
>
>  .bill
>

Re: problem using jaxws and cxf 2.1.3

Posted by Vassilis Virvilis <v....@biovista.com>.
On Thursday 18 December 2008, Daniel Kulp wrote:
> 
> Try adding more information to the @WebService annotations on BOTH the SEI 
> interface and the impl.  In particular, make sure there are targetNamespace 
> attributes on both.   Also, make sure the endpointInterface attribute is 
> specified on the impl.   
> 
> Dan

HiDan,

Thanks for the suggestion but this is really painful for me right now since I can't really guess correctly most of the values required.

I really think annotating so hard is painfull and duplicating a lot of info but that's my just opinion and I am not really knowledgable in web services.

Quick question: Isn't it possible for aegis to guess the parameter names? Is that because it looks in the interface and not in the implementing class? Couldn't java introspection help in this case?

Thanks a lot anyway

 .bill

Re: problem using jaxws and cxf 2.1.3

Posted by Daniel Kulp <dk...@apache.org>.
Try adding more information to the @WebService annotations on BOTH the SEI 
interface and the impl.  In particular, make sure there are targetNamespace 
attributes on both.   Also, make sure the endpointInterface attribute is 
specified on the impl.   

Dan

On Thursday 18 December 2008 11:18:52 am Vassilis Virvilis wrote:
> Hi everybody,
>
> I have a terrible problem trying to make jaxws annotations to work. Some
> background: I am deploying wars in tomcat in debian stable using cxf 2.1.3
> and java 1.5.x
>
> The same service works like a charm if deployed with the simple frontend.
> Unfortunately we now require proper argument names instead of arg0, arg1 to
> be visible in the wsdl. So I am trying to deploy the class as a jaxws
> service.
>
> The first problem is that my FOOService becomes FOOServiceService if I
> don't specify the serviceName in the SEI but maybe this is intentional.
>
> Then i am getting an exception if I try to call a method with parameters.
> This happens also from a java client (simple frontend) and from soappy
> (python).
>
> If I remove the WebParam annotation the java client works but soappy gives
> the same error.
>
> So is this a problem in my end?
>
> Please help I am desperate....
>
> -------------------------------------
>
> The steps I followed:
>
> I annotated the SEI
>
> package com.xxx.iface.FOOService
>
> @WebService(serviceName="FOOService")
> public interface FOOService {
>     public String[] getBibliography(@WebParam(name="name") String name,
> @WebParam(name="type") String type, @WebParam(name="max_results") int
> max_results //public String[] getBibliography(String name, String type, int
> max_results);
>
>     public String[] getAvailableTypes();
> }
>
> I annotated the implementation
>
> package com.xxx.impl.FOOService
>
> @WebService
> public class FOOService implements com.xxx.iface.FOOService {
> ....
>     public String[] getBibliography(String name, String type, int
> max_results){ ...
>     }
> }
>
> I use the following configuration
>         <bean id="FOOService" class="com.xxx.impl.FOOService">
>         </bean>
>
>         <jaxws:endpoint id="FOO" implementor="#FOOService"
> implementorClass="com.xxx.FOOService" address="/FOOService">
> <jaxws:serviceFactory>
>                         <ref FOOn="jaxws-and-aegis-service-factory" />
>                 </jaxws:serviceFactory>
>         </jaxws:endpoint>
>
>
> and I get the following exception in my tomcat
>
> INFO: Application has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: null while invoking public abstract
> java.lang.String[]
> com.xxx.iface.FOOService.getBibliography(java.lang.String,java.lang.String,
>int) with params [null, null, null]. at
> org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.
>java:121) at
> org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMe
>thodInvoker.java:83) at
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:
>113) at
> org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:54)
> at
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:
>68) at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerIn
>terceptor.java:56) at
> org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.ja
>va:37) at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceI
>nvokerInterceptor.java:92) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
>n.java:220) at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationO
>bserver.java:78) at
> org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestinati
>on.java:92) at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(Servle
>tController.java:285) at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController
>.java:168) at
> org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServl
>et.java:175) at
> org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServl
>et.java:153) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
>9) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>l.java:25) at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243) at
> java.security.AccessController.doPrivileged(Native Method) at
> javax.security.auth.Subject.doAsPrivileged(Subject.java:517) at
> org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275) at
> org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:1
>61) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio
>nFilterChain.java:245) at
> org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterC
>hain.java:177) at
> org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChai
>n.java:156) at java.security.AccessController.doPrivileged(Native Method) at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
>hain.java:152) at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j
>ava:213) at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j
>ava:178) at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:12
>6) at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:10
>5) at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav
>a:107) at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199) at
> org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282) at
> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767) at
> org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697
>) at
> org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.jav
>a:889) at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.ja
>va:684) at java.lang.Thread.run(Thread.java:595)
> Caused by: java.lang.IllegalArgumentException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
>9) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>l.java:25) at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractIn
>voker.java:136) at
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:
>82) ... 41 more
> Dec 18, 2008 5:54:34 PM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept



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