[jboss-osgi-issues] [JBoss JIRA] Issue Comment Edited: (JBOSGI-348) EventAdmin unexpectedly unregistered in Runtime

Thomas Diesler (JIRA) jira-events at lists.jboss.org
Fri Jun 18 07:37:46 EDT 2010


    [ https://jira.jboss.org/browse/JBOSGI-348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12536296#action_12536296 ] 

Thomas Diesler edited comment on JBOSGI-348 at 6/18/10 7:37 AM:
----------------------------------------------------------------

In EventAdmin Configuration

            Object service = new ManagedService()
            {
                public synchronized void updated( Dictionary properties ) throws ConfigurationException
                {
                    configure( properties );
                    stop();
                    start();
                }
            };

The call to stop() does not return in a timely manner (i.e. it may take > 40sec). This is because the asyncronous thread pool cannot be closed properly. This condition occurs when eventadmin is started before configadmin

As a workaround we add the config admin to the aut-start bundles

    <property name="autoStart">
     <list elementClass="java.net.URL">
      <value>${osgi.home}/server/minimal/deploy/org.apache.felix.log.jar</value>
      <value>${osgi.home}/server/minimal/deploy/jboss-osgi-common.jar</value>
      <value>${osgi.home}/server/minimal/deploy/jboss-osgi-hotdeploy.jar</value>
      <value>${osgi.server.home}/deploy/org.apache.felix.configadmin.jar</value>
     </list>
    </property>



      was (Author: thomas.diesler at jboss.com):
    In EventAdmin Configuration

            Object service = new ManagedService()
            {
                public synchronized void updated( Dictionary properties ) throws ConfigurationException
                {
                    configure( properties );
                    stop();
                    start();
                }
            };

The call to stop() does not return in a timely manner (i.e. it may take > 40sec). This is because the asyncronous thread pool cannot be closed properly
This condition occurs when eventadmin is started before configadmin

As a workaround we add the config admin to the aut-start bundles

    <property name="autoStart">
     <list elementClass="java.net.URL">
      <value>${osgi.home}/server/minimal/deploy/org.apache.felix.log.jar</value>
      <value>${osgi.home}/server/minimal/deploy/jboss-osgi-common.jar</value>
      <value>${osgi.home}/server/minimal/deploy/jboss-osgi-hotdeploy.jar</value>
      <value>${osgi.server.home}/deploy/org.apache.felix.configadmin.jar</value>
     </list>
    </property>


  
> EventAdmin unexpectedly unregistered in Runtime
> -----------------------------------------------
>
>                 Key: JBOSGI-348
>                 URL: https://jira.jboss.org/browse/JBOSGI-348
>             Project: JBoss OSGi
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>            Reporter: Thomas Diesler
>            Assignee: Thomas Diesler
>             Fix For: JBossOSGi 1.0.0 Beta8
>
>
> The EventAdminTestCase.testEventHandler fails consistently in the Hudson remote Runtime test with 
> {code}
> java.lang.IllegalArgumentException: Null reference
> 	at org.jboss.osgi.framework.bundle.ServiceManagerPluginImpl.getService(ServiceManagerPluginImpl.java:195)
> 	at org.jboss.osgi.framework.bundle.AbstractBundleState.getService(AbstractBundleState.java:521)
> 	at org.jboss.osgi.framework.bundle.OSGiBundleContextWrapper.getService(OSGiBundleContextWrapper.java:145)
> 	at org.jboss.test.osgi.example.event.EventAdminTestCase.testEventHandler(EventAdminTestCase.java:106)
> {code}
> The reason is that the EventAdmin service is not registered. When I enable TRACE logging I see
> {quote}
> [tdiesler at tdbell jbosgi]$ cat ~/Desktop/server.log | grep org.osgi.service.event.EventAdmin | grep REGISTER
> 2010-06-18 10:44:04,991 DEBUG [org.jboss.osgi.framework.plugins.internal.FrameworkEventsPluginImpl] Service REGISTERED: Service{id=85,classes=[org.osgi.service.event.EventAdmin]}
> 2010-06-18 10:44:05,107 DEBUG [org.jboss.osgi.framework.plugins.internal.FrameworkEventsPluginImpl] Service UNREGISTERING: Service{id=85,classes=[org.osgi.service.event.EventAdmin]}
> 2010-06-18 10:45:05,221 DEBUG [org.jboss.osgi.framework.plugins.internal.FrameworkEventsPluginImpl] Service REGISTERED: Service{id=112,classes=[org.osgi.service.event.EventAdmin]}
> [tdiesler at tdbell jbosgi]$ cat ~/Desktop/server.log | grep getServiceReference | grep org.osgi.service.event.EventAdmin
> 2010-06-18 10:44:04,264 TRACE [org.jboss.osgi.framework.bundle.ServiceManagerPluginImpl] getServiceReferences(Bundle{jboss-osgi-blueprint-1.0.0.Beta2},org.osgi.service.event.EventAdmin,null,true)
> 2010-06-18 10:44:41,167 TRACE [org.jboss.osgi.framework.bundle.ServiceManagerPluginImpl] getServiceReferences(Bundle{system.bundle-0.0.0},org.osgi.service.event.EventAdmin,null,true)
> 2010-06-18 10:44:41,852 TRACE [org.jboss.osgi.framework.bundle.ServiceManagerPluginImpl] getServiceReferences(Bundle{example-event-0.0.0},org.osgi.service.event.EventAdmin,null,true)
> {quote}
> In the log I also see
> 2010-06-18 10:44:05,107 DEBUG [org.jboss.osgi.framework.plugins.internal.FrameworkEventsPluginImpl] Service UNREGISTERING: Service{id=85,classes=[org.osgi.service.event.EventAdmin]}
> 2010-06-18 10:44:05,108 TRACE [org.jboss.osgi.framework.bundle.ServiceManagerPluginImpl] getServiceReferences(Bundle{org.apache.felix.eventadmin-1.2.2},org.osgi.framework.hooks.service.FindHook,null,true)
> 2010-06-18 10:44:05,108 TRACE [org.jboss.osgi.framework.bundle.ServiceManagerPluginImpl] Considered contexts: : 108
> 2010-06-18 10:44:05,107 DEBUG [org.apache.felix.configadmin] Running task ManagedService Update: pid=org.apache.felix.eventadmin.impl.EventAdmin
> 2010-06-18 10:44:05,113 TRACE [org.jboss.osgi.framework.bundle.ServiceManagerPluginImpl] Remaining contexts: : 0

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-osgi-issues mailing list