Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317242

Summary: "java.lang.IllegalStateException: The EventAdmin is stopped" on shutdown of Virgo
Product: [RT] Virgo Reporter: George Calm <georgecalm>
Component: unknownAssignee: Glyn Normington <glyn.normington>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: glyn.normington
Version: unspecified   
Target Milestone: 2.1.0.M05-incubation   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 310219    
Bug Blocks:    
Attachments:
Description Flags
Log. From startup to shutdown, with exception. none

Description George Calm CLA 2010-06-17 16:46:55 EDT
Build Identifier: 2.1.0.M01

When Virgo is shutdown using "vsh shutdown" or Ctl+C, the following error appears in the serviceability/logs/log.log:

Could not succesfully close context OsgiBundleXmlApplicationContext(bundle=org.eclipse.virgo.apps.repository-2.1.0.M01-org.eclipse.virgo.apps.repository.core, config=osgibundle:/META-INF/spring/*.xml): startup date [Thu Jun 17 16:28:21 EDT 2010]; root of context hierarchy java.lang.IllegalStateException: The EventAdmin is stopped

This same error appears in the previous versions of Spring DM, and was reported before here: (https://issuetracker.springsource.com/browse/DMS-2153).


Reproducible: Always

Steps to Reproduce:
1. Download a fresh copy of virgo-web-server 
2. Start the server using "startup.sh -clean"
3. Either press Ctr+C to shutdown, or telnet into the console and type "vsh shutdown" to shutdown the server
4. Check the log for the exception
Comment 1 George Calm CLA 2010-06-17 16:49:20 EDT
Created attachment 172160 [details]
Log. From startup to shutdown, with exception.
Comment 2 Glyn Normington CLA 2010-06-18 02:34:50 EDT
Thanks for reporting this George. We have given this issue no cycles so far because it is completely benign. However, I agree it would be good to fix in due course just to avoid the distraction in the log when diagnosing other issues. Perhaps we should revisit this after Virgo has switched to using Equinox event admin as the problem may just go away. With that in mind, I'm linking this bug to the Equinox event admin requirement.
Comment 3 Glyn Normington CLA 2010-09-22 10:34:01 EDT
I think I have a reasonable compromise for now. We absorb the exception and issue a log message:

Failed to send event to topic 'org/osgi/service/blueprint/container/DESTROYED'. Exception message: 'The EventAdmin is stopped'. This may be expected during shutdown. Turn on debug logging for more details.

If you turn on debug logging, you get the full stack trace as before:

Failed to send event to topic 'org/osgi/service/blueprint/container/DESTROYED'. This may be expected during shutdown. java.lang.IllegalStateException: The EventAdmin is stopped
	at org.apache.felix.eventadmin.impl.EventAdminImpl$1.createHandlerTasks(EventAdminImpl.java:128)
	at org.apache.felix.eventadmin.impl.EventAdminImpl.sendEvent(EventAdminImpl.java:101)
	at org.apache.felix.eventadmin.impl.security.EventAdminSecurityDecorator.sendEvent(EventAdminSecurityDecorator.java:102)
	at org.eclipse.virgo.kernel.agent.dm.internal.BlueprintEventPostingOsgiBundleApplicationContextListener.sendEvent(BlueprintEventPostingOsgiBundleApplicationContextListener.java:216)
<etc>
Comment 4 Glyn Normington CLA 2010-09-27 08:34:34 EDT
RC1 is planned instead of milestone 5.