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

@PostConstruct methods invoked twice in Spring projects when using OSGi even with fix for CXF-3959

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6.3
    • 2.5.7, 2.6.4, 2.7.1
    • JAX-WS Runtime
    • None
    • Karaf 2.3.0, Equinox 2.6.0, Spring 3.0.7.RELEASE

    • Unknown

    Description

      Even with the fixes for CXF-3959, methods annotated with @PostConstruct appear to be called twice when creating a jaxws endpoint from within a Spring-based bundle when invoked inside an OSGi environment. It appears that the fix for CXF-3959 tries to determine if Spring is being used by looking up the class org.springframework.context.annotation.CommonAnnotationBeanPostProcessor in EndpointDefinitionParser. While this will work in a normal java environment, it fails in the current OSGi enabled CXF bundles because the cxf-rt-frontend-jaxws bundle does not import the package org.springframework.context.annotation. Because of this, the class lookup will always fail.

      Attachments

        Activity

          People

            ffang Freeman Yue Fang
            will_lauer@comcast.net Will Lauer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: