SMX4 deployer fails to redeploy service units that use ApplicationContextAware
------------------------------------------------------------------------------

                 Key: SMX4-360
                 URL: https://issues.apache.org/activemq/browse/SMX4-360
             Project: ServiceMix 4
          Issue Type: Bug
          Components: Bundles
    Affects Versions: 4.0.0
         Environment: Fuse ESB 4.1.0.2, Windows XP.
            Reporter: Ryan Moquin
            Priority: Critical


I created a very simple example to illustrate a problem I've ran into with the 
following error:

"BeanFactory not initialized or already closed - call 'refresh' before 
accessing beans via the ApplicationContext"

Basically, I created a Service Engine from the maven2 archetype.  The only 
thing I added, was to make it implement ApplicationContextAware.  I added an 
applicationContext variable and a setter for it.  I then overrided the start() 
method in the Service Engine:

public synchronized void start() throws Exception {
    super.start();
    applicationContext.getBean(SomeClass.class.getName());
  }

I had created a SomeClass class in the service engine that simply has one 
property on it, which I obviously load in the start() method.

I then created a service unit for the service engine and added an entry for the 
SomeClass class:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0";
       xmlns:my="http://com.test/1.0";
       xmlns:test="urn:test">

       <my:endpoint service="test:service" endpoint="endpoint" />
       <my:someClass someProp="whatever"/>
</beans>

When I deploy the service engine and service unit from a fresh unzip of the 
Fuse ESB 4.1.0.2 zip, everything starts up as I expect.  If I shut down Fuse 
ESB 4.1 and then restart it, the service unit cannot be started up properly due 
to the following error:

BeanFactory not initialized or already closed

To me this seems like a bug since I shouldn't get this error when the service 
unit starts up again.  I have a simple se and su that can be used to reproduce 
the issue, I just need to know where to file it.  The following is the relevant 
piece of the log and error when restarting Fuse ESB 4.1.  It seems to me like 
the restart is kind of chaotic.. like it restarts the SE and SU properly, but 
then decides it needs to redeploy it which is where everything goes down hill.  
The SE and SU deployment bundles were not updated in the restart, so I guess 
maybe the issue is that the SU starts up without any issues, but then gets 
shutdown and restarted at which point it can't restart, the pieces of the log 
to look at are the "test-se" and "bridge-test-sa":

11:47:38,390 | INFO  | pool-1-thread-1  | FileMonitor                      | 
x.kernel.filemonitor.FileMonitor  374 | Deploying: 
C:\ios\apache-servicemix-4.1.0.2-fuse\data\generated-bundles\test-se-1.0-SNAPSHOT-installer.jar
11:47:38,406 | WARN  | pool-1-thread-1  | FileMonitor                      | 
x.kernel.filemonitor.FileMonitor  272 | Unsupported deployment: 
C:\ios\apache-servicemix-4.1.0.2-fuse\etc\startup.properties
11:47:38,406 | WARN  | pool-1-thread-1  | FileMonitor                      | 
x.kernel.filemonitor.FileMonitor  272 | Unsupported deployment: 
C:\ios\apache-servicemix-4.1.0.2-fuse\etc\java.util.logging.properties
11:47:38,406 | INFO  | pool-1-thread-1  | ServiceAssemblyImpl              | 
er.artifacts.ServiceAssemblyImpl  269 | Changing SA state to Stopped
11:47:38,484 | INFO  | pool-1-thread-1  | ServiceAssemblyImpl              | 
er.artifacts.ServiceAssemblyImpl  269 | Changing SA state to Shutdown
11:47:38,484 | INFO  | pool-1-thread-1  | ManagementEndpointRegistry       | 
ement.ManagementEndpointRegistry   75 | Unregistering endpoint: 
org.apache.servicemix.nmr.core.internalendpointwrap...@ac7c874a with properties 
{ENDPOINT_NAME=endpoint, jbi.internal=true, NAME={urn:test}service:endpoint, 
objectClass=[Ljava.lang.String;@19ad677, service.id=125, 
SERVICE_NAME={urn:test}service}
11:47:38,921 | INFO  | pool-1-thread-1  | FileSystemXmlApplicationContext  | 
pport.AbstractApplicationContext  815 | Closing 
org.apache.xbean.spring.context.filesystemxmlapplicationcont...@1edc67e: 
display name 
[org.apache.xbean.spring.context.filesystemxmlapplicationcont...@1edc67e]; 
startup date [Sat Sep 05 11:47:35 EDT 2009]; root of context hierarchy
11:47:38,921 | INFO  | pool-1-thread-1  | DefaultListableBeanFactory       | 
ort.DefaultSingletonBeanRegistry  421 | Destroying singletons in 
org.springframework.beans.factory.support.defaultlistablebeanfact...@44ec30: 
defining beans [com.test.MyEndpoint#0,com.test.SomeClass#0]; parent: 
org.apache.servicemix.common.xbean.simplebeanfact...@8896cf
11:47:38,937 | INFO  | xtenderThread-66 | ManagementEndpointRegistry       | 
ement.ManagementEndpointRegistry   64 | Registering endpoint: 
org.apache.servicemix.nmr.core.internalendpointwrap...@2e4cc455 with properties 
{ENDPOINT_NAME=Broker, 
INTERFACE_NAME={http://docs.oasis-open.org/wsn/bw-2}CreatePullPoint, 
jbi.internal=true, 
NAME={http://servicemix.org/wsnotification}CreatePullPoint:Broker, 
objectClass=[Ljava.lang.String;@199f62e, service.id=190, 
SERVICE_NAME={http://servicemix.org/wsnotification}CreatePullPoint, 
WSDL_URL=document:3}
11:47:38,953 | INFO  | xtenderThread-66 | OsgiBundleXmlApplicationContext  | 
ractOsgiBundleApplicationContext  345 | Not publishing application context OSGi 
service for bundle ServiceMix :: WS-Notification Service Engine 
(servicemix-wsn2005)
11:47:39,328 | INFO  | pool-1-thread-1  | FileSystemXmlApplicationContext  | 
pport.AbstractApplicationContext  411 | Refreshing 
org.apache.xbean.spring.context.filesystemxmlapplicationcont...@67d193: display 
name [org.apache.xbean.spring.context.filesystemxmlapplicationcont...@67d193]; 
startup date [Sat Sep 05 11:47:39 EDT 2009]; root of context hierarchy
11:47:39,328 | INFO  | pool-1-thread-1  | XBeanXmlBeanDefinitionReader     | 
tory.xml.XmlBeanDefinitionReader  323 | Loading XML bean definitions from file 
[C:\ios\apache-servicemix-4.1.0.2-fuse\data\jbi\bridge-test-sa\sus\test-su\xbean.xml]
11:47:39,359 | INFO  | pool-1-thread-1  | FileSystemXmlApplicationContext  | 
pport.AbstractApplicationContext  426 | Bean factory for application context 
[org.apache.xbean.spring.context.filesystemxmlapplicationcont...@67d193]: 
org.springframework.beans.factory.support.defaultlistablebeanfact...@adfa2c
11:47:39,359 | INFO  | pool-1-thread-1  | DefaultListableBeanFactory       | 
pport.DefaultListableBeanFactory  414 | Pre-instantiating singletons in 
org.springframework.beans.factory.support.defaultlistablebeanfact...@adfa2c: 
defining beans [com.test.MyEndpoint#0,com.test.SomeClass#0]; parent: 
org.apache.servicemix.common.xbean.simplebeanfact...@25a649
11:47:39,359 | INFO  | pool-1-thread-1  | ServiceAssemblyImpl              | 
er.artifacts.ServiceAssemblyImpl  269 | Changing SA state to Stopped
11:47:39,359 | INFO  | pool-1-thread-1  | ManagementEndpointRegistry       | 
ement.ManagementEndpointRegistry   64 | Registering endpoint: 
org.apache.servicemix.nmr.core.internalendpointwrap...@f289ef15 with properties 
{ENDPOINT_NAME=endpoint, jbi.internal=true, NAME={urn:test}service:endpoint, 
objectClass=[Ljava.lang.String;@158b812, service.id=192, 
SERVICE_NAME={urn:test}service}
11:47:39,375 | INFO  | pool-1-thread-1  | ServiceAssemblyImpl              | 
er.artifacts.ServiceAssemblyImpl  269 | Changing SA state to Started
11:47:39,375 | INFO  | pool-1-thread-1  | FileMonitor                      | 
x.kernel.filemonitor.FileMonitor  541 | Updated: bridge-test-sa [90]
11:47:39,375 | INFO  | pool-1-thread-1  | ComponentImpl                    | 
deployer.artifacts.ComponentImpl  154 | Stopping component test-se
11:47:39,375 | INFO  | pool-1-thread-1  | ServiceAssemblyImpl              | 
er.artifacts.ServiceAssemblyImpl  269 | Changing SA state to Stopped
11:47:39,375 | INFO  | pool-1-thread-1  | ComponentImpl                    | 
deployer.artifacts.ComponentImpl  176 | Shutting down component test-se
11:47:39,375 | INFO  | pool-1-thread-1  | ServiceAssemblyImpl              | 
er.artifacts.ServiceAssemblyImpl  269 | Changing SA state to Shutdown
11:47:39,375 | INFO  | pool-1-thread-1  | ManagementEndpointRegistry       | 
ement.ManagementEndpointRegistry   75 | Unregistering endpoint: 
org.apache.servicemix.nmr.core.internalendpointwrap...@f289ef15 with properties 
{ENDPOINT_NAME=endpoint, jbi.internal=true, NAME={urn:test}service:endpoint, 
objectClass=[Ljava.lang.String;@158b812, service.id=192, 
SERVICE_NAME={urn:test}service}
11:47:39,375 | INFO  | pool-1-thread-1  | FileSystemXmlApplicationContext  | 
pport.AbstractApplicationContext  815 | Closing 
org.apache.xbean.spring.context.filesystemxmlapplicationcont...@67d193: display 
name [org.apache.xbean.spring.context.filesystemxmlapplicationcont...@67d193]; 
startup date [Sat Sep 05 11:47:39 EDT 2009]; root of context hierarchy
11:47:39,375 | INFO  | pool-1-thread-1  | DefaultListableBeanFactory       | 
ort.DefaultSingletonBeanRegistry  421 | Destroying singletons in 
org.springframework.beans.factory.support.defaultlistablebeanfact...@adfa2c: 
defining beans [com.test.MyEndpoint#0,com.test.SomeClass#0]; parent: 
org.apache.servicemix.common.xbean.simplebeanfact...@25a649
11:47:39,390 | INFO  | pool-1-thread-1  | ComponentRegistryImpl            | 
ntime.impl.ComponentRegistryImpl  115 | JBI component unregistered with 
properties: {NAME=test-se, objectClass=[Ljava.lang.String;@17d2d70, 
service.id=104, TYPE=service-engine}
11:47:39,390 | INFO  | pool-1-thread-1  | ManagementEndpointRegistry       | 
ement.ManagementEndpointRegistry   75 | Unregistering endpoint: 
org.apache.servicemix.nmr.core.internalendpointwrap...@1bb3aa47 with properties 
{NAME=test-se, objectClass=[Ljava.lang.String;@2e749c, service.id=107, 
TYPE=service-engine}
11:47:39,390 | INFO  | pool-1-thread-1  | ComponentImpl                    | 
deployer.artifacts.ComponentImpl  154 | Stopping component test-se
11:47:39,390 | INFO  | pool-1-thread-1  | ComponentImpl                    | 
deployer.artifacts.ComponentImpl  176 | Shutting down component test-se
11:47:39,687 | INFO  | pool-1-thread-1  | ComponentRegistryImpl            | 
ntime.impl.ComponentRegistryImpl   91 | JBI component registered with 
properties: {NAME=test-se, objectClass=[Ljava.lang.String;@1a6d5e1, 
service.id=194, TYPE=service-engine}
11:47:39,687 | INFO  | pool-1-thread-1  | ManagementEndpointRegistry       | 
ement.ManagementEndpointRegistry   64 | Registering endpoint: 
org.apache.servicemix.nmr.core.internalendpointwrap...@c4fe1acb with properties 
{NAME=test-se, objectClass=[Ljava.lang.String;@1e6b200, service.id=196, 
TYPE=service-engine}
11:47:39,703 | INFO  | pool-1-thread-1  | ServiceAssemblyImpl              | 
er.artifacts.ServiceAssemblyImpl  269 | Changing SA state to Stopped
11:47:39,703 | INFO  | pool-1-thread-1  | ManagementEndpointRegistry       | 
ement.ManagementEndpointRegistry   64 | Registering endpoint: 
org.apache.servicemix.nmr.core.internalendpointwrap...@639887e0 with properties 
{ENDPOINT_NAME=endpoint, jbi.internal=true, NAME={urn:test}service:endpoint, 
objectClass=[Ljava.lang.String;@a09a08, service.id=198, 
SERVICE_NAME={urn:test}service}
11:47:39,703 | INFO  | pool-1-thread-1  | ServiceAssemblyImpl              | 
er.artifacts.ServiceAssemblyImpl  269 | Changing SA state to Started
11:47:39,703 | ERROR | pool-1-thread-1  | ServiceAssemblyInstaller         | 
er.impl.ServiceAssemblyInstaller  100 | <component-task-result 
xmlns="http://java.sun.com/xml/ns/jbi/management-message";>
    <component-name>test-se</component-name>
    <component-task-result-details>
        <task-result-details>
            <task-id>start</task-id>
            <task-result>FAILED</task-result>
            <message-type>ERROR</message-type>
            <task-status-msg><msg-loc-info><loc-token/><loc-message>Unable to 
start service unit</loc-message></msg-loc-info></task-status-msg>
            <exception-info>
                <nesting-level>1</nesting-level>
                <msg-loc-info>
                    <loc-token />
                    <loc-message>BeanFactory not initialized or already closed 
- call 'refresh' before accessing beans via the ApplicationContext</loc-message>
                    <stack-trace><![CDATA[java.lang.IllegalStateException: 
BeanFactory not initialized or already closed - call 'refresh' before accessing 
beans via the ApplicationContext
    at 
org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:153)
    at 
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
    at com.test.MyEndpoint.start(MyEndpoint.java:42)
    at 
org.apache.servicemix.common.DefaultServiceUnit.start(DefaultServiceUnit.java:78)
    at 
org.apache.servicemix.common.BaseServiceUnitManager.start(BaseServiceUnitManager.java:155)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceUnitImpl.start(ServiceUnitImpl.java:123)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.changeState(ServiceAssemblyImpl.java:298)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.transition(ServiceAssemblyImpl.java:274)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.init(ServiceAssemblyImpl.java:136)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.registerServiceAssembly(Deployer.java:454)
    at 
org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.install(ServiceAssemblyInstaller.java:97)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.checkPendingInstallers(Deployer.java:552)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.lifeCycleChanged(Deployer.java:602)
    at 
org.apache.servicemix.jbi.deployer.artifacts.AbstractLifecycleJbiArtifact.fireEvent(AbstractLifecycleJbiArtifact.java:102)
    at 
org.apache.servicemix.jbi.deployer.artifacts.AbstractLifecycleJbiArtifact.fireEvent(AbstractLifecycleJbiArtifact.java:92)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ComponentImpl$ComponentWrapper.init(ComponentImpl.java:251)
    at 
org.apache.servicemix.jbi.runtime.impl.ComponentRegistryImpl.doRegister(ComponentRegistryImpl.java:97)
    at 
org.apache.servicemix.jbi.runtime.impl.ComponentRegistryImpl.doRegister(ComponentRegistryImpl.java:37)
    at 
org.apache.servicemix.nmr.core.ServiceRegistryImpl.register(ServiceRegistryImpl.java:47)
    at 
org.apache.servicemix.nmr.osgi.OsgiServiceRegistryTracker.addingService(OsgiServiceRegistryTracker.java:79)
    at 
org.osgi.util.tracker.ServiceTracker$Tracked.trackAdding(ServiceTracker.java:1030)
    at 
org.osgi.util.tracker.ServiceTracker$Tracked.track(ServiceTracker.java:1008)
    at 
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:933)
    at 
org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:846)
    at 
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:704)
    at 
org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:635)
    at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3393)
    at org.apache.felix.framework.Felix.access$000(Felix.java:39)
    at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:622)
    at 
org.apache.felix.framework.ServiceRegistry.fireServiceChanged(ServiceRegistry.java:576)
    at 
org.apache.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:86)
    at org.apache.felix.framework.Felix.registerService(Felix.java:2527)
    at 
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:252)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.registerService(Deployer.java:748)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.registerComponent(Deployer.java:437)
    at 
org.apache.servicemix.jbi.deployer.impl.ComponentInstaller.initComponent(ComponentInstaller.java:413)
    at 
org.apache.servicemix.jbi.deployer.impl.ComponentInstaller.install(ComponentInstaller.java:133)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.onBundleStarted(Deployer.java:354)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.bundleChanged(Deployer.java:284)
    at 
org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:771)
    at 
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:700)
    at 
org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:597)
    at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3382)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1517)
    at org.apache.felix.framework.Felix.updateBundle(Felix.java:1703)
    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:788)
    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:775)
    at 
org.apache.servicemix.kernel.filemonitor.FileMonitor.refreshPackagesAndStartOrUpdateBundles(FileMonitor.java:540)
    at 
org.apache.servicemix.kernel.filemonitor.FileMonitor.onFilesChanged(FileMonitor.java:299)
    at 
org.apache.servicemix.kernel.filemonitor.FileMonitor$3$1.run(FileMonitor.java:318)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
]]></stack-trace>
                </msg-loc-info>
            </exception-info>
        </task-result-details>
    </component-task-result-details>
</component-task-result>
11:47:39,703 | WARN  | pool-1-thread-1  | Deployer                         | 
cemix.jbi.deployer.impl.Deployer  557 | Error installing JBI artifact
javax.jbi.JBIException: javax.jbi.management.DeploymentException: 
<component-task-result 
xmlns="http://java.sun.com/xml/ns/jbi/management-message";>
    <component-name>test-se</component-name>
    <component-task-result-details>
        <task-result-details>
            <task-id>start</task-id>
            <task-result>FAILED</task-result>
            <message-type>ERROR</message-type>
            <task-status-msg><msg-loc-info><loc-token/><loc-message>Unable to 
start service unit</loc-message></msg-loc-info></task-status-msg>
            <exception-info>
                <nesting-level>1</nesting-level>
                <msg-loc-info>
                    <loc-token />
                    <loc-message>BeanFactory not initialized or already closed 
- call 'refresh' before accessing beans via the ApplicationContext</loc-message>
                    <stack-trace><![CDATA[java.lang.IllegalStateException: 
BeanFactory not initialized or already closed - call 'refresh' before accessing 
beans via the ApplicationContext
    at 
org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:153)
    at 
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
    at com.test.MyEndpoint.start(MyEndpoint.java:42)
    at 
org.apache.servicemix.common.DefaultServiceUnit.start(DefaultServiceUnit.java:78)
    at 
org.apache.servicemix.common.BaseServiceUnitManager.start(BaseServiceUnitManager.java:155)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceUnitImpl.start(ServiceUnitImpl.java:123)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.changeState(ServiceAssemblyImpl.java:298)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.transition(ServiceAssemblyImpl.java:274)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.init(ServiceAssemblyImpl.java:136)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.registerServiceAssembly(Deployer.java:454)
    at 
org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.install(ServiceAssemblyInstaller.java:97)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.checkPendingInstallers(Deployer.java:552)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.lifeCycleChanged(Deployer.java:602)
    at 
org.apache.servicemix.jbi.deployer.artifacts.AbstractLifecycleJbiArtifact.fireEvent(AbstractLifecycleJbiArtifact.java:102)
    at 
org.apache.servicemix.jbi.deployer.artifacts.AbstractLifecycleJbiArtifact.fireEvent(AbstractLifecycleJbiArtifact.java:92)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ComponentImpl$ComponentWrapper.init(ComponentImpl.java:251)
    at 
org.apache.servicemix.jbi.runtime.impl.ComponentRegistryImpl.doRegister(ComponentRegistryImpl.java:97)
    at 
org.apache.servicemix.jbi.runtime.impl.ComponentRegistryImpl.doRegister(ComponentRegistryImpl.java:37)
    at 
org.apache.servicemix.nmr.core.ServiceRegistryImpl.register(ServiceRegistryImpl.java:47)
    at 
org.apache.servicemix.nmr.osgi.OsgiServiceRegistryTracker.addingService(OsgiServiceRegistryTracker.java:79)
    at 
org.osgi.util.tracker.ServiceTracker$Tracked.trackAdding(ServiceTracker.java:1030)
    at 
org.osgi.util.tracker.ServiceTracker$Tracked.track(ServiceTracker.java:1008)
    at 
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:933)
    at 
org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:846)
    at 
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:704)
    at 
org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:635)
    at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3393)
    at org.apache.felix.framework.Felix.access$000(Felix.java:39)
    at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:622)
    at 
org.apache.felix.framework.ServiceRegistry.fireServiceChanged(ServiceRegistry.java:576)
    at 
org.apache.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:86)
    at org.apache.felix.framework.Felix.registerService(Felix.java:2527)
    at 
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:252)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.registerService(Deployer.java:748)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.registerComponent(Deployer.java:437)
    at 
org.apache.servicemix.jbi.deployer.impl.ComponentInstaller.initComponent(ComponentInstaller.java:413)
    at 
org.apache.servicemix.jbi.deployer.impl.ComponentInstaller.install(ComponentInstaller.java:133)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.onBundleStarted(Deployer.java:354)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.bundleChanged(Deployer.java:284)
    at 
org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:771)
    at 
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:700)
    at 
org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:597)
    at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3382)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1517)
    at org.apache.felix.framework.Felix.updateBundle(Felix.java:1703)
    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:788)
    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:775)
    at 
org.apache.servicemix.kernel.filemonitor.FileMonitor.refreshPackagesAndStartOrUpdateBundles(FileMonitor.java:540)
    at 
org.apache.servicemix.kernel.filemonitor.FileMonitor.onFilesChanged(FileMonitor.java:299)
    at 
org.apache.servicemix.kernel.filemonitor.FileMonitor$3$1.run(FileMonitor.java:318)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
]]></stack-trace>
                </msg-loc-info>
            </exception-info>
        </task-result-details>
    </component-task-result-details>
</component-task-result>
    at 
org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.install(ServiceAssemblyInstaller.java:101)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.checkPendingInstallers(Deployer.java:552)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.lifeCycleChanged(Deployer.java:602)
    at 
org.apache.servicemix.jbi.deployer.artifacts.AbstractLifecycleJbiArtifact.fireEvent(AbstractLifecycleJbiArtifact.java:102)
    at 
org.apache.servicemix.jbi.deployer.artifacts.AbstractLifecycleJbiArtifact.fireEvent(AbstractLifecycleJbiArtifact.java:92)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ComponentImpl$ComponentWrapper.init(ComponentImpl.java:251)
    at 
org.apache.servicemix.jbi.runtime.impl.ComponentRegistryImpl.doRegister(ComponentRegistryImpl.java:97)
    at 
org.apache.servicemix.jbi.runtime.impl.ComponentRegistryImpl.doRegister(ComponentRegistryImpl.java:37)
    at 
org.apache.servicemix.nmr.core.ServiceRegistryImpl.register(ServiceRegistryImpl.java:47)
    at 
org.apache.servicemix.nmr.osgi.OsgiServiceRegistryTracker.addingService(OsgiServiceRegistryTracker.java:79)
    at 
org.osgi.util.tracker.ServiceTracker$Tracked.trackAdding(ServiceTracker.java:1030)
    at 
org.osgi.util.tracker.ServiceTracker$Tracked.track(ServiceTracker.java:1008)
    at 
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:933)
    at 
org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:846)
    at 
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:704)
    at 
org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:635)
    at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3393)
    at org.apache.felix.framework.Felix.access$000(Felix.java:39)
    at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:622)
    at 
org.apache.felix.framework.ServiceRegistry.fireServiceChanged(ServiceRegistry.java:576)
    at 
org.apache.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:86)
    at org.apache.felix.framework.Felix.registerService(Felix.java:2527)
    at 
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:252)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.registerService(Deployer.java:748)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.registerComponent(Deployer.java:437)
    at 
org.apache.servicemix.jbi.deployer.impl.ComponentInstaller.initComponent(ComponentInstaller.java:413)
    at 
org.apache.servicemix.jbi.deployer.impl.ComponentInstaller.install(ComponentInstaller.java:133)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.onBundleStarted(Deployer.java:354)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.bundleChanged(Deployer.java:284)
    at 
org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:771)
    at 
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:700)
    at 
org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:597)
    at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3382)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1517)
    at org.apache.felix.framework.Felix.updateBundle(Felix.java:1703)
    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:788)
    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:775)
    at 
org.apache.servicemix.kernel.filemonitor.FileMonitor.refreshPackagesAndStartOrUpdateBundles(FileMonitor.java:540)
    at 
org.apache.servicemix.kernel.filemonitor.FileMonitor.onFilesChanged(FileMonitor.java:299)
    at 
org.apache.servicemix.kernel.filemonitor.FileMonitor$3$1.run(FileMonitor.java:318)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
Caused by: javax.jbi.management.DeploymentException: <component-task-result 
xmlns="http://java.sun.com/xml/ns/jbi/management-message";>
    <component-name>test-se</component-name>
    <component-task-result-details>
        <task-result-details>
            <task-id>start</task-id>
            <task-result>FAILED</task-result>
            <message-type>ERROR</message-type>
            <task-status-msg><msg-loc-info><loc-token/><loc-message>Unable to 
start service unit</loc-message></msg-loc-info></task-status-msg>
            <exception-info>
                <nesting-level>1</nesting-level>
                <msg-loc-info>
                    <loc-token />
                    <loc-message>BeanFactory not initialized or already closed 
- call 'refresh' before accessing beans via the ApplicationContext</loc-message>
                    <stack-trace><![CDATA[java.lang.IllegalStateException: 
BeanFactory not initialized or already closed - call 'refresh' before accessing 
beans via the ApplicationContext
    at 
org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:153)
    at 
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
    at com.test.MyEndpoint.start(MyEndpoint.java:42)
    at 
org.apache.servicemix.common.DefaultServiceUnit.start(DefaultServiceUnit.java:78)
    at 
org.apache.servicemix.common.BaseServiceUnitManager.start(BaseServiceUnitManager.java:155)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceUnitImpl.start(ServiceUnitImpl.java:123)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.changeState(ServiceAssemblyImpl.java:298)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.transition(ServiceAssemblyImpl.java:274)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.init(ServiceAssemblyImpl.java:136)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.registerServiceAssembly(Deployer.java:454)
    at 
org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.install(ServiceAssemblyInstaller.java:97)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.checkPendingInstallers(Deployer.java:552)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.lifeCycleChanged(Deployer.java:602)
    at 
org.apache.servicemix.jbi.deployer.artifacts.AbstractLifecycleJbiArtifact.fireEvent(AbstractLifecycleJbiArtifact.java:102)
    at 
org.apache.servicemix.jbi.deployer.artifacts.AbstractLifecycleJbiArtifact.fireEvent(AbstractLifecycleJbiArtifact.java:92)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ComponentImpl$ComponentWrapper.init(ComponentImpl.java:251)
    at 
org.apache.servicemix.jbi.runtime.impl.ComponentRegistryImpl.doRegister(ComponentRegistryImpl.java:97)
    at 
org.apache.servicemix.jbi.runtime.impl.ComponentRegistryImpl.doRegister(ComponentRegistryImpl.java:37)
    at 
org.apache.servicemix.nmr.core.ServiceRegistryImpl.register(ServiceRegistryImpl.java:47)
    at 
org.apache.servicemix.nmr.osgi.OsgiServiceRegistryTracker.addingService(OsgiServiceRegistryTracker.java:79)
    at 
org.osgi.util.tracker.ServiceTracker$Tracked.trackAdding(ServiceTracker.java:1030)
    at 
org.osgi.util.tracker.ServiceTracker$Tracked.track(ServiceTracker.java:1008)
    at 
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:933)
    at 
org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:846)
    at 
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:704)
    at 
org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:635)
    at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3393)
    at org.apache.felix.framework.Felix.access$000(Felix.java:39)
    at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:622)
    at 
org.apache.felix.framework.ServiceRegistry.fireServiceChanged(ServiceRegistry.java:576)
    at 
org.apache.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:86)
    at org.apache.felix.framework.Felix.registerService(Felix.java:2527)
    at 
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:252)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.registerService(Deployer.java:748)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.registerComponent(Deployer.java:437)
    at 
org.apache.servicemix.jbi.deployer.impl.ComponentInstaller.initComponent(ComponentInstaller.java:413)
    at 
org.apache.servicemix.jbi.deployer.impl.ComponentInstaller.install(ComponentInstaller.java:133)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.onBundleStarted(Deployer.java:354)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.bundleChanged(Deployer.java:284)
    at 
org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:771)
    at 
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:700)
    at 
org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:597)
    at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3382)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1517)
    at org.apache.felix.framework.Felix.updateBundle(Felix.java:1703)
    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:788)
    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:775)
    at 
org.apache.servicemix.kernel.filemonitor.FileMonitor.refreshPackagesAndStartOrUpdateBundles(FileMonitor.java:540)
    at 
org.apache.servicemix.kernel.filemonitor.FileMonitor.onFilesChanged(FileMonitor.java:299)
    at 
org.apache.servicemix.kernel.filemonitor.FileMonitor$3$1.run(FileMonitor.java:318)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
]]></stack-trace>
                </msg-loc-info>
            </exception-info>
        </task-result-details>
    </component-task-result-details>
</component-task-result>
    at 
org.apache.servicemix.common.BaseServiceUnitManager.failure(BaseServiceUnitManager.java:292)
    at 
org.apache.servicemix.common.BaseServiceUnitManager.start(BaseServiceUnitManager.java:162)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceUnitImpl.start(ServiceUnitImpl.java:123)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.changeState(ServiceAssemblyImpl.java:298)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.transition(ServiceAssemblyImpl.java:274)
    at 
org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.init(ServiceAssemblyImpl.java:136)
    at 
org.apache.servicemix.jbi.deployer.impl.Deployer.registerServiceAssembly(Deployer.java:454)
    at 
org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.install(ServiceAssemblyInstaller.java:97)
    ... 42 more
11:47:39,718 | INFO  | pool-1-thread-1  | FileMonitor                      | 
x.kernel.filemonitor.FileMonitor  541 | Updated: test-se [92]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to