cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (Assigned) (JIRA)" <>
Subject [jira] [Assigned] (CXF-3959) CXF JAX-WS: @PostConstruct methods invoked twice in Spring-based projects
Date Tue, 06 Dec 2011 22:36:41 GMT


Daniel Kulp reassigned CXF-3959:

    Assignee: Daniel Kulp
> CXF JAX-WS: @PostConstruct methods invoked twice in Spring-based projects
> -------------------------------------------------------------------------
>                 Key: CXF-3959
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2, 2.5
>            Reporter: Rolf Schäuble
>            Assignee: Daniel Kulp
>         Attachments:
> Under the following circumstances, @PostConstruct methods on classes exported as JAX-WS
WebService are invoked twice:
> - The application uses Spring as IoC container
> - Spring's support for JSR 250 annotations is active (using the CommonAnnotationBeanPostProcessor
bean or <context:annotation-config/>
> - The exported bean is declared as Spring bean in the application context
> - The <jaxws:endpoint> declaration refers to the declared bean (<jaxws:endpoint
> The last point is important:
> - <jaxws:endpoint implementor=""/> *does not* not show the wrong
> - <bean id="theBean" class=""/>
>   <jaxws:endpoint implementor="#theBean'"/> *does* show the wrong behaviur
> I have built an example application (based on CXF's java_first_spring_support sample)
that shows the problem. It contains two classes:
> 1. PostConstructCalledOnce: this class is exported using the <jaxws:endpoint implementor=""/>
> 2. this class is exported using the <jaxws:endpoint
> Both classes contain a postConstruct method; both method print the class's name to the
console. When the application is started ("mvn -Pserver"), it can be observed that PostConstructCalledOnce#postConstruct
is called once and PostConstructCalledTwice#postConstruct is called twice.
> Desired behavior: both postConstruct methods should only be invoked once.
> Workaround:
> 1. Annotate the affected classes with CXF's @NoJSR250Annotations annotation
> 2. Use the <jaxws:endpoint implementor=""/> syntax. Problem:
This way, Spring is not able to wrap the bean with a proxy (e.g. for transaction support)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message