You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Christian Schneider (JIRA)" <ji...@apache.org> on 2017/07/11 08:40:00 UTC

[jira] [Commented] (DOSGI-259) java.lang.NoClassDefFoundError when updating Implementation bundle

    [ https://issues.apache.org/jira/browse/DOSGI-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16081874#comment-16081874 ] 

Christian Schneider commented on DOSGI-259:
-------------------------------------------

Maybe the issue is a missing refresh. When you redeploy the api bundle then the bundles wired to this bundle will not be rewired automatically. You need to use the refresh command to wire to the new API.
You also have to make sure that all resources your classes use are closed when your DS component is deactivated.

Do you think this is an issue in DOSGi or can I close this issue? If it is an issue in DOSGi I would need an example project and steps to reproduce the error.

> java.lang.NoClassDefFoundError when updating Implementation bundle
> ------------------------------------------------------------------
>
>                 Key: DOSGI-259
>                 URL: https://issues.apache.org/jira/browse/DOSGI-259
>             Project: CXF Distributed OSGi
>          Issue Type: Bug
>          Components: provider-rs
>    Affects Versions: 2.1.0
>         Environment: Debian Linux
>            Reporter: Ivo Leitão
>
> Good Morning,
> I've created a simple service to test the capabilities of the cxf implementation of dosgi. This service retrieves data from a soap service and publishes it as a rest service via DOSGI.
> Currently  I have an API bundle with
> Require-Capability: \
> 	compile-only
> which houses the interfaces and the DTO's (naked DTO's per description of Peter Kriens in http://enroute.osgi.org/appnotes/dtos.html).
> In the implementation bundle which exports the API I have a simple implementation of the service. All works well except the redeployment of the bundle. I'm using apache karaf (4.1) and a sling plugin (http://sling.apache.org/components/maven-sling-plugin/install-mojo.html) to easily redeploy the bundles in a running karaf instance from maven (I don't think its related). Every time I redeploy the implementation bundle I'm seeing the error bellow.
> It works despite this error but it seems that bundle redeployment is not correctly handled. I've tried also with an explicit deployment of the API and Implementation bundle and I have the same problem in the implementation bundle upon redeployment
> Exception in thread "pool-33-thread-3" java.lang.NoClassDefFoundError: com/acme/platform/samples/modules/geoip/api/dto/ResolvedCountryDTO
> 	at java.lang.Class.getDeclaredMethods0(Native Method)
> 	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
> 	at java.lang.Class.privateGetPublicMethods(Class.java:2902)
> 	at java.lang.Class.getMethods(Class.java:1615)
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.findContextSetterMethods(AbstractResourceInfo.java:250)
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.findContexts(AbstractResourceInfo.java:113)
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.<init>(AbstractResourceInfo.java:106)
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.<init>(AbstractResourceInfo.java:91)
> 	at org.apache.cxf.jaxrs.model.BeanResourceInfo.<init>(BeanResourceInfo.java:47)
> 	at org.apache.cxf.jaxrs.model.ClassResourceInfo.<init>(ClassResourceInfo.java:87)
> 	at org.apache.cxf.jaxrs.utils.ResourceUtils.createClassResourceInfo(ResourceUtils.java:285)
> 	at org.apache.cxf.jaxrs.utils.ResourceUtils.createClassResourceInfo(ResourceUtils.java:276)
> 	at org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.createResourceInfo(JAXRSServiceFactoryBean.java:208)
> 	at org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.setResourceClasses(JAXRSServiceFactoryBean.java:168)
> 	at org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.setResourceClasses(JAXRSServiceFactoryBean.java:217)
> 	at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.setServiceClass(JAXRSServerFactoryBean.java:292)
> 	at org.apache.cxf.dosgi.dsw.handlers.rest.RsProvider.createServerFactory(RsProvider.java:199)
> 	at org.apache.cxf.dosgi.dsw.handlers.rest.RsProvider.exportService(RsProvider.java:140)
> 	at org.apache.aries.rsa.core.RemoteServiceAdminCore.exportService(RemoteServiceAdminCore.java:208)
> 	at org.apache.aries.rsa.core.RemoteServiceAdminCore.exportService(RemoteServiceAdminCore.java:117)
> 	at org.apache.aries.rsa.core.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:57)
> 	at org.apache.aries.rsa.core.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:55)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at org.apache.aries.rsa.core.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:55)
> 	at org.apache.aries.rsa.core.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:39)
> 	at org.apache.aries.rsa.topologymanager.exporter.TopologyManagerExport.exportServiceUsingRemoteServiceAdmin(TopologyManagerExport.java:155)
> 	at org.apache.aries.rsa.topologymanager.exporter.TopologyManagerExport.doExport(TopologyManagerExport.java:126)
> 	at org.apache.aries.rsa.topologymanager.exporter.TopologyManagerExport.access$000(TopologyManagerExport.java:54)
> 	at org.apache.aries.rsa.topologymanager.exporter.TopologyManagerExport$1.run(TopologyManagerExport.java:98)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.ClassNotFoundException: Unable to load class 'com.acme.platform.samples.modules.geoip.api.dto.ResolvedCountryDTO' because the bundle wiring for com.celfocus.platform.samples.modules.geoip-ri is no longer valid.
> 	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1539)
> 	at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
> 	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> 	... 32 more 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)