[ 
https://issues.apache.org/jira/browse/CXF-8130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roman Platonov updated CXF-8130:
--------------------------------
    Description: 
Hi,

I have following problem after the changes in Spring Framework [commit 
there|#L606]]

So, at the start of the application startup there is a call of 
{{prepareRefresh()}}, so it works like that:

 
{code:java}
this.earlyApplicationListeners = new LinkedHashSet<>(this.applicationListeners);
{code}
 

and this collection is empty.

Then is CXFServlet I have addition of listener - [Cxf 
link|https://github.com/apache/cxf/blob/ec4423437bd7d6b63e3464761394cfafb50cacfa/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java#L90]

 

Then it's needed to refresh the Application Context, so it provokes the 
{{refresh()}} at AbstractApplicationContext, then goes to {{prepareRefresh}} 
and then checks
{code:java}
this.earlyApplicationListeners == null,{code}
but it's an empty LinkedHashSet, not null, so then it comes to


{code:java}
this.applicationListeners.clear(); {code}
 

and it removes the listener from CXFServlet, so there is no event coming to 
CXFServlet.

Is there any solution? Maybe it's better to change the logic of addition the 
listener to context?

 

I have also add the comment to spring framework issue 
([Issue|[https://github.com/spring-projects/spring-framework/issues/22325]])

 

Thank you!

  was:
Hi,

I have following problem after the changes in Spring Framework [commit 
there|[https://github.com/spring-projects/spring-framework/blob/9689a59ab1b8432d8eba688247fc5cb86e602871/spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java#L606]]

So, at the start of the application startup there is a call of 
{{prepareRefresh()}}, so it works like that:

 
{code:java}
this.earlyApplicationListeners = new LinkedHashSet<>(this.applicationListeners);
{code}
 

{{}}

and this collection is empty.

Then is CXFServlet I have addition of listener - [Cxf link| 
https://github.com/apache/cxf/blob/ec4423437bd7d6b63e3464761394cfafb50cacfa/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java#L90]

 

Then it's needed to refresh the Application Context, so it provokes the 
{{refresh()}} at AbstractApplicationContext, then goes to {{prepareRefresh}} 
and then checks

{{}}
{code:java}
this.earlyApplicationListeners == null,{code}
but it's an empty LinkedHashSet, not null, so then it comes to
{{}}
{code:java}
this.applicationListeners.clear(); {code}
{{}}

and it removes the listener from CXFServlet, so there is no event coming to 
CXFServlet.

Is there any solution? Maybe it's better to change the logic of addition the 
listener to context?

 

I have also add the comment to spring framework issue 
([Issue|[https://github.com/spring-projects/spring-framework/issues/22325]])

 

Thank you!


> Since Spring 5.1.5 Release CXFServlet application listener dissapears by 
> context refresh
> ----------------------------------------------------------------------------------------
>
>                 Key: CXF-8130
>                 URL: https://issues.apache.org/jira/browse/CXF-8130
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 3.3.2, 3.3.3
>            Reporter: Roman Platonov
>            Priority: Major
>
> Hi,
> I have following problem after the changes in Spring Framework [commit 
> there|#L606]]
> So, at the start of the application startup there is a call of 
> {{prepareRefresh()}}, so it works like that:
>  
> {code:java}
> this.earlyApplicationListeners = new 
> LinkedHashSet<>(this.applicationListeners);
> {code}
>  
> and this collection is empty.
> Then is CXFServlet I have addition of listener - [Cxf 
> link|https://github.com/apache/cxf/blob/ec4423437bd7d6b63e3464761394cfafb50cacfa/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java#L90]
>  
> Then it's needed to refresh the Application Context, so it provokes the 
> {{refresh()}} at AbstractApplicationContext, then goes to {{prepareRefresh}} 
> and then checks
> {code:java}
> this.earlyApplicationListeners == null,{code}
> but it's an empty LinkedHashSet, not null, so then it comes to
> {code:java}
> this.applicationListeners.clear(); {code}
>  
> and it removes the listener from CXFServlet, so there is no event coming to 
> CXFServlet.
> Is there any solution? Maybe it's better to change the logic of addition the 
> listener to context?
>  
> I have also add the comment to spring framework issue 
> ([Issue|[https://github.com/spring-projects/spring-framework/issues/22325]])
>  
> Thank you!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to