New topic in forum Eclipse Communications Framework (ECF), called ECF r-osgi : NPEs in proxies during startup, by erwin de ley

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

New topic in forum Eclipse Communications Framework (ECF), called ECF r-osgi : NPEs in proxies during startup, by erwin de ley

forums-noreply
Eclipse Community Forums
Subject: ECF r-osgi : NPEs in proxies during startup Author: erwin de ley Date: Fri, 20 May 2016 10:54
When using the r_osgi provider (3.5.300.v20160405-1820), we always get NPEs from inside the generated proxies when starting the consumer application.

And then some time later the proxy gets in order.

Does this ring a bell for someone?

thanks!
erwin & yannick

Some detailed info :

We have a service that implements 2 interfaces : an IRestService and an IDataSourceService. In the DS config we try to only export the IDataSourceService interface :

<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="DataSourceService">
   <implementation class="com.isencia.passerelle.edm.datasource.service.impl.DataSourceService"/>
   <service>
      <provide interface="com.isencia.sherpa.rs.IRestService"/>
      <provide interface="com.isencia.passerelle.edm.datasource.service.IDataSourceService"/>
   </service>
   <property name="service.exported.interfaces" type="String" value="com.isencia.passerelle.edm.datasource.service.IDataSourceService"/>
   <property name="service.exported.configs" type="String" value="ecf.r_osgi.peer"/>
</scr:component>


This seems to be picked up correctly for the r_osgi bundle :

osgi>services (objectClass="com.isencia.passerelle.edm.datasource.service.IDataSourceService")
{com.isencia.sherpa.rs.IRestService, com.isencia.passerelle.edm.datasource.service.IDataSourceService}={component.name=DataSourceService, component.id=58, service.exported.configs=ecf.r_osgi.peer, service.exported.interfaces=com.isencia.passerelle.edm.datasource.service.IDataSourceService, service.id=126}
  "Registered by bundle:" com.isencia.passerelle.edm.datasource.service.impl_3.0.5.qualifier [189]
  "Bundles using service"
    com.isencia.sherpa.rs_6.12.4.qualifier [71]
    org.eclipse.ecf.osgi.services.remoteserviceadmin_4.4.0.v20160405-1820 [123]
    org.eclipse.ecf.provider.r_osgi_3.5.300.v20160405-1820 [74]
{com.isencia.passerelle.edm.datasource.service.IDataSourceService}={component.name=DataSourceService, ecf.rsvc.id=155, ecf.rsvc.ranking=0, service.remote.registration=true, ecf.rsvc.cid=r-osgi://Yannick-PC:9278, ecf.robjectClass=[com.isencia.passerelle.edm.datasource.service.IDataSourceService], component.id=58, service.id=155}
  "Registered by bundle:" com.isencia.passerelle.edm.datasource.service.impl_3.0.5.qualifier [189]
  "Bundles using service"
    ch.ethz.iks.r_osgi.remote_1.0.5.RC1_v20160405-1820 [182]


But during the startup we get NPEs in generated proxies for both interfaces :

!SESSION 2016-05-12 10:24:53.779 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_79
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Framework arguments: -product com.isencia.passerelle.edm.datasource.consumer.product
Command-line arguments: -product com.isencia.passerelle.edm.datasource.consumer.product -data C:\Users\visyan\workspace-passerelle-edm/../runtime-datasourceservice.consumer.ecf.local.product -dev file:C:/Users/visyan/workspace-passerelle-edm/.metadata/.plugins/org.eclipse.pde.core/datasourceservice.consumer.ecf.local.product/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -console

!ENTRY R-OSGi Proxy Bundle generated for Endpoint <a href="r-osgi://169.254.254.194:9278#218">r-osgi://169.254.254.194:9278#218 4 0 2016-05-12 10:24:54.437
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Exception in proxy.bgjocfeocfeobje_jchicbi.com.isencia.sherpa.rs.IRestServiceImpl.start() of bundle R-OSGi Proxy Bundle generated for Endpoint <a href="r-osgi://169.254.254.194:9278#218.">r-osgi://169.254.254.194:9278#218.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.NullPointerException: A null service reference is not allowed.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:586)
at proxy.bgjocfeocfeobje_jchicbi.com.isencia.sherpa.rs.IRestServiceImpl.start(Unknown Source)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
... 12 more
Root exception:
java.lang.NullPointerException: A null service reference is not allowed.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:586)
at proxy.bgjocfeocfeobje_jchicbi.com.isencia.sherpa.rs.IRestServiceImpl.start(Unknown Source)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY R-OSGi Proxy Bundle generated for Endpoint <a href="r-osgi://YANNICK-PC:9278#218">r-osgi://YANNICK-PC:9278#218 4 0 2016-05-12 10:24:54.440
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Exception in proxy.YANNICK_PC_jchicbi.com.isencia.passerelle.edm.datasource.service.IDataSourceServiceImpl.start() of bundle R-OSGi Proxy Bundle generated for Endpoint <a href="r-osgi://YANNICK-PC:9278#218.">r-osgi://YANNICK-PC:9278#218.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.NullPointerException: A null service reference is not allowed.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:586)
at proxy.YANNICK_PC_jchicbi.com.isencia.passerelle.edm.datasource.service.IDataSourceServiceImpl.start(Unknown Source)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
... 12 more
Root exception:
java.lang.NullPointerException: A null service reference is not allowed.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:586)
at proxy.YANNICK_PC_jchicbi.com.isencia.passerelle.edm.datasource.service.IDataSourceServiceImpl.start(Unknown Source)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
WARNING: Port 9278 already in use. This instance of R-OSGi is running on port 9279

!ENTRY org.eclipse.equinox.ds 4 0 2016-05-12 10:24:55.186
!MESSAGE Could not bind a reference of component com.isencia.passerelle.edm.datasource.consumer. The reference is: Reference[name = IDataSourceService, interface = com.isencia.passerelle.edm.datasource.service.IDataSourceService, policy = dynamic, cardinality = 0..n, target = null, bind = bindDataSourceService, unbind = null]

!ENTRY org.eclipse.equinox.ds 4 0 2016-05-12 10:24:55.188
!MESSAGE Could not bind a reference of component com.isencia.passerelle.edm.datasource.consumer. The reference is: Reference[name = IDataSourceService, interface = com.isencia.passerelle.edm.datasource.service.IDataSourceService, policy = dynamic, cardinality = 0..n, target = null, bind = bindDataSourceService, unbind = null]

And then, after a minute or two, our consumer can start using the proxy after all to start pushing data (which is the thing our service allows) :
osgi> 2016-05-12 10:26:41 INFO  DataSourceServiceComponent:27 - Got proxy IDataSourceService=proxy.Yannick_PC_jchibff.com.isencia.passerelle.edm.datasource.service.IDataSourceServiceImpl@5abcfadd
2016-05-12 10:26:41 INFO  DataSourceServiceComponent:29 - Starting remote call via proxy...
2016-05-12 10:26:41 INFO  DataSourceServiceComponent:44 - Published value1: 72

[ Reply ][ Quote ][ View Topic/Message ][ Unsubscribe from this forum ]

_______________________________________________
ecf-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ecf-dev
Loading...