# CFX SOAP enpoint fails when using Camunda

**URL:** <https://forum.camunda.io/t/cfx-soap-enpoint-fails-when-using-camunda/2845>\
**Category:** Discussion & Questions\
**Tags:** process-engine\
**Created:** [February 19, 2017, 11:46pm UTC](https://forum.camunda.io/t/cfx-soap-enpoint-fails-when-using-camunda/2845 "2017-02-19T23:46:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmaceachran](https://forum.camunda.io/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mmaceachran](https://forum.camunda.io/u/mmaceachran)\
**Post date:** [February 19, 2017, 11:46pm UTC](https://forum.camunda.io/t/cfx-soap-enpoint-fails-when-using-camunda/2845/1 "2017-02-19T23:46:07Z")

</div>

SO I have an existing SOAP service. I want to add some BPM to it. I deployed the demo tomcat and got everything to work fine. I deployed my .war and my CFX (3.17) SOAP services work fine. I then write a test service and add this to my context:

```
<jaxws:endpoint
id="bpmTest"
implementor="com.me.bpm.services.endpoint.CamundaTesterImpl"
address="/TestWorkflow" />

```

When I deploy this, I can call the endpoint just fine it throws an error, because I did not add the required camunda beans. So I do this and add this to my context:

```
  <bean name="processEngineService" class="org.camunda.bpm.BpmPlatform" factory-method="getProcessEngineService" />
  <bean name="processEngine" factory-bean="processEngineService" factory-method="getDefaultProcessEngine" />
  <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService"/>
  <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService"/>
  <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService"/>
  <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService"/>
  <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService"/>

```

But when I deploy, my endpoint now throws a 404. I comment those beans out, and my endpoint returns.

How do I get CFX and Camunda to play nice with each other?

---

<div class="post-metadata">

**Author:** ![aakhmerov](https://forum.camunda.io/user_avatar/forum.camunda.io/aakhmerov/32/413_2.png) [@aakhmerov](https://forum.camunda.io/u/aakhmerov)\
**Post date:** [February 20, 2017, 6:59am UTC](https://forum.camunda.io/t/cfx-soap-enpoint-fails-when-using-camunda/2845/2 "2017-02-20T06:59:34Z")

</div>

Hi @mmaceachran,

are you getting any extra exceptions when both cxf and engine are declared as dependencies in the project? Can you provide a stack trace or may be a link to your project on github?

Cheers,  
Askar

---

<div class="post-metadata">

**Author:** ![mmaceachran](https://forum.camunda.io/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mmaceachran](https://forum.camunda.io/u/mmaceachran)\
**Post date:** [February 20, 2017, 1:49pm UTC](https://forum.camunda.io/t/cfx-soap-enpoint-fails-when-using-camunda/2845/3 "2017-02-20T13:49:52Z")

</div>

Ahh. So sorry, glaring error, it was in another logfile. Here is the problem:

```
19-Feb-2017 21:09:18.405 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositoryService' defined in class path resource [beans.xml]: factory-bean 'processEngine' (or a BeanPostProcessor involved) returned null
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:374)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1134)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1028)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:759)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1768)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

```

Still don’t know what I am doing wrong.

---

<div class="post-metadata">

**Author:** ![aakhmerov](https://forum.camunda.io/user_avatar/forum.camunda.io/aakhmerov/32/413_2.png) [@aakhmerov](https://forum.camunda.io/u/aakhmerov)\
**Post date:** [February 20, 2017, 2:02pm UTC](https://forum.camunda.io/t/cfx-soap-enpoint-fails-when-using-camunda/2845/4 "2017-02-20T14:02:41Z")

</div>

@mmaceachran, do I understand correctly that this is an embedded engine setup? If so you are missing engine beans declarations. You cant take a look [here](https://github.com/camunda/camunda-bpm-examples/blob/master/deployment/embedded-spring-rest/src/main/webapp/WEB-INF/applicationContext.xml) how to do it.

Cheers,  
Askar

---

<div class="post-metadata">

**Author:** ![c.biever](https://forum.camunda.io/user_avatar/forum.camunda.io/c.biever/32/531_2.png) [@c.biever](https://forum.camunda.io/u/c.biever)\
**Post date:** [February 27, 2017, 9:42am UTC](https://forum.camunda.io/t/cfx-soap-enpoint-fails-when-using-camunda/2845/5 "2017-02-27T09:42:24Z")

</div>

Not sure if it is relevant or if it will solve your problem, but we experienced problems when we had the CXF servlet at the root of the context. We solved it by changing the mapping in web.xml:

```
<servlet-mapping>
    <servlet-name>CXFServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
</servlet-mapping>
```

---

<div class="post-metadata">

**Author:** ![mmaceachran](https://forum.camunda.io/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mmaceachran](https://forum.camunda.io/u/mmaceachran)\
**Post date:** [February 27, 2017, 1:35pm UTC](https://forum.camunda.io/t/cfx-soap-enpoint-fails-when-using-camunda/2845/6 "2017-02-27T13:35:05Z")

</div>

Actually the problem seemed to be Spring autowire in the SOAP Impl. You have to declare the impl as a regular bean, and then use that as your endpoint. (2 different declarations) Like this:

```
<bean id="bpmTestImpl" class="com.me.bpm.services.endpoint.CamundaTesterImpl" />
<jaxws:endpoint	id="bpmTestEndpoint" implementor="#bpmTestImpl"	address="/TestWorkflow" />
```

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [January 30, 2024, 10:47am UTC](https://forum.camunda.io/t/cfx-soap-enpoint-fails-when-using-camunda/2845/7 "2024-01-30T10:47:56Z")

</div>

Closed on January 30, 2024, 10:47am UTC


