You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Valerio Schiavoni <va...@gmail.com> on 2009/08/31 13:55:02 UTC

Troubles with CXF and the maven-assembly-plugin

Hello,
i use the maven-assembly-plugin to pack all the dependencies of my
application in a single jar. For those who know it, I use the
'jar-with-dependencies' assembly descriptor.

Nevertheless, when I run my jar, i get the stacktrace [1].

Does anyone have an idea about this issue? My guess is that the
service discovery mechanism used by CXF to register service handlers
was messed up by the generation of the big jar..but I'm not sure at
all..

[1]
INFO: Refreshing
org.apache.cxf.bus.spring.BusApplicationContext@17a7de4: display name
[org.apache.cxf.bus.spring.BusApplicationContext@17a7de4]; startup
date [Mon Aug 31 13:48:54 CEST 2009]; root of context hierarchy
INFO: No cxf.xml configuration file detected, relying on defaults.
INFO: Bean factory for application context
[org.apache.cxf.bus.spring.BusApplicationContext@17a7de4]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@149e631
INFO: Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@149e631:
defining beans [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.ws.addressing.policy.AddressingAssertionBuilder,org.apache.cxf.ws.addressing.policy.AddressingPolicyInterceptorProvider,org.apache.cxf.ws.addressing.policy.UsingAddressingAssertionBuilder];
root of factory hierarchy
org.apache.cxf.BusException: No binding factory for namespace
http://apache.org/cxf/binding/jaxrs registered.
	at org.apache.cxf.binding.BindingFactoryManagerImpl.getBindingFactory(BindingFactoryManagerImpl.java:91)
	at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createBindingInfo(AbstractJAXRSFactoryBean.java:136)
	at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpointInfo(AbstractJAXRSFactoryBean.java:116)
	at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpoint(AbstractJAXRSFactoryBean.java:162)
	at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:83)
	at org.objectweb.fractal.bf.connectors.rest.RestSkeletonContent.startFc(RestSkeletonContent.java:61)
	at org.objectweb.fractal.julia.generated.Ccac238dc_0.setFcContentState(BasicControllerMixin.java:6128)
	at org.objectweb.fractal.julia.generated.Ccac238dc_0.setFcStarted(BasicControllerMixin.java:6068)
	at org.objectweb.fractal.julia.generated.C18c4c884_0.setFcStarted(INTERFACE[LifeCycleCoordinator])
	at org.objectweb.fractal.julia.generated.Ccac238dc_0.setFcState(BasicControllerMixin.java:3105)
	at org.objectweb.fractal.julia.generated.Ccac238dc_0.startFc$$0(BasicControllerMixin.java:4125)
	at org.objectweb.fractal.julia.generated.Ccac238dc_0.startFc(BasicControllerMixin.java:5095)
	at org.objectweb.fractal.julia.generated.C18c4c884_0.startFc(INTERFACE[LifeCycleCoordinator])
	at org.objectweb.fractal.bf.BindingFactoryImpl.export(BindingFactoryImpl.java:226)
	at org.objectweb.fractal.bf.BindingFactoryInterceptorLC1a2eb783.export(BindingFactoryInterceptorLC1a2eb783.java:73)
	at org.objectweb.fractal.bf.BindingFactoryFcItf.export(BindingFactoryFcItf.java:38)
	at org.ow2.frascati.factory.core.instance.binding.AbstractRemoteBinding.export(AbstractRemoteBinding.java:138)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingProtocolInterceptorLC1a2eb783.export(ScaBindingProtocolInterceptorLC1a2eb783.java:73)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingProtocolFcItf.export(ScaBindingProtocolFcItf.java:38)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingSwitch.export(ScaBindingSwitch.java:163)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingInterceptorLC1a2eb783.export(ScaBindingInterceptorLC1a2eb783.java:93)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingFcItf.export(ScaBindingFcItf.java:44)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingProcessImpl.bindComponents(ScaBindingProcessImpl.java:133)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingProcessImpl.processBinding(ScaBindingProcessImpl.java:89)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingProcessInterceptorLC1a2eb783.processBinding(ScaBindingProcessInterceptorLC1a2eb783.java:53)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingProcessFcItf.processBinding(ScaBindingProcessFcItf.java:32)
	at org.ow2.frascati.factory.core.instance.component.ScaComponentImpl.create(ScaComponentImpl.java:255)
	at org.ow2.frascati.factory.core.instance.component.ScaComponentInterceptorLC1a2eb783.create(ScaComponentInterceptorLC1a2eb783.java:74)
	at org.ow2.frascati.factory.core.instance.component.ScaComponentFcItf.create(ScaComponentFcItf.java:39)
	at org.ow2.frascati.factory.core.instance.assembly.ScaAssemblyImpl.create(ScaAssemblyImpl.java:71)
	at org.ow2.frascati.factory.core.instance.assembly.ScaAssemblyInterceptorLC1a2eb783.create(ScaAssemblyInterceptorLC1a2eb783.java:53)
	at org.ow2.frascati.factory.core.instance.assembly.ScaAssemblyFcItf.create(ScaAssemblyFcItf.java:32)
	at org.ow2.frascati.factory.core.dispatcher.ManagerImpl.loadComposite(ManagerImpl.java:132)
	at org.ow2.frascati.factory.core.dispatcher.ManagerInterceptorLC1a2eb783.loadComposite(ManagerInterceptorLC1a2eb783.java:53)
	at org.ow2.frascati.factory.core.dispatcher.ManagerFcItf.loadComposite(ManagerFcItf.java:32)
	at org.ow2.frascati.factory.runtime.domain.DomainManager.getComposite(DomainManager.java:299)
	at org.ow2.frascati.factory.runtime.domain.api.DomainInterceptorLC1a2eb783.getComposite(DomainInterceptorLC1a2eb783.java:74)
	at org.ow2.frascati.factory.runtime.domain.api.DomainFcItf.getComposite(DomainFcItf.java:39)
	at org.ow2.frascati.factory.Factory.getComposite(Factory.java:36)
	at org.ow2.frascati.factory.AbstractFactory.getComposite(AbstractFactory.java:113)
	at org.ow2.frascati.factory.Launcher.<init>(Launcher.java:38)
	at org.ow2.frascati.factory.ManifestLauncher.main(ManifestLauncher.java:35)
org.apache.cxf.service.factory.ServiceConstructionException
	at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:108)
	at org.objectweb.fractal.bf.connectors.rest.RestSkeletonContent.startFc(RestSkeletonContent.java:61)
	at org.objectweb.fractal.julia.generated.Ccac238dc_0.setFcContentState(BasicControllerMixin.java:6128)
	at org.objectweb.fractal.julia.generated.Ccac238dc_0.setFcStarted(BasicControllerMixin.java:6068)
	at org.objectweb.fractal.julia.generated.C18c4c884_0.setFcStarted(INTERFACE[LifeCycleCoordinator])
	at org.objectweb.fractal.julia.generated.Ccac238dc_0.setFcState(BasicControllerMixin.java:3105)
	at org.objectweb.fractal.julia.generated.Ccac238dc_0.startFc$$0(BasicControllerMixin.java:4125)
	at org.objectweb.fractal.julia.generated.Ccac238dc_0.startFc(BasicControllerMixin.java:5095)
	at org.objectweb.fractal.julia.generated.C18c4c884_0.startFc(INTERFACE[LifeCycleCoordinator])
	at org.objectweb.fractal.bf.BindingFactoryImpl.export(BindingFactoryImpl.java:226)
	at org.objectweb.fractal.bf.BindingFactoryInterceptorLC1a2eb783.export(BindingFactoryInterceptorLC1a2eb783.java:73)
	at org.objectweb.fractal.bf.BindingFactoryFcItf.export(BindingFactoryFcItf.java:38)
	at org.ow2.frascati.factory.core.instance.binding.AbstractRemoteBinding.export(AbstractRemoteBinding.java:138)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingProtocolInterceptorLC1a2eb783.export(ScaBindingProtocolInterceptorLC1a2eb783.java:73)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingProtocolFcItf.export(ScaBindingProtocolFcItf.java:38)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingSwitch.export(ScaBindingSwitch.java:163)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingInterceptorLC1a2eb783.export(ScaBindingInterceptorLC1a2eb783.java:93)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingFcItf.export(ScaBindingFcItf.java:44)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingProcessImpl.bindComponents(ScaBindingProcessImpl.java:133)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingProcessImpl.processBinding(ScaBindingProcessImpl.java:89)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingProcessInterceptorLC1a2eb783.processBinding(ScaBindingProcessInterceptorLC1a2eb783.java:53)
	at org.ow2.frascati.factory.core.instance.binding.ScaBindingProcessFcItf.processBinding(ScaBindingProcessFcItf.java:32)
	at org.ow2.frascati.factory.core.instance.component.ScaComponentImpl.create(ScaComponentImpl.java:255)
	at org.ow2.frascati.factory.core.instance.component.ScaComponentInterceptorLC1a2eb783.create(ScaComponentInterceptorLC1a2eb783.java:74)
	at org.ow2.frascati.factory.core.instance.component.ScaComponentFcItf.create(ScaComponentFcItf.java:39)
	at org.ow2.frascati.factory.core.instance.assembly.ScaAssemblyImpl.create(ScaAssemblyImpl.java:71)
	at org.ow2.frascati.factory.core.instance.assembly.ScaAssemblyInterceptorLC1a2eb783.create(ScaAssemblyInterceptorLC1a2eb783.java:53)
	at org.ow2.frascati.factory.core.instance.assembly.ScaAssemblyFcItf.create(ScaAssemblyFcItf.java:32)
	at org.ow2.frascati.factory.core.dispatcher.ManagerImpl.loadComposite(ManagerImpl.java:132)
	at org.ow2.frascati.factory.core.dispatcher.ManagerInterceptorLC1a2eb783.loadComposite(ManagerInterceptorLC1a2eb783.java:53)
	at org.ow2.frascati.factory.core.dispatcher.ManagerFcItf.loadComposite(ManagerFcItf.java:32)
	at org.ow2.frascati.factory.runtime.domain.DomainManager.getComposite(DomainManager.java:299)
	at org.ow2.frascati.factory.runtime.domain.api.DomainInterceptorLC1a2eb783.getComposite(DomainInterceptorLC1a2eb783.java:74)
	at org.ow2.frascati.factory.runtime.domain.api.DomainFcItf.getComposite(DomainFcItf.java:39)
	at org.ow2.frascati.factory.Factory.getComposite(Factory.java:36)
	at org.ow2.frascati.factory.AbstractFactory.getComposite(AbstractFactory.java:113)
	at org.ow2.frascati.factory.Launcher.<init>(Launcher.java:38)
	at org.ow2.frascati.factory.ManifestLauncher.main(ManifestLauncher.java:35)
Caused by: org.apache.cxf.BusException: No DestinationFactory was
found for the namespace http://schemas.xmlsoap.org/wsdl/soap/http.
	at org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:115)
	at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:85)
	at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:69)
	at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:84)
	... 37 more
Exception in thread "main" java.lang.Error: Could not start this SCA composite
	at org.ow2.frascati.factory.core.instance.util.ScaCompositeHelper.start(ScaCompositeHelper.java:45)
	at org.ow2.frascati.factory.runtime.domain.DomainManager.getComposite(DomainManager.java:300)
	at org.ow2.frascati.factory.runtime.domain.api.DomainInterceptorLC1a2eb783.getComposite(DomainInterceptorLC1a2eb783.java:74)
	at org.ow2.frascati.factory.runtime.domain.api.DomainFcItf.getComposite(DomainFcItf.java:39)
	at org.ow2.frascati.factory.Factory.getComposite(Factory.java:36)
	at org.ow2.frascati.factory.AbstractFactory.getComposite(AbstractFactory.java:113)
	at org.ow2.frascati.factory.Launcher.<init>(Launcher.java:38)
	at org.ow2.frascati.factory.ManifestLauncher.main(ManifestLauncher.java:35)
Caused by: java.lang.NullPointerException
	at org.objectweb.fractal.util.Fractal.getSuperController(Fractal.java:169)
	at org.ow2.frascati.factory.core.instance.util.ScaCompositeHelper.getContainer(ScaCompositeHelper.java:58)
	at org.ow2.frascati.factory.core.instance.util.ScaCompositeHelper.start(ScaCompositeHelper.java:35)
	... 7 more


-- 
twitter.com/vschiavoni
jroller.com/vschiavoni
linkedin.com/in/vschiavoni
facebook.com/vschiavoni (permanently disabled)

Re: Troubles with CXF and the maven-assembly-plugin

Posted by Valerio Schiavoni <va...@gmail.com>.
On Mon, Aug 31, 2009 at 4:05 PM, Daniel Kulp<dk...@apache.org> wrote:
>> which modules should I include to have the transformer classes used by :
> cxf-buildtools
> Add that as a dependency to the shade plugin.

That, just worked perfectly.

Thanks,
Valerio


-- 
twitter.com/vschiavoni
jroller.com/vschiavoni
linkedin.com/in/vschiavoni
facebook.com/vschiavoni (permanently disabled)

Re: Troubles with CXF and the maven-assembly-plugin

Posted by Daniel Kulp <dk...@apache.org>.
> which modules should I include to have the transformer classes used by :

cxf-buildtools

Add that as a dependency to the shade plugin.

Dan


On Mon August 31 2009 9:58:12 am Valerio Schiavoni wrote:
> Hello Dan,
>
> On Mon, Aug 31, 2009 at 3:13 PM, Daniel Kulp<dk...@apache.org> wrote:
> > Yea.  Take a look at how we use the shade plugin:
> >
> > http://svn.apache.org/repos/asf/cxf/trunk/distribution/bundle/all/pom.xml
>
> which modules should I include to have the transformer classes used by :
>
>   <transformer implementation="org.apache.cxf.maven.PluginTransformer">
>
> <resource>META-INF/tools-plugin.xml</resource>
>                                 </transformer>
>    <transformer implementation="org.apache.cxf.maven.CXFAllTransformer" />
>
>
> Thanks,
> valerio
>
> > Alternatively, just depend on cxf-bundle instead of the individual
> > modules.
>
> I'd like first this first solution, as CXF is being imported
> transitively (as a runtime dependency itself), and the importd jars
> have already been carefully selected to reduce the disk footprint of
> the jar.

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Troubles with CXF and the maven-assembly-plugin

Posted by Valerio Schiavoni <va...@gmail.com>.
Hello Dan,

On Mon, Aug 31, 2009 at 3:13 PM, Daniel Kulp<dk...@apache.org> wrote:

> Yea.  Take a look at how we use the shade plugin:
>
> http://svn.apache.org/repos/asf/cxf/trunk/distribution/bundle/all/pom.xml

which modules should I include to have the transformer classes used by :

  <transformer implementation="org.apache.cxf.maven.PluginTransformer">

<resource>META-INF/tools-plugin.xml</resource>
                                </transformer>
   <transformer implementation="org.apache.cxf.maven.CXFAllTransformer" />


Thanks,
valerio


> Alternatively, just depend on cxf-bundle instead of the individual modules.

I'd like first this first solution, as CXF is being imported
transitively (as a runtime dependency itself), and the importd jars
have already been carefully selected to reduce the disk footprint of
the jar.


-- 
twitter.com/vschiavoni
jroller.com/vschiavoni
linkedin.com/in/vschiavoni
facebook.com/vschiavoni (permanently disabled)

Re: Troubles with CXF and the maven-assembly-plugin

Posted by Daniel Kulp <dk...@apache.org>.
On Mon August 31 2009 8:32:52 am Valerio Schiavoni wrote:
> just as a follow-up of my previous post:
>
> On Mon, Aug 31, 2009 at 1:55 PM, Valerio
>
> Schiavoni<va...@gmail.com> wrote:
> > i use the maven-assembly-plugin to pack all the dependencies of my
> > application in a single jar. For those who know it, I use the
> > 'jar-with-dependencies' assembly descriptor.
> >
> > Nevertheless, when I run my jar, i get the stacktrace [1].
> >
> > Does anyone have an idea about this issue? My guess is that the
> > service discovery mechanism used by CXF to register service handlers
> > was messed up by the generation of the big jar..but I'm not sure at
> > all..
>
> It seems like I was right, and the shade plugin, through the
> ServicesResourceTransform should help me out somehow..

Yea.  Take a look at how we use the shade plugin:

http://svn.apache.org/repos/asf/cxf/trunk/distribution/bundle/all/pom.xml

Alternatively, just depend on cxf-bundle instead of the individual modules.    
It may pull in way more than you need, but it should work for you.


-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Troubles with CXF and the maven-assembly-plugin

Posted by Valerio Schiavoni <va...@gmail.com>.
just as a follow-up of my previous post:

On Mon, Aug 31, 2009 at 1:55 PM, Valerio
Schiavoni<va...@gmail.com> wrote:
> i use the maven-assembly-plugin to pack all the dependencies of my
> application in a single jar. For those who know it, I use the
> 'jar-with-dependencies' assembly descriptor.
>
> Nevertheless, when I run my jar, i get the stacktrace [1].
>
> Does anyone have an idea about this issue? My guess is that the
> service discovery mechanism used by CXF to register service handlers
> was messed up by the generation of the big jar..but I'm not sure at
> all..

It seems like I was right, and the shade plugin, through the
ServicesResourceTransform should help me out somehow..



-- 
twitter.com/vschiavoni
jroller.com/vschiavoni
linkedin.com/in/vschiavoni
facebook.com/vschiavoni (permanently disabled)