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 <here name of the service> from class
<here class name>
2007-06-05 10:13:18 sun.reflect.NativeMethodAccessorImpl invoke0
WARNING: failed cxf
javax.servlet.ServletException: Error creating bean with name
'<here_bean_id>': Invocation of init method failed; nested exception
is java.lang.IllegalArgumentException: An operation with name [<here
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 '<here bean id>': Invocation of init method failed; nested
exception is java.lang.IllegalArgumentException: An operation with
name [<here nam of the opartion>] already exists in this service:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '<here bean id>': Invocation of init method
failed; nested exception is java.lang.IllegalArgumentException: An
operation with name [<here operation id>] already exists in this service
Caused by: java.lang.IllegalArgumentException: An operation with name
[<here operation id>] 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.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.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1214)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1179)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1145)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:279)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:360)
at
org.apache.cxf.transport.servlet.CXFServlet.loadAdditionalConfig(CXFServlet.java:186)
at
org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:156)
at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:95)
at
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:433)
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)
I will try to send more information about that problem when I look
into cxf sources and try to investigate the problem.
And for CXF, we need to find a way to cache the built up service
model for the endpoint somewhere.
Cheers,
Willem.