orpiske commented on code in PR #7904:
URL: https://github.com/apache/camel/pull/7904#discussion_r907708337
##########
components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java:
##########
@@ -946,7 +950,19 @@ public void setBus(Bus bus) {
public Bus getBus() {
if (bus == null) {
- bus = CxfEndpointUtils.createBus(getCamelContext());
+ CamelContext context = getCamelContext();
+ if (context.getClass().getName().endsWith("SpringCamelContext")) {
+ try {
+ Class<?> cxfSpringEndpintUtilClazz =
Class.forName("org.apache.camel.component.cxf.spring.jaxws.CxfSpringEndpointUtils");
+ Method method =
cxfSpringEndpintUtilClazz.getMethod("createBus", CamelContext.class);
+ bus = (Bus)method.invoke(null, context);
+ } catch (Exception ex) {
+ LOG.warn("Error creating Cxf Bus from SpringCamelContext.
This exception will be ignored.", ex);
Review Comment:
Maybe log the exception message too? Something like:
```LOG.warn("Error creating Cxf Bus from SpringCamelContext: {} This
exception will be ignored.", ex.getMesage(), ex);```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]