Shared Process Engine bean injection

Hi There,
can u please help me with settting of beans in application context for shared process engine?
I have this situation: on admin server we have Camunda, where i have put this lines for server.xml on Tomcat:

    <Resource name="global/camunda-bpm-platform/process-engine/ProcessEngineService!org.camunda.bpm.ProcessEngineService" auth="Container"
              type="org.camunda.bpm.ProcessEngineService"
              description="camunda BPM platform Process Engine Service"
              factory="org.camunda.bpm.container.impl.jndi.ProcessEngineServiceObjectFactory" />
              
    <Resource name="global/camunda-bpm-platform/process-engine/ProcessApplicationService!org.camunda.bpm.ProcessApplicationService" auth="Container"
              type="org.camunda.bpm.ProcessApplicationService"
              description="camunda BPM platform Process Application Service"
              factory="org.camunda.bpm.container.impl.jndi.ProcessApplicationServiceObjectFactory" />

Part of Camunda.war is in library folder dependency on my jar project, which contains applicationContext.xml with this content:

    <bean name="processEngineService" class="org.camunda.bpm.BpmPlatform" factory-method="getProcessEngineService" />
    
    <bean name="processEngine" factory-bean="processEngineService" factory-method="getDefaultProcessEngine" />
    
     <!-- bootstrap the process application -->
      <bean id="processApplication" class="org.camunda.bpm.engine.spring.application.SpringServletProcessApplication" />

    <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" /> 

When i running my tomcat admin server i will get this error message:

org.broadleafcommerce.common.web.extensibility.MergeContextLoader
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘runtimeService’ defined in resource loaded from byte array: factory-bean ‘processEngine’ (or a BeanPostProcessor involved) returned null

Because part of the server is BroadLeaf. When I used embedded process engine with processEngineConfiguration and FactoryBean as class instead of BpmPlatform, it worked correctly.

So can u please help me with this wrong situation?

Thanks so much.

BR

Lukas P.

You can close the issue, it has been solved, thanks