You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Scott Lewis <sl...@composent.com> on 2019/11/06 06:05:16 UTC

CXF and Bndtools

I'm trying to use CXF with Bndtools 4.3.   Bndtools has a launcher that 
by default sets the start level of all bundles to the same value.

When I use this launcher to start an app that uses CXF I get 
ClassNotFoundExceptions such as these:

Exception in thread "BasicTopologyManagerPreRegSrvExporter" 
java.lang.NoClassDefFoundError: org/apache/cxf/jaxrs/JAXRSServerFactoryBean
     at 
org.eclipse.ecf.provider.cxf.server.CXFJaxRSServerContainer.createServlet(CXFJaxRSServerContainer.java:54)
     at 
org.eclipse.ecf.provider.jaxrs.server.JaxRSServerContainer.createServlet(JaxRSServerContainer.java:96)
     at 
org.eclipse.ecf.provider.jaxrs.server.JaxRSServerContainer.exportRemoteService(JaxRSServerContainer.java:199)
     at 
org.eclipse.ecf.remoteservice.RSARemoteServiceContainerAdapter$RSARemoteServiceRegistration.publish(RSARemoteServiceContainerAdapter.java:53)
     at 
org.eclipse.ecf.remoteservice.RemoteServiceContainerAdapterImpl.registerRemoteService(RemoteServiceContainerAdapterImpl.java:123)
     at 
org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.exportService(RemoteServiceAdmin.java:2182)
     at 
org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.exportService(RemoteServiceAdmin.java:361)
     at 
org.eclipse.ecf.osgi.services.remoteserviceadmin.AbstractTopologyManager.handleServiceRegistering(AbstractTopologyManager.java:466)
     at 
org.eclipse.ecf.osgi.services.remoteserviceadmin.TopologyManagerImpl$1.run(TopologyManagerImpl.java:193)
     at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: 
org.apache.cxf.jaxrs.JAXRSServerFactoryBean cannot be found by 
org.eclipse.ecf.provider.cxf.server_1.8.1.201911051602
     at 
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:511)
     at 
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
     at 
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
     at 
org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
     ... 10 more

I see that for the CXF Karaf features multiple start-levels are used for 
CXF bundles and dependencies...are exceptions such as the above due to 
not having the correct start-levels imposed by the bndtools launcher?   
If not that, do others have insights as to what's going wrong?

When I use these same bundles with other launchers (such as the equinox 
launcher) things work ok.

Thanksinadvance for any insights.

Scott



Re: CXF and Bndtools

Posted by Scott Lewis <sl...@composent.com>.
On 11/5/2019 11:23 PM, Jean-Baptiste Onofré wrote:
> Hi Scott,
>
> Do you have cxf-jaxrs bundle installed and corresponding packages imported ?

Yes.  Should have said that.

Thanks,

Scott



Re: CXF and Bndtools

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Scott,

Do you have cxf-jaxrs bundle installed and corresponding packages imported ?

Regards
JB

On 06/11/2019 07:05, Scott Lewis wrote:
> I'm trying to use CXF with Bndtools 4.3.   Bndtools has a launcher that
> by default sets the start level of all bundles to the same value.
> 
> When I use this launcher to start an app that uses CXF I get
> ClassNotFoundExceptions such as these:
> 
> Exception in thread "BasicTopologyManagerPreRegSrvExporter"
> java.lang.NoClassDefFoundError: org/apache/cxf/jaxrs/JAXRSServerFactoryBean
>     at
> org.eclipse.ecf.provider.cxf.server.CXFJaxRSServerContainer.createServlet(CXFJaxRSServerContainer.java:54)
> 
>     at
> org.eclipse.ecf.provider.jaxrs.server.JaxRSServerContainer.createServlet(JaxRSServerContainer.java:96)
> 
>     at
> org.eclipse.ecf.provider.jaxrs.server.JaxRSServerContainer.exportRemoteService(JaxRSServerContainer.java:199)
> 
>     at
> org.eclipse.ecf.remoteservice.RSARemoteServiceContainerAdapter$RSARemoteServiceRegistration.publish(RSARemoteServiceContainerAdapter.java:53)
> 
>     at
> org.eclipse.ecf.remoteservice.RemoteServiceContainerAdapterImpl.registerRemoteService(RemoteServiceContainerAdapterImpl.java:123)
> 
>     at
> org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.exportService(RemoteServiceAdmin.java:2182)
> 
>     at
> org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.exportService(RemoteServiceAdmin.java:361)
> 
>     at
> org.eclipse.ecf.osgi.services.remoteserviceadmin.AbstractTopologyManager.handleServiceRegistering(AbstractTopologyManager.java:466)
> 
>     at
> org.eclipse.ecf.osgi.services.remoteserviceadmin.TopologyManagerImpl$1.run(TopologyManagerImpl.java:193)
> 
>     at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean cannot be found by
> org.eclipse.ecf.provider.cxf.server_1.8.1.201911051602
>     at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:511)
> 
>     at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
> 
>     at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
> 
>     at
> org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
> 
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>     ... 10 more
> 
> I see that for the CXF Karaf features multiple start-levels are used for
> CXF bundles and dependencies...are exceptions such as the above due to
> not having the correct start-levels imposed by the bndtools launcher?  
> If not that, do others have insights as to what's going wrong?
> 
> When I use these same bundles with other launchers (such as the equinox
> launcher) things work ok.
> 
> Thanksinadvance for any insights.
> 
> Scott
> 
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com