I have created a simple Dynamic Web application and used the OSGi Facet also on it.
If I deploy this on SAP Hana Cloud Local runtime : I see that the bundles start/stop are called multiple times on application startup.
I have also marked these Activators as singleton, even then start/stop are called multiple times.
Note : On the actual Cloud Env its only called once. I believe this is the correct behavior.
What should I expect to be the right behavior?
I have attached my projects, you could just import the two OSGi Bundle projects into eclipse and deploy the osgiTest project, which will refer the other OSGi project.
rename the attachment to something.rar
2013 07 13 11:58:05#+0530#ERROR#com.guru.osgi1.Osgi1Activator##anonymous#RMI TCP Connection(2)-127.0.0.1###Starting OSGI1 service|
2013 07 13 11:58:05#+0530#ERROR#com.guru.osgi1.Osgi1Activator##anonymous#RMI TCP Connection(2)-127.0.0.1###stopping OSGI2 service|
2013 07 13 11:58:05#+0530#ERROR#com.guru.osgi1.Osgi1Activator##anonymous#RMI TCP Connection(2)-127.0.0.1###Starting OSGI1 service|
2013 07 13 11:58:05#+0530#ERROR#com.guru.osgi1.Osgi1Activator##anonymous#Refresh Packages###stopping OSGI2 service|
2013 07 13 11:58:05#+0530#ERROR#com.guru.osgi1.Osgi1Activator##anonymous#Refresh Packages###Starting OSGI1 service|
2013 07 13 11:58:06#+0530#ERROR#com.guru.osgi1.Osgi1Activator##anonymous#Refresh Packages###stopping OSGI2 service|
2013 07 13 11:58:06#+0530#ERROR#com.guru.osgi1.Osgi1Activator##anonymous#Refresh Packages###Starting OSGI1 service|
2013 07 13 11:58:06#+0530#ERROR#com.osgiTest.guru.TestActivate##anonymous#RMI TCP Connection(2)-127.0.0.1###1 Starting TestActivate org.eclipse.osgi.framework.internal.core.BundleContextImpl@6a08fc76 : helloHWWWW|
2013 07 13 11:58:18#+0530#ERROR#com.osgiTest.guru.TestActivate##anonymous#Refresh Packages###1 Stopped TestActivate org.eclipse.osgi.framework.internal.core.BundleContextImpl@6a08fc76hello|
2013 07 13 11:58:18#+0530#ERROR#com.osgiTest.guru.TestActivate##anonymous#Refresh Packages###1 Starting TestActivate org.eclipse.osgi.framework.internal.core.BundleContextImpl@46ac91ad : helloHWWWW|
2013 07 13 11:58:25#+0530#ERROR#com.osgiTest.guru.TestActivate##anonymous#Refresh Packages###1 Stopped TestActivate org.eclipse.osgi.framework.internal.core.BundleContextImpl@46ac91adhello|
2013 07 13 11:58:25#+0530#ERROR#com.osgiTest.guru.TestActivate##anonymous#Refresh Packages###1 Starting TestActivate org.eclipse.osgi.framework.internal.core.BundleContextImpl@f8c8202 : helloHWWWW|
2013 07 13 11:58:32#+0530#ERROR#com.osgiTest.guru.TestActivate##anonymous#Refresh Packages###1 Stopped TestActivate org.eclipse.osgi.framework.internal.core.BundleContextImpl@f8c8202hello|
2013 07 13 11:58:32#+0530#ERROR#com.guru.osgi1.Osgi1Activator##anonymous#Refresh Packages###stopping OSGI2 service|
2013 07 13 11:58:32#+0530#ERROR#com.guru.osgi1.Osgi1Activator##anonymous#Refresh Packages###Starting OSGI1 service|
2013 07 13 11:58:32#+0530#ERROR#com.osgiTest.guru.TestActivate##anonymous#Refresh Packages###1 Starting TestActivate org.eclipse.osgi.framework.internal.core.BundleContextImpl@4307de77 : helloHWWWW|