buildServiceFromWSDL - long processing
Hi In my WAR file I have Spring configuration file which defines collection (about 10) of endpoints (). In every endpoint there is wsdlLocation attribute which defines path to WSDL file. Unfortunately it takes about 3 minutes to publish all my services. I suppose that the same wsdl file (which is quite complex) is parsed as many times as number of endpoints. Is there any option to make this process faster, eg. if every time it is the same file? Thanks -- Best Regards, Krystian Lider
Re: buildServiceFromWSDL - long processing
Hi Krystian, Is there only one wsdl that contains all the endpoints information. CXF did not cache the wsdl information for the endpoints , it will build all service model from the wsdl and then look up a right definition for the publishing endpoint each time. So it takes 10 times time to reparse the quite complex wsdl . I think you can broke down you wsdl for each endpoint ,or you can try the build service from class you just do not specify the wsdlLocation attribute to walk around that. And for CXF, we need to find a way to cache the built up service model for the endpoint somewhere. Cheers, Willem. Krystian Lider wrote: Hi In my WAR file I have Spring configuration file which defines collection (about 10) of endpoints (). In every endpoint there is wsdlLocation attribute which defines path to WSDL file. Unfortunately it takes about 3 minutes to publish all my services. I suppose that the same wsdl file (which is quite complex) is parsed as many times as number of endpoints. Is there any option to make this process faster, eg. if every time it is the same file? Thanks
Re: buildServiceFromWSDL - long processing
Hi Willem Thank you for the replay. Please see my comments below. On 6/5/2007 8:42 AM,User Willem Jiang wrote: Hi Krystian, Is there only one wsdl that contains all the endpoints information. In that specific situation yes CXF did not cache the wsdl information for the endpoints , it will build all service model from the wsdl and then look up a right definition for the publishing endpoint each time. Don’t you think that it would be a good idea to cache the wsdl information, to avoid parsing the same file several times? So it takes 10 times time to reparse the quite complex wsdl . I think you can broke down you wsdl for each endpoint , It could be a solution but there are reasons why I don’t want to do that or you can try the build service from class you just do not specify the wsdlLocation attribute to walk around that. I tried that. When I removed wsdlLocation attribute from the configuration file, then information about localization of the wsdl files was taken from implementor class and again service was build from wsdl. After removing from annotation buildServiceFromClass was started. Unfortunately I got following exception and creating of service was failed. NFO: Could not find the configuration file cxf.xml on the classpath. 2007-06-05 10:13:17 org.apache.cxf.configuration.spring.ConfigurerImpl getBeanName INFO: Could not determine bean name for instance of class org.apache.cxf.jaxws.JaxWsServerFactoryBean. 2007-06-05 10:13:17 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass INFO: Creating Service from class 2007-06-05 10:13:18 sun.reflect.NativeMethodAccessorImpl invoke0 WARNING: failed cxf javax.servlet.ServletException: Error creating bean with name '': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [of the operation>] already exists in this service at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:437) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:617) at org.mortbay.jetty.servlet.Context.startContext(Context.java:139) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147) at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.jetty.Server.doStart(Server.java:210) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) …… 2007-06-05 10:13:18 sun.reflect.NativeMethodAccessorImpl invoke0 SEVERE: Nested in javax.servlet.ServletException: Error creating bean with name '': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [] already exists in this service: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [] already exists in this service Caused by: java.lang.IllegalArgumentException: An operation with name [] already exists in this service at org.apache.cxf.service.model.InterfaceInfo.addOperation(InterfaceInfo.java:71) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createOperation(ReflectionServiceFactoryBean.java:346) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createInterface(ReflectionServiceFactoryBean.java:338) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:217) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:246) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:135) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:82) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:84) at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:280) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:178) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:361) at sun.reflect.NativeMethodAccesso
Re: buildServiceFromWSDL - long processing
Hi Krystian, Comments in the mail. Krystian Lider wrote: Hi Willem Thank you for the replay. Please see my comments below. On 6/5/2007 8:42 AM,User Willem Jiang wrote: Hi Krystian, Is there only one wsdl that contains all the endpoints information. In that specific situation yes CXF did not cache the wsdl information for the endpoints , it will build all service model from the wsdl and then look up a right definition for the publishing endpoint each time. Don’t you think that it would be a good idea to cache the wsdl information, to avoid parsing the same file several times? Yes, we should add the wsdl cache for building service from wsdl. Current we have a WSDLManager can cache the wsdl definition, but I did not find the code that use it, I had fill a JIRA for it. Please monitor this issue. https://issues.apache.org/jira/browse/CXF-699 So it takes 10 times time to reparse the quite complex wsdl . I think you can broke down you wsdl for each endpoint , It could be a solution but there are reasons why I don’t want to do that or you can try the build service from class you just do not specify the wsdlLocation attribute to walk around that. I tried that. When I removed wsdlLocation attribute from the configuration file, then information about localization of the wsdl files was taken from implementor class and again service was build from wsdl. After removing from annotation buildServiceFromClass was started. Unfortunately I got following exception and creating of service was failed. NFO: Could not find the configuration file cxf.xml on the classpath. 2007-06-05 10:13:17 org.apache.cxf.configuration.spring.ConfigurerImpl getBeanName INFO: Could not determine bean name for instance of class org.apache.cxf.jaxws.JaxWsServerFactoryBean. 2007-06-05 10:13:17 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass INFO: Creating Service from class 2007-06-05 10:13:18 sun.reflect.NativeMethodAccessorImpl invoke0 WARNING: failed cxf javax.servlet.ServletException: Error creating bean with name '': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [name of the operation>] already exists in this service at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:437) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:617) at org.mortbay.jetty.servlet.Context.startContext(Context.java:139) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147) at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.jetty.Server.doStart(Server.java:210) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) …… 2007-06-05 10:13:18 sun.reflect.NativeMethodAccessorImpl invoke0 SEVERE: Nested in javax.servlet.ServletException: Error creating bean with name '': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [] already exists in this service: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [] already exists in this service Caused by: java.lang.IllegalArgumentException: An operation with name [] already exists in this service at org.apache.cxf.service.model.InterfaceInfo.addOperation(InterfaceInfo.java:71) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createOperation(ReflectionServiceFactoryBean.java:346) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createInterface(ReflectionServiceFactoryBean.java:338) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:217) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:246) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:135) at org.apache.cxf.frontend.AbstractEndpointFacto
Re: buildServiceFromWSDL - long processing
Hi Krystian, I think CXF does not parse the same wsdl file for several times. The WSDLManager will cache the wsdl definition with same URL. (see http://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java around line 82) But we do not cache the serviceInfos built by same definition. It will build the same service model for several times. It need to enhance. Thank you for reporting this. Cheers Jim. Krystian Lider wrote: Hi Willem Thank you for the replay. Please see my comments below. On 6/5/2007 8:42 AM,User Willem Jiang wrote: Hi Krystian, Is there only one wsdl that contains all the endpoints information. In that specific situation yes CXF did not cache the wsdl information for the endpoints , it will build all service model from the wsdl and then look up a right definition for the publishing endpoint each time. Don’t you think that it would be a good idea to cache the wsdl information, to avoid parsing the same file several times? So it takes 10 times time to reparse the quite complex wsdl . I think you can broke down you wsdl for each endpoint , It could be a solution but there are reasons why I don’t want to do that or you can try the build service from class you just do not specify the wsdlLocation attribute to walk around that. I tried that. When I removed wsdlLocation attribute from the configuration file, then information about localization of the wsdl files was taken from implementor class and again service was build from wsdl. After removing from annotation buildServiceFromClass was started. Unfortunately I got following exception and creating of service was failed. NFO: Could not find the configuration file cxf.xml on the classpath. 2007-06-05 10:13:17 org.apache.cxf.configuration.spring.ConfigurerImpl getBeanName INFO: Could not determine bean name for instance of class org.apache.cxf.jaxws.JaxWsServerFactoryBean. 2007-06-05 10:13:17 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass INFO: Creating Service from class 2007-06-05 10:13:18 sun.reflect.NativeMethodAccessorImpl invoke0 WARNING: failed cxf javax.servlet.ServletException: Error creating bean with name '': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [name of the operation>] already exists in this service at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:437) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:617) at org.mortbay.jetty.servlet.Context.startContext(Context.java:139) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147) at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.jetty.Server.doStart(Server.java:210) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) …… 2007-06-05 10:13:18 sun.reflect.NativeMethodAccessorImpl invoke0 SEVERE: Nested in javax.servlet.ServletException: Error creating bean with name '': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [] already exists in this service: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [] already exists in this service Caused by: java.lang.IllegalArgumentException: An operation with name [] already exists in this service at org.apache.cxf.service.model.InterfaceInfo.addOperation(InterfaceInfo.java:71) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createOperation(ReflectionServiceFactoryBean.java:346) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createInterface(ReflectionServiceFactoryBean.java:338) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:217) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:246)