You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Will Lauer (JIRA)" <ji...@apache.org> on 2012/11/16 19:28:11 UTC

[jira] [Created] (CXF-4640) @PostConstruct methods invoked twice in Spring projects when using OSGi even with fix for CXF-3959

Will Lauer created CXF-4640:
-------------------------------

             Summary: @PostConstruct methods invoked twice in Spring projects when using OSGi even with fix for CXF-3959
                 Key: CXF-4640
                 URL: https://issues.apache.org/jira/browse/CXF-4640
             Project: CXF
          Issue Type: Bug
          Components: JAX-WS Runtime
    Affects Versions: 2.6.3
         Environment: Karaf 2.3.0, Equinox 2.6.0, Spring 3.0.7.RELEASE
            Reporter: Will Lauer


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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CXF-4640) @PostConstruct methods invoked twice in Spring projects when using OSGi even with fix for CXF-3959

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang resolved CXF-4640.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 2.7.1
                   2.6.4
                   2.5.7
    
> @PostConstruct methods invoked twice in Spring projects when using OSGi even with fix for CXF-3959
> --------------------------------------------------------------------------------------------------
>
>                 Key: CXF-4640
>                 URL: https://issues.apache.org/jira/browse/CXF-4640
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.6.3
>         Environment: Karaf 2.3.0, Equinox 2.6.0, Spring 3.0.7.RELEASE
>            Reporter: Will Lauer
>            Assignee: Freeman Fang
>             Fix For: 2.5.7, 2.6.4, 2.7.1
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4640) @PostConstruct methods invoked twice in Spring projects when using OSGi even with fix for CXF-3959

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500018#comment-13500018 ] 

Freeman Fang commented on CXF-4640:
-----------------------------------

package org.springframework.context.annotation is from spring-context bundle and cxf-rt-frontend-jaxws already have spring-context dependency, so we can explicitly use org.springframework.context.annotation.CommonAnnotationBeanPostProcessor  class in EndpointDefinitionParser so that maven-bundle-plugin can detect it and generate a proper package import entry automatically
                
> @PostConstruct methods invoked twice in Spring projects when using OSGi even with fix for CXF-3959
> --------------------------------------------------------------------------------------------------
>
>                 Key: CXF-4640
>                 URL: https://issues.apache.org/jira/browse/CXF-4640
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.6.3
>         Environment: Karaf 2.3.0, Equinox 2.6.0, Spring 3.0.7.RELEASE
>            Reporter: Will Lauer
>            Assignee: Freeman Fang
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CXF-4640) @PostConstruct methods invoked twice in Spring projects when using OSGi even with fix for CXF-3959

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang reassigned CXF-4640:
---------------------------------

    Assignee: Freeman Fang
    
> @PostConstruct methods invoked twice in Spring projects when using OSGi even with fix for CXF-3959
> --------------------------------------------------------------------------------------------------
>
>                 Key: CXF-4640
>                 URL: https://issues.apache.org/jira/browse/CXF-4640
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.6.3
>         Environment: Karaf 2.3.0, Equinox 2.6.0, Spring 3.0.7.RELEASE
>            Reporter: Will Lauer
>            Assignee: Freeman Fang
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (CXF-4640) @PostConstruct methods invoked twice in Spring projects when using OSGi even with fix for CXF-3959

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500018#comment-13500018 ] 

Freeman Fang edited comment on CXF-4640 at 11/19/12 5:14 AM:
-------------------------------------------------------------

package org.springframework.context.annotation is from spring-context bundle and cxf-rt-frontend-jaxws already have spring-context dependency, so we can explicitly use org.springframework.context.annotation.CommonAnnotationBeanPostProcessor  class in EndpointDefinitionParser so that maven-bundle-plugin can detect it and generate a proper optional package import entry automatically
                
      was (Author: ffang):
    package org.springframework.context.annotation is from spring-context bundle and cxf-rt-frontend-jaxws already have spring-context dependency, so we can explicitly use org.springframework.context.annotation.CommonAnnotationBeanPostProcessor  class in EndpointDefinitionParser so that maven-bundle-plugin can detect it and generate a proper package import entry automatically
                  
> @PostConstruct methods invoked twice in Spring projects when using OSGi even with fix for CXF-3959
> --------------------------------------------------------------------------------------------------
>
>                 Key: CXF-4640
>                 URL: https://issues.apache.org/jira/browse/CXF-4640
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.6.3
>         Environment: Karaf 2.3.0, Equinox 2.6.0, Spring 3.0.7.RELEASE
>            Reporter: Will Lauer
>            Assignee: Freeman Fang
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira