Re: groovy/grails, CXF and generated classes
Hi, It may relate to the Xerces Implementation. CXF can work with xecesImpl 2.8.1 , please make sure this jar is in your class path. Willem. jwagon wrote: > > I'm trying to get a simple service client running against the following > WSDL: > > > I used SoapUI 1.7.6 to generate the service classes, one of which is this: > > @WebServiceClient(name = "api", targetNamespace = > "http://api.bronto.com";, wsdlLocation = > "http://api.bronto.com/?q=mail_3&wsdl";) > public class Api extends Service { > > private final static URL WSDL_LOCATION; > private final static QName SERVICE = new > QName("http://api.bronto.com";, "api"); > private final static QName ApiPort = new > QName("http://api.bronto.com";, "apiPort"); > static { > URL url = null; > try { > url = new URL("http://api.bronto.com/?q=mail_3&wsdl";); > } catch (MalformedURLException e) { > System.err.println("Can not initialize the default wsdl > from http://api.bronto.com/?q=mail_3&wsdl";); > // e.printStackTrace(); > } > WSDL_LOCATION = url; > } > > public Api(URL wsdlLocation, QName serviceName) { > super(wsdlLocation, serviceName); > } > > public Api() { > super(WSDL_LOCATION, SERVICE); > } > > /** > * > * @return > * returns ApiPort > */ > @WebEndpoint(name = "apiPort") > public ApiPortType getApiPort() { > return (ApiPortType)super.getPort(ApiPort, ApiPortType.class); > } > > } > > But when I execute the following code in a brand new Grails app > (Grails 0.6, Groovy 1.1b): > > I get the error below. Not even where to start looking to solve this > one (except Google, which I already tried). Any suggestions? > > org.codehaus.groovy.runtime.InvokerInvocationException: > java.lang.RuntimeException: > org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in > class path resource [META-INF/cxf/cxf.xml]: Instantiation of bean > failed; nested exception is > org.springframework.beans.BeanInstantiationException: Could not > instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: > Constructor threw exception; nested exception is > java.lang.ClassCastException: > org.apache.xerces.jaxp.DocumentBuilderFactoryImpl > at > org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:64) > at > org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) > at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) > at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) > at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531) > at groovy.lang.Closure.call(Closure.java:290) > at groovy.lang.Closure.call(Closure.java:285) > at > org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:526) > at > org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:385) > at > org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:240) > at > org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:152) > at > org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88) > at > org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45) > at > org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:241) > at > org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755) > at > org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396) > at > org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > > -- View this message in context: http://www.nabble.com/groovy-grails%2C-CXF-and-generated-classes-tf4700854.html#a13449798 Sent from the cxf-user mailing list archive at Nabble.com.
Re: Client can't receive the message due to read timed out
Yes , You can specify which client's connection time out parameter that you want to overwrite by using the Service's Port Name. And please make sure you do not use the wild card in the http-conf:[EMAIL PROTECTED] attribute. You can refer this[1] for more information. [1]http://cwiki.apache.org/CXF20DOC/client-http-transport.html Willem. MtnAlps wrote: > > Hi Willem, > If a client needs to connect to two web services, how to set the > connection time out paramters for the client to connect to the two web > services? > > In the client configuration file, the attribute of name in the second > element overwrites the first one. Is it > possible to configure a client connection time out parameters to multiple > web services? > Thanks > -Minsheng > > > > MtnAlps wrote: >> >> Hi Willem, >> Thank you so much for the info!!! The issue is fixed. We just migrated >> from XFire 1.2.6 to CXF 2.0.2. A lot of issues we had with XFire 1.2.6 >> are gone. >> Thanks! >> -Miknsheng >> >> >> Willem2 wrote: >>> >>> Hi , >>> >>> FYI, you can find the how to set the timeout parameters here [1] >>> [1] http://cwiki.apache.org/CXF20DOC/client-http-transport.html >>> >>> >>> Willem. >>> Glen Mazza wrote: I'm not sure how to adjust the timeout parameters--someone else can perhaps respond to that issue. But how long should it take your server to respond? Can you greatly simplify your server so it responds immediately (basically just mock it out so it immediately returns something), to confirm that the 60-second timeout is the real problem (as opposed to the client simply not being able to access the server)? The error you're getting: "Caused by: org.apache.cxf.interceptor.Fault: Could not send Message." normally occurs to me when the server is inaccessible for some reason, it can't be reached at all--not just a time-out issue. Are you sure the URL in the WSDL (which I assume your client is reading) is correct? If you call http://localhost:8080/mywarfilename/myservice?wsdl, for example, do you see the WSDL file in the browser? HTH, Glen Am Sonntag, den 21.10.2007, 19:15 -0600 schrieb Shen, Minsheng (MinSheng): > Hi All, > I am new to this mail list. > I am developing a web service using CXF 2.0.2. Everything is tested > and > works fine on the service side. I used wsdl2java to create a client. > When I invoke the client, I got "Interceptor has thrown exception, > unwinding now > org.apache.cxf.interceptor.Fault: Could not send Message." > > I believe on the client side the default time out for reading message > is > 60 seconds and this error is caused by read time out. The following is > the stacktrace. Any help you can provide will be greatly appreciated!! > Thank you in advance! > > -Minsheng > > INFO: Interceptor has thrown exception, unwinding now > > > org.apache.cxf.interceptor.Fault: Could not send Message. > > > Caused by: java.net.SocketTimeoutException: Read timed out > > >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/Client-can%27t-receive-the-message-due-to-read-timed-out-tf4668231.html#a13449273 Sent from the cxf-user mailing list archive at Nabble.com.
Re: Spring Client http-conf ReceiveTimeout error
Hi, This is a bug of CXF configuration which can't consumer the configuration file at the same time with client beans creating. You can get more information here[1]. It was fixed by DanKulp few weeks ago, and it is in the latest CXF2.0.3 SNAPSHOT now. http://issues.apache.org/jira/browse/CXF-922 Willem. Sric wrote: > > I have deployed a Spring/CXF JAX-WS soap service using CXF 2.0. In order > to fix the issue #922 with the spring client, I have modified the client > to run with a snapshot build and updated dependencies. I specify the > http:conduit-client receive timeout to be 90 secs. > http://www.springframework.org/schema/beans"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"; > xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration > http://cxf.apache.org/schemas/configuration/http-conf.xsd > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans.xsd";> > > > resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/> > resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml" /> > resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" /> > > >name="{http://myservice.services.fm.com/}MyServicePort.http-conduit";> > > > > class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean"> > value="com.fm.services.MyService"/> > value="http://myhost:8080/myservice/services/soap/myservice/"/> > > >factory-bean="sClientFactory" factory-method="create"/> > > > > > I can verify from printing out the 'HTTPClientPolicy.getReceiveTimeout()' > that the value of 9 is sticking unlike with the 2.0 version, however > my client still timesout after exactly 30 secs. Is there any other changes > I need to make to override the default recieve timeout in the client? Any > clues what might be causing this discrepancy? I now see the following > errors from my client: > > Oct 26, 2007 2:08:08 PM org.apache.cxf.phase.PhaseInterceptorChain > doIntercept > INFO: Interceptor has thrown exception, unwinding now > org.apache.cxf.interceptor.Fault: Connection refused: connect > at > org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writePar > ts(AbstractOutDatabindingInterceptor.java:75) > at > org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutIn > terceptor.java:68) > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept > orChain.java:207) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205) > at > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) > at > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134) > > -- View this message in context: http://www.nabble.com/Spring-Client-http-conf-ReceiveTimeout-error-tf4699812.html#a13449133 Sent from the cxf-user mailing list archive at Nabble.com.