Hi All,
I answer by myself.
Even if I don't really know why, removing following lines from my
services configuration is fixing the issue (services are visible and are
running perfectly):
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<cxf:bus>
<cxf:features>
<cxf:logging/>
</cxf:features>
</cxf:bus>
Any idea why these lines are preventing web services to be usable while
no error message is issued?
Regards.
Johann
Spam a écrit :
> Hi All,
>
> I've followed the guidelines from
> "http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html" to
> configure my web services inside Tomcat 6.0.
>
> If I use the following configuration, everything in the cxf (log4j) log
> file looks like the services are deployed successfully, but checking
> with "http://localhost:8080/myWebApp/services/" results in "No services
> have been found.".
>
> <bean id="WSUserServicePortType"
> class="be.eft.cbkv3.ws.WSUserServicePortTypeImpl">
> </bean>
> <jaxws:endpoint id="WSUserServicePortTypeEndpoint"
> implementor="#WSUserServicePortType"
> address="/WS_UserService.srv">
> <jaxws:binding>
> <soap:soapBinding mtomEnabled="true" version="1.2"/>
> </jaxws:binding>
> </jaxws:endpoint>
>
> <bean id="WSClaimServicePortType"
> class="be.eft.cbkv3.ws.WSClaimServicePortTypeImpl">
> </bean>
> <jaxws:endpoint id="WSClaimServicePortTypeEndpoint"
> implementor="#WSClaimServicePortType"
> address="/WS_ClaimService.srv">
> <jaxws:binding>
> <soap:soapBinding mtomEnabled="true" version="1.2"/>
> </jaxws:binding>
> </jaxws:endpoint>
>
> I changed configuration in that way (not using implementor but
> implementorClass only):
> <jaxws:endpoint id="WSUserServicePortTypeEndpoint"
>
> implementorClass="be.eft.cbkv3.ws.WSUserServicePortTypeImpl"
> address="/WS_UserService.srv">
> <jaxws:binding>
> <soap:soapBinding mtomEnabled="true" version="1.2"/>
> </jaxws:binding>
> </jaxws:endpoint>
>
> <jaxws:endpoint id="WSClaimServicePortTypeEndpoint"
>
> implementorClass="be.eft.cbkv3.ws.WSClaimServicePortTypeImpl"
> address="/WS_ClaimService.srv">
> <jaxws:binding>
> <soap:soapBinding mtomEnabled="true" version="1.2"/>
> </jaxws:binding>
> </jaxws:endpoint>
> Then I get on "http://localhost:8080/myWebApp/services/" (looks good,
> isn't it?):
> Available SOAP services:
> WSClaimServicePortType
> * getClaim
> * identify
>
> WSUserServicePortType
> * openSession
> * identify
> * closeSession
> But when I try to use the Web Services by running the WS consumers, I
> get this error (in tomcat log):
> 02 Oct 2009 at 18.06.57,929 WARN
> (SessionId=,org.apache.cxf.common.logging.LogUtils,345,http-8080-1) []
> Application has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: object is not an instance of declaring
> class while invoking public java.lang.String
> myPackage.ws.WSUserServicePortTypeImpl.openSession(java.lang.String,java.lang.String,java.lang.Short,java.lang.String)
> throws myPackage.ws.LoginException_Exception with params [login,
> password, 0, localhost].
> at
> org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:152)
> at
> org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:83)
> at
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:126)
> at
> org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:55)
> at
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:68)
> at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at
> org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
> at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:98)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)
> at
> org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99)
> at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:452)
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:196)
> at
> org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:220)
> at
> org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:153)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
> at
> org.apache.cxf.transport.servlet.AbstractCXFServlet.service(AbstractCXFServlet.java:211)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.IllegalArgumentException: object is not an instance
> of declaring class
> 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:597)
> at
> org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:166)
> at
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:82)
> ... 29 more
>
> I wonder what is wrong in my configuration?
>
> I've tested using "jaxws:server" and I have same issue: the web services
> looks like deployed in the log but access to
> "http://localhost:8080/myWebApp/services/" results in "No services have
> been found.".
>
> By the way, my tests based on Simple Frontend are working well:
>
> <simple:server id="cxf.wsUserService"
> serviceClass="myPackage.ws.interfaces.WSUserService"
> address="/WS_UserService.srv">
> <simple:serviceBean>
> <bean id="server.wsUserService"
> class="myPackage.ws.impl.WSUserServiceImpl">
> <property name="businessFacade" ref="businessFacade"/>
> </bean>
> </simple:serviceBean>
> </simple:server>
>
> <simple:server id="cxf.wsClaimService"
> serviceClass="myPackage.ws.interfaces.WSClaimService"
> address="/WS_ClaimService.srv">
> <simple:serviceBean>
> <bean id="server.wsClaimService"
> class="myPackage.ws.impl.WSClaimServiceImpl">
> <property name="businessFacade" ref="businessFacade"/>
> </bean>
> </simple:serviceBean>
> </simple:server>
>
> Any help would be greatly appreciated.
>
> Regards.
> Johann
>
>
>