You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Aleksandar Vidakovic <ch...@monkeysintown.com> on 2014/05/04 01:04:26 UTC
Undertow + CXF + Spring single JAR
Hi,
... I tried to package a CXF project with fairly standard WAR setup
(CXFServlet in web.xml configured) and some additional Spring
configuration (nothing fancy) in a single JAR (with Maven Shade plugin).
99% is working (Undertow is starting, Spring context gets initialized),
but CXF has a problem picking up a transport. I thought that it would
just behave the same way like in a servlet container environment, but
apparently something is missing.
This is the exception that I get:
[console]
Exception in thread "main"
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name
'org.apache.cxf.jaxrs.spring.JAXRSServerFactoryBeanDefinitionParser$SpringJAXRSServerFactoryBean---72839183':
Invocation of init method failed; nested exception is
org.apache.cxf.service.factory.ServiceConstructionException
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at
org.apache.cxf.transport.servlet.CXFServlet.createSpringContext(CXFServlet.java:151)
at
org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:74)
at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.java:76)
at
io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:214)
at
io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:119)
at
io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:501)
at com.hotlabuyo.rest.server.Main.main(Main.java:51)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at
org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:205)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1681)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1620)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
... 16 more
Caused by: org.apache.cxf.BusException: No DestinationFactory was found
for the namespacehttp://cxf.apache.org/transports/http.
at
org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:122)
at
org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:79)
at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:63)
at
org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:160)
... 23 more
[/console]
... and the relevant piece of configuration for CXF looks like this:
[config]
...
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-*.xml" />
...
[/config]
Did anyone try this setup already?
Any help with this would be much appreciated.
Thanks in advance and cheers,
Aleks
Re: Undertow + CXF + Spring single JAR
Posted by Aleksandar Vidakovic <ch...@monkeysintown.com>.
Hi,
... I got it working, Andrei. Your hint nailed it.
I got a bit confused, because there was actually a bus-extensions.txt
file present in the shaded JAR. But the problem was in fact that there
are (I didn't see/know that) multiple META-INF/cxf/bus-extensions.txt
files in different CXF dependency JARs. If you don't tell Maven Shade
explicitly what to do in such a conflict situation (they all point to
the same path in the unified JAR) it will just use (I think) the last
one when it merges the dependencies into one JAR.
The solution is similar to the one adopted for the Spring framework
(META-INF/spring.schemas, META-INF/spring.handlers)... here's my Maven
Shade configuration:
[config]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>false</minimizeJar>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"
/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<!-- THIS WAS MISSING -->
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/cxf/bus-extensions.txt</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>${m11n.project.main}</Main-Class>
<X-Compile-Source-JDK>${maven.compile.source}</X-Compile-Source-JDK>
<X-Compile-Target-JDK>${maven.compile.target}</X-Compile-Target-JDK>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
[/config]
Hope it helps if someone is doing a similar thing... works like a charm
now :-)
Thanks a ton for the help!
Cheers,
Aleks
On 04.05.2014 09:26, Andrei Shakirin wrote:
> Hi,
>
> Normally this stack trace is caused by missing cxf-rt-transports-http-xxx.jar on the classpath.
> Either the class HTTPTransportFactory.class or META-INF/cxf/bus-extensions.txt is not in your jar.
>
> Out of curiosity: what is the reason to compose CXF and Spring in single jar using Maven Shade?
>
> Regards,
> Andrei.
>
>> -----Original Message-----
>> From: Aleksandar Vidakovic [mailto:cheetah@monkeysintown.com]
>> Sent: Sonntag, 4. Mai 2014 01:04
>> To: users@cxf.apache.org
>> Subject: Undertow + CXF + Spring single JAR
>>
>> Hi,
>>
>> ... I tried to package a CXF project with fairly standard WAR setup (CXFServlet
>> in web.xml configured) and some additional Spring configuration (nothing
>> fancy) in a single JAR (with Maven Shade plugin).
>>
>> 99% is working (Undertow is starting, Spring context gets initialized), but CXF
>> has a problem picking up a transport. I thought that it would just behave the
>> same way like in a servlet container environment, but apparently something is
>> missing.
>>
>> This is the exception that I get:
>>
>> [console]
>>
>> Exception in thread "main"
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean with name
>> 'org.apache.cxf.jaxrs.spring.JAXRSServerFactoryBeanDefinitionParser$SpringJA
>> XRSServerFactoryBean---72839183':
>> Invocation of init method failed; nested exception is
>> org.apache.cxf.service.factory.ServiceConstructionException
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
>> ory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
>> ory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
>> ory.createBean(AbstractAutowireCapableBeanFactory.java:475)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(
>> AbstractBeanFactory.java:304)
>> at
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSi
>> ngleton(DefaultSingletonBeanRegistry.java:228)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(A
>> bstractBeanFactory.java:300)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstr
>> actBeanFactory.java:195)
>> at
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst
>> antiateSingletons(DefaultListableBeanFactory.java:703)
>> at
>> org.springframework.context.support.AbstractApplicationContext.finishBeanFac
>> toryInitialization(AbstractApplicationContext.java:760)
>> at
>> org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
>> actApplicationContext.java:482)
>> at
>> org.apache.cxf.transport.servlet.CXFServlet.createSpringContext(CXFServlet.jav
>> a:151)
>> at
>> org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:74)
>> at
>> org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.
>> java:76)
>> at
>> io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(Manag
>> edServlet.java:214)
>> at
>> io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:1
>> 19)
>> at
>> io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerI
>> mpl.java:501)
>> at com.hotlabuyo.rest.server.Main.main(Main.java:51)
>> Caused by: org.apache.cxf.service.factory.ServiceConstructionException
>> at
>> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.j
>> ava:205)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
>> 62)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
>> mpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:483)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
>> ory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1681)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
>> ory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1620)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
>> ory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
>> ... 16 more
>> Caused by: org.apache.cxf.BusException: No DestinationFactory was found for
>> the namespacehttp://cxf.apache.org/transports/http.
>> at
>> org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationF
>> actory(DestinationFactoryManagerImpl.java:122)
>> at
>> org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:79)
>> at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:63)
>> at
>> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.j
>> ava:160)
>> ... 23 more
>>
>> [/console]
>>
>> ... and the relevant piece of configuration for CXF looks like this:
>>
>> [config]
>>
>> ...
>>
>> <import resource="classpath:META-INF/cxf/cxf.xml" />
>> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>> <import resource="classpath:META-INF/cxf/cxf-extension-*.xml" />
>>
>> ...
>>
>> [/config]
>>
>> Did anyone try this setup already?
>>
>> Any help with this would be much appreciated.
>>
>> Thanks in advance and cheers,
>>
>> Aleks
Re: Undertow + CXF + Spring single JAR
Posted by Aleksandar Vidakovic <ch...@monkeysintown.com>.
... ah, I think
META-INF/cxf/bus-extensions.txt
... is missing... will try this and post the results here. I think I
have to add some additional include rules in Maven Shade...
As for the reason why I do this: just to have an easy to distribute
single purpose service (there'll be more of those)... previously I had a
WAR file packaged with Jetty Distribution as .tar.gz, then I created a
Jetty Standalone service (similar to this approach) and finally I just
wanted to do the same with Undertow.io (the benchmarks look promising).
Either way, all three approaches are fine, just have a preference for
the single JAR as they are included in a Docker configuration... and
this way it only takes a line in the Dockerfile ;-)
If you are asking why Maven Shade is used: it just does the Job very
nicely... especially merging all the Spring schema and handler files.
Thanks again for the hint.
Cheers,
Aleks
On 04.05.2014 09:26, Andrei Shakirin wrote:
> Hi,
>
> Normally this stack trace is caused by missing cxf-rt-transports-http-xxx.jar on the classpath.
> Either the class HTTPTransportFactory.class or META-INF/cxf/bus-extensions.txt is not in your jar.
>
> Out of curiosity: what is the reason to compose CXF and Spring in single jar using Maven Shade?
>
> Regards,
> Andrei.
>
>> -----Original Message-----
>> From: Aleksandar Vidakovic [mailto:cheetah@monkeysintown.com]
>> Sent: Sonntag, 4. Mai 2014 01:04
>> To: users@cxf.apache.org
>> Subject: Undertow + CXF + Spring single JAR
>>
>> Hi,
>>
>> ... I tried to package a CXF project with fairly standard WAR setup (CXFServlet
>> in web.xml configured) and some additional Spring configuration (nothing
>> fancy) in a single JAR (with Maven Shade plugin).
>>
>> 99% is working (Undertow is starting, Spring context gets initialized), but CXF
>> has a problem picking up a transport. I thought that it would just behave the
>> same way like in a servlet container environment, but apparently something is
>> missing.
>>
>> This is the exception that I get:
>>
>> [console]
>>
>> Exception in thread "main"
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean with name
>> 'org.apache.cxf.jaxrs.spring.JAXRSServerFactoryBeanDefinitionParser$SpringJA
>> XRSServerFactoryBean---72839183':
>> Invocation of init method failed; nested exception is
>> org.apache.cxf.service.factory.ServiceConstructionException
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
>> ory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
>> ory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
>> ory.createBean(AbstractAutowireCapableBeanFactory.java:475)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(
>> AbstractBeanFactory.java:304)
>> at
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSi
>> ngleton(DefaultSingletonBeanRegistry.java:228)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(A
>> bstractBeanFactory.java:300)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstr
>> actBeanFactory.java:195)
>> at
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst
>> antiateSingletons(DefaultListableBeanFactory.java:703)
>> at
>> org.springframework.context.support.AbstractApplicationContext.finishBeanFac
>> toryInitialization(AbstractApplicationContext.java:760)
>> at
>> org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
>> actApplicationContext.java:482)
>> at
>> org.apache.cxf.transport.servlet.CXFServlet.createSpringContext(CXFServlet.jav
>> a:151)
>> at
>> org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:74)
>> at
>> org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.
>> java:76)
>> at
>> io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(Manag
>> edServlet.java:214)
>> at
>> io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:1
>> 19)
>> at
>> io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerI
>> mpl.java:501)
>> at com.hotlabuyo.rest.server.Main.main(Main.java:51)
>> Caused by: org.apache.cxf.service.factory.ServiceConstructionException
>> at
>> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.j
>> ava:205)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
>> 62)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
>> mpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:483)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
>> ory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1681)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
>> ory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1620)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
>> ory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
>> ... 16 more
>> Caused by: org.apache.cxf.BusException: No DestinationFactory was found for
>> the namespacehttp://cxf.apache.org/transports/http.
>> at
>> org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationF
>> actory(DestinationFactoryManagerImpl.java:122)
>> at
>> org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:79)
>> at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:63)
>> at
>> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.j
>> ava:160)
>> ... 23 more
>>
>> [/console]
>>
>> ... and the relevant piece of configuration for CXF looks like this:
>>
>> [config]
>>
>> ...
>>
>> <import resource="classpath:META-INF/cxf/cxf.xml" />
>> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>> <import resource="classpath:META-INF/cxf/cxf-extension-*.xml" />
>>
>> ...
>>
>> [/config]
>>
>> Did anyone try this setup already?
>>
>> Any help with this would be much appreciated.
>>
>> Thanks in advance and cheers,
>>
>> Aleks
RE: Undertow + CXF + Spring single JAR
Posted by Andrei Shakirin <as...@talend.com>.
Hi,
Normally this stack trace is caused by missing cxf-rt-transports-http-xxx.jar on the classpath.
Either the class HTTPTransportFactory.class or META-INF/cxf/bus-extensions.txt is not in your jar.
Out of curiosity: what is the reason to compose CXF and Spring in single jar using Maven Shade?
Regards,
Andrei.
> -----Original Message-----
> From: Aleksandar Vidakovic [mailto:cheetah@monkeysintown.com]
> Sent: Sonntag, 4. Mai 2014 01:04
> To: users@cxf.apache.org
> Subject: Undertow + CXF + Spring single JAR
>
> Hi,
>
> ... I tried to package a CXF project with fairly standard WAR setup (CXFServlet
> in web.xml configured) and some additional Spring configuration (nothing
> fancy) in a single JAR (with Maven Shade plugin).
>
> 99% is working (Undertow is starting, Spring context gets initialized), but CXF
> has a problem picking up a transport. I thought that it would just behave the
> same way like in a servlet container environment, but apparently something is
> missing.
>
> This is the exception that I get:
>
> [console]
>
> Exception in thread "main"
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name
> 'org.apache.cxf.jaxrs.spring.JAXRSServerFactoryBeanDefinitionParser$SpringJA
> XRSServerFactoryBean---72839183':
> Invocation of init method failed; nested exception is
> org.apache.cxf.service.factory.ServiceConstructionException
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> ory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> ory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> ory.createBean(AbstractAutowireCapableBeanFactory.java:475)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(
> AbstractBeanFactory.java:304)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSi
> ngleton(DefaultSingletonBeanRegistry.java:228)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(A
> bstractBeanFactory.java:300)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstr
> actBeanFactory.java:195)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst
> antiateSingletons(DefaultListableBeanFactory.java:703)
> at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFac
> toryInitialization(AbstractApplicationContext.java:760)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
> actApplicationContext.java:482)
> at
> org.apache.cxf.transport.servlet.CXFServlet.createSpringContext(CXFServlet.jav
> a:151)
> at
> org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:74)
> at
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.
> java:76)
> at
> io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(Manag
> edServlet.java:214)
> at
> io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:1
> 19)
> at
> io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerI
> mpl.java:501)
> at com.hotlabuyo.rest.server.Main.main(Main.java:51)
> Caused by: org.apache.cxf.service.factory.ServiceConstructionException
> at
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.j
> ava:205)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
> mpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:483)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> ory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1681)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> ory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1620)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact
> ory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
> ... 16 more
> Caused by: org.apache.cxf.BusException: No DestinationFactory was found for
> the namespacehttp://cxf.apache.org/transports/http.
> at
> org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationF
> actory(DestinationFactoryManagerImpl.java:122)
> at
> org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:79)
> at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:63)
> at
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.j
> ava:160)
> ... 23 more
>
> [/console]
>
> ... and the relevant piece of configuration for CXF looks like this:
>
> [config]
>
> ...
>
> <import resource="classpath:META-INF/cxf/cxf.xml" />
> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
> <import resource="classpath:META-INF/cxf/cxf-extension-*.xml" />
>
> ...
>
> [/config]
>
> Did anyone try this setup already?
>
> Any help with this would be much appreciated.
>
> Thanks in advance and cheers,
>
> Aleks