camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Karlsen <davidkarl...@gmail.com>
Subject Fwd: Trouble when combining cxf server services and cxf-over-camel transport for a client service
Date Fri, 09 Nov 2012 17:59:51 GMT
Cross-posting to camel as this is camel related.
---------- Videresendt melding ----------
Fra: "David Karlsen" <davidkarlsen@gmail.com>
Dato: 9. nov. 2012 16:19
Emne: Trouble when combining cxf server services and cxf-over-camel
transport for a client service
Til: <users@cxf.apache.org>

Hi.

I have a cxf based client service which I use the camel transport for
(to run it async over persistent jms):

  <bean
class="org.apache.camel.component.cxf.transport.CamelTransportFactory">
                <property name="bus" ref="cxf" />
                <property name="camelContext" ref="RTS" />
                <property name="transportIds">
                        <list>
                        <value>http://cxf.apache.org/transports/camel
</value>
                    </list>
                </property>
        </bean>

   <camelcxf:conduit
name="{urn:srv.ledger.fs.edb.com:
ws:transaction:v1}LEDSTransactionService_V1PortTypePort.camel-conduit">
                <camelcxf:camelContextRef>RTS</camelcxf:camelContextRef>
        </camelcxf:conduit>


        <jaxws:client id="shadowLedgerOverJmsService"
                  address="camel://direct:toShadowLedger"

serviceClass="com.edb.fs.ledger.srv.ws.transaction.v1.LEDSTransactionServiceV1PortType">
        </jaxws:client>

        <camel:camelContext id="RTS" useMDCLogging="true"
streamCache="true" trace="true">
          .....
</camel:camelContext>

this is inside one spring context file - and all works well.



In addition in the same application I have another context file which
exposes my normal servlet-exposed services which is in another spring
context file cxf-servlet.xml::

   <cxf:bus>
                <cxf:features>
                        <cxf:logging />
                        <ref bean="responseTimeFeature" />
                </cxf:features>
                <cxf:inInterceptors>
                        <ref bean="inFaultPublishingInterceptor" />
                        <ref bean="wsHeaderInterceptor" /> <!-- basic
common header checks, MDC logging etc -->
                        <ref bean="wsHeaderSecurityInterceptor" />
<!-- this checks security object -->
                        <ref bean="contextInitializerInterceptor" />
<!-- initializes the user state object -->
                </cxf:inInterceptors>
                <cxf:inFaultInterceptors>
                        <ref bean="inFaultPublishingInterceptor" />
                </cxf:inFaultInterceptors>
                <cxf:outInterceptors>
                        <ref bean="outFaultPublishingInterceptor" />
                </cxf:outInterceptors>
                <cxf:outFaultInterceptors>
                        <ref bean="outFaultPublishingInterceptor" />
                </cxf:outFaultInterceptors>
        </cxf:bus>

        <jaxws:endpoint implementor="#pingWs" address="/PingService">
                <jaxws:properties>
                        <entry key="schema-validation-enabled"
value="${cxf.schemaValidation:true}" />
                </jaxws:properties>
        </jaxws:endpoint>

.....


The application boots up fine with *either* of the context files (e.g.
either my single cxf client ws over jms, or either my serverside
services exposed) - but it blows up with this message when both are
loaded:

Can somebody tell me why?

2012-11-09 16:18:16,725 [main][][][][][][][] WARN /cashpool - unavailable
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.apache.cxf.jaxws.EndpointImpl--1528277278': Invocation of init
method failed; nested exception is javax.xml.ws.WebService
Exception: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No bean named
'org.apache.camel.component.cxf.transport.CamelTransportFactory'
is defined
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
~[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
~[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        at
org.apache.cxf.transport.servlet.CXFServlet.createSpringContext(CXFServlet.java:146)
~[cxf-rt-transports-http-2.6.2.jar:2.6.2]
        at
org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:72)
~[cxf-rt-transports-http-2.6.2.jar:2.6.2]
        at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.java:67)
~[cxf-rt-transports-http-2.6.2.jar:2.6.2]
        at
org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:463)
[jetty-servlet-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:283)
[jetty-servlet-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
[jetty-util-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:771)
[jetty-servlet-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
[jetty-servlet-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1222)
[jetty-webapp-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676)
[jetty-server-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455)
[jetty-webapp-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:256)
[jetty-maven-plugin-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
[jetty-util-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
[jetty-server-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:167)
[jetty-server-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
[jetty-util-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
[jetty-server-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
[jetty-util-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
[jetty-server-7.6.3.v20120416.jar:7.6.3.v20120416]
        at org.eclipse.jetty.server.Server.doStart(Server.java:260)
[jetty-server-7.6.3.v20120416.jar:7.6.3.v20120416]
        at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)
[jetty-maven-plugin-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
[jetty-util-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:511)
[jetty-maven-plugin-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:364)
[jetty-maven-plugin-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:516)
[jetty-maven-plugin-7.6.3.v20120416.jar:7.6.3.v20120416]
        at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
[maven-core-3.0.4.jar:3.0.4]
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
[maven-core-3.0.4.jar:3.0.4]
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[maven-core-3.0.4.jar:3.0.4]
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[maven-core-3.0.4.jar:3.0.4]
        at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
[maven-core-3.0.4.jar:3.0.4]
        at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
[maven-core-3.0.4.jar:3.0.4]
        at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
[maven-core-3.0.4.jar:3.0.4]
        at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
[maven-core-3.0.4.jar:3.0.4]
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
[maven-core-3.0.4.jar:3.0.4]
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
[maven-core-3.0.4.jar:3.0.4]
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
[maven-embedder-3.0.4.jar:3.0.4]
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
[maven-embedder-3.0.4.jar:3.0.4]
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
[maven-embedder-3.0.4.jar:3.0.4]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[na:1.7.0_09]
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
~[na:1.7.0_09]
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.7.0_09]
Caused by: javax.xml.ws.WebServiceException:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No
bean named 'org.apache.camel.component.cxf.transport.CamelTransportFactory'
is defined
        at
org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:357)
~[cxf-rt-frontend-jaxws-2.6.2.jar:2.6.2]
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:246)
~[cxf-rt-frontend-jaxws-2.6.2.jar:2.6.2]
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:525)
~[cxf-rt-frontend-jaxws-2.6.2.jar:2.6.2]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[na:1.7.0_09]
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
~[na:1.7.0_09]
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.7.0_09]
        at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_09]
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1546)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1487)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1419)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        ... 55 common frames omitted
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No bean named
'org.apache.camel.component.cxf.transport.CamelTransportFactory'
is defined
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
        at
org.apache.cxf.bus.spring.SpringBeanLocator.hasConfiguredPropertyValue(SpringBeanLocator.java:223)
~[cxf-rt-core-2.6.2.jar:2.6.2]
        at
org.apache.cxf.transport.TransportFinder$2.loadBean(TransportFinder.java:180)
~[cxf-api-2.6.2.jar:2.6.2]
        at
org.apache.cxf.bus.extension.ExtensionManagerImpl.loadBeansOfType(ExtensionManagerImpl.java:314)
~[cxf-rt-core-2.6.2.jar:2.6.2]
        at
org.apache.cxf.bus.spring.SpringBeanLocator.loadBeansOfType(SpringBeanLocator.java:217)
~[cxf-rt-core-2.6.2.jar:2.6.2]
        at
org.apache.cxf.transport.TransportFinder.loadActivationNamespaces(TransportFinder.java:185)
~[cxf-api-2.6.2.jar:2.6.2]
        at
org.apache.cxf.transport.TransportFinder.findTransportForNamespace(TransportFinder.java:55)
~[cxf-api-2.6.2.jar:2.6.2]
        at
org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:122)
~[cxf-rt-core-2.6.2.jar:2.6.2]
        at
org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:88)
~[cxf-api-2.6.2.jar:2.6.2]
        at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:72)
~[cxf-api-2.6.2.jar:2.6.2]
        at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:160)
~[cxf-rt-frontend-simple-2.6.2.jar:2.6.2]
        at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
~[cxf-rt-frontend-jaxws-2.6.2.jar:2.6.2]
        at
org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:442)
~[cxf-rt-frontend-jaxws-2.6.2.jar:2.6.2]
        at
org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:329)
~[cxf-rt-frontend-jaxws-2.6.2.jar:2.6.2]
        ... 64 common frames omitted




--
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message