Uploaded image for project: 'FUSE ESB'
  1. FUSE ESB
  2. ESB-1626

CXF REST Services fail to load if hot deployed before servicemix start

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.4.1-fuse-01-20
    • Fix Version/s: 4.4.1-fuse-02-xx
    • Component/s: None
    • Labels:
      None

      Description

      C:\FUSE\apache-servicemix-4.4.1-fuse-01-20\examples\cxf-jaxrs>cp target\cxf-jaxrs-4.4.1-fuse-01-20.jar ..\..\deploy

      C:\FUSE\apache-servicemix-4.4.1-fuse-01-20\examples\cxf-jaxrs>cd ..\..

      C:\FUSE\apache-servicemix-4.4.1-fuse-01-20>bin\servicemix.bat
      ____ _ __ __ _
      / __| ___ _ ____ _() ___ __| \/ ()_ __
      ___ \ / _ \ '__\ \ / / |/ __/ _ \ |\/| | \ \/ /
      __) | __/ | \ V /| | (| __/ | | | |> <

      ___/ __ _ _/ _ ____ _   _ //_\

      Apache ServiceMix (4.4.1-fuse-01-20)

      Hit '<tab>' for a list of available commands
      and '[cmd] --help' for help on a specific command.

      karaf@root> Exception in thread "SpringOsgiExtenderThread-2" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerSer
      vice': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
      PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'serviceBeans' threw exception; nested exception is java.lang.Exception
      InInitializerError
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1361)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:6
      9)
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
      at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.ja
      va:320)
      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterAp
      plicationContextExecutor.java:132)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
      PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'serviceBeans' threw exception; nested exception is java.lang.Exception
      InInitializerError
      at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:102)
      at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1358)
      ... 15 more

      It works fine after servicemix restarted or service initially deployed into running servicemix.

      Full trace from log file:

      org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'cxf': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:209)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      at org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:148)
      at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:86)
      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
      at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1007)
      at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.doClose(AbstractOsgiBundleApplicationContext.java:197)
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:69)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:214)
      at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:210)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextExecutor.java:374)
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.doClose(AbstractDelegatedExecutionApplicationContext.java:236)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:970)
      at org.apache.cxf.bus.spring.SpringBus.destroyBeans(SpringBus.java:100)[126:org.apache.cxf.bundle:2.4.3.fuse-00-20]
      at org.apache.cxf.bus.CXFBusImpl.shutdown(CXFBusImpl.java:196)[126:org.apache.cxf.bundle:2.4.3.fuse-00-20]
      at org.apache.cxf.bus.CXFBusImpl.shutdown(CXFBusImpl.java:178)[126:org.apache.cxf.bundle:2.4.3.fuse-00-20]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_17]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_17]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_17]
      at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_17]
      at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:273)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:199)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:487)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:463)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:431)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:368)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[85:org.springframework.osgi.extender:1.2.1]
      at java.lang.Thread.run(Thread.java:619)[:1.6.0_17]
      12:03:36,671 | WARN | ExtenderThread-2 | OsgiBundleXmlApplicationContext | 76 - org.springframework.context - 3.0.5.RELEASE | Exception thrown from LifecycleProcessor on context close
      java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: OsgiBundleXmlApplicationContext(bundle=cxf-jaxrs, config=osgibundle:/META-INF/spring/*.xml): startup date [Wed Feb 01 12:03:35 GMT 2012]; root of context hierarchy
      at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:329)
      at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1015)
      at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.doClose(AbstractOsgiBundleApplicationContext.java:197)
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:69)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:214)
      at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:210)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextExecutor.java:374)
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.doClose(AbstractDelegatedExecutionApplicationContext.java:236)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:970)
      at org.apache.cxf.bus.spring.SpringBus.destroyBeans(SpringBus.java:100)[126:org.apache.cxf.bundle:2.4.3.fuse-00-20]
      at org.apache.cxf.bus.CXFBusImpl.shutdown(CXFBusImpl.java:196)[126:org.apache.cxf.bundle:2.4.3.fuse-00-20]
      at org.apache.cxf.bus.CXFBusImpl.shutdown(CXFBusImpl.java:178)[126:org.apache.cxf.bundle:2.4.3.fuse-00-20]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_17]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_17]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_17]
      at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_17]
      at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:273)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:199)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:487)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:463)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:431)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:368)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[85:org.springframework.osgi.extender:1.2.1]
      at java.lang.Thread.run(Thread.java:619)[:1.6.0_17]
      12:03:36,671 | INFO | ExtenderThread-2 | DefaultListableBeanFactory | 74 - org.springframework.beans - 3.0.5.RELEASE | Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@176bfaa: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,osgiDestinationRegistry-import-not-needed,customerService,customerSvc]; root of factory hierarchy
      12:03:36,687 | INFO | ExtenderThread-2 | ContextLoaderListener | 85 - org.springframework.osgi.extender - 1.2.1 | Application context succesfully closed (OsgiBundleXmlApplicationContext(bundle=cxf-jaxrs, config=osgibundle:/META-INF/spring/*.xml))
      12:03:36,687 | ERROR | ExtenderThread-2 | ContextLoaderListener | 85 - org.springframework.osgi.extender - 1.2.1 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=cxf-jaxrs, config=osgibundle:/META-INF/spring/*.xml))
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerService': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
      PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'serviceBeans' threw exception; nested exception is java.lang.ExceptionInInitializerError
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1361)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)[76:org.springframework.context:3.0.5.RELEASE]
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[82:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[85:org.springframework.osgi.extender:1.2.1]
      at java.lang.Thread.run(Thread.java:619)[:1.6.0_17]
      Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
      PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'serviceBeans' threw exception; nested exception is java.lang.ExceptionInInitializerError
      at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:102)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)[74:org.springframework.beans:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1358)[74:org.springframework.beans:3.0.5.RELEASE]
      ... 15 more

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ffang Freeman(Yue) Fang
                Reporter:
                socallag Sean O'Callaghan
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: