Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-1809

Annotated @PostConstruct methods called twice on single Spring bean

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.0.9, 2.1.3
    • Component/s: None
    • Labels:
      None
    • Environment:

      All

      Description

      Seems like an overlap between CXF's Jsr250BeanPostProcessor and Spring's CommonAnnotationBeanPostProcessor:

      First invocation:
      MyBean.init() line: 41
      NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
      NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
      DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
      Method.invoke(Object, Object...) line: 585
      InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(Object) line: 297
      InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(Object, String) line: 250
      CommonAnnotationBeanPostProcessor(InitDestroyAnnotationBeanPostProcessor).postProcessBeforeInitialization(Object, String) line: 144
      DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).applyBeanPostProcessorsBeforeInitialization(Object, String) line: 350
      DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).initializeBean(String, Object, RootBeanDefinition) line: 1330
      DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).doCreateBean(String, RootBeanDefinition, Object[]) line: 473
      AbstractAutowireCapableBeanFactory$1.run() line: 409

      Second invocation:
      MyBean.init() line: 41
      NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
      NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
      DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
      Method.invoke(Object, Object...) line: 585
      ResourceInjector.invokePostConstruct() line: 304
      ResourceInjector.construct(Object) line: 86
      Jsr250BeanPostProcessor.postProcessAfterInitialization(Object, String) line: 58
      DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).applyBeanPostProcessorsAfterInitialization(Object, String) line: 361
      DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).initializeBean(String, Object, RootBeanDefinition) line: 1343
      DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).doCreateBean(String, RootBeanDefinition, Object[]) line: 473
      AbstractAutowireCapableBeanFactory$1.run() line: 409

      I noticed this checkin after doing a google search http://code.google.com/p/xebia-france/source/detail?r=139 - it seems relevant to this bug

        Attachments

          Activity

            People

            • Assignee:
              dkulp Daniel Kulp
              Reporter:
              sirianni Eric Sirianni
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: