[
https://issues.apache.org/jira/browse/CAMEL-12829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16625762#comment-16625762
]
ASF GitHub Bot commented on CAMEL-12829:
----------------------------------------
davsclaus closed pull request #2530: CAMEL-12829: An autocreated CXF Bus not
shut down in CxfSpringEndpoint
URL: https://github.com/apache/camel/pull/2530
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
index 25b72b70ce4..1247d4302a9 100644
---
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
+++
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
@@ -128,7 +128,7 @@
protected Bus bus;
private AtomicBoolean getBusHasBeenCalled = new AtomicBoolean(false);
- private volatile boolean createBus;
+ protected volatile boolean createBus;
private BindingConfiguration bindingConfig;
private DataBinding dataBinding;
diff --git
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java
index 0671b1632cd..f837dd01ec2 100644
---
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java
+++
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java
@@ -248,6 +248,7 @@ public void setApplicationContext(ApplicationContext ctx)
throws BeansException
applicationContext = ctx;
if (bus == null) {
+ createBus = true;
bus = BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx);
}
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> An autocreated CXF Bus not shut down in CxfSpringEndpoint
> ---------------------------------------------------------
>
> Key: CAMEL-12829
> URL: https://issues.apache.org/jira/browse/CAMEL-12829
> Project: Camel
> Issue Type: Bug
> Components: camel-cxf
> Reporter: Peter Palaga
> Assignee: Peter Palaga
> Priority: Major
>
> {{CxfSpringEndpoint.setApplicationContext(ApplicationContext)}} creates a
> {{org.apache.cxf.Bus}} [1] whose {{shutdown()}} method is never called. This
> is one of the causes for a memory leak in WildFly Camel (WFC) [2].
> The steps to reproduce for WFC are as follows:
> 1. Start the WFC
> 2. run the CXFWSConsumerIntegrationTest several times
> 3. Force GC on WFC
> 4. Get a heap dump
> NOT OK: There are as many stale SpringBus instances as many times the test
> was run.
> Expected: no SpringBus instances there
> [1]
> https://github.com/apache/camel/blob/c69affc49415b190645ce25536ffd62348c4fe34/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java#L251
> [2] https://github.com/wildfly-extras/wildfly-camel/issues/2649
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)