# Worker Factory not starting

**URL:** <https://community.temporal.io/t/worker-factory-not-starting/12176>\
**Category:** Community Support\
**Created:** [May 20, 2024, 7:27am UTC](https://community.temporal.io/t/worker-factory-not-starting/12176 "2024-05-20T07:27:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikunj\_Mehadia](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/nikunj_mehadia/32/5366_2.png) [@Nikunj\_Mehadia](https://community.temporal.io/u/Nikunj_Mehadia)\
**Post date:** [May 20, 2024, 7:27am UTC](https://community.temporal.io/t/worker-factory-not-starting/12176/1 "2024-05-20T07:27:18Z")

</div>

I am scheduling jobs using Schedule on a self hosted cluster, and also created a client, factory and workers. I am able to list the workers for the factory, but getting error while doing “factory.start()”  
Specifically getting an error for " this.workflowClient.getWorkflowServiceStubs().connect((Duration)null);"

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [May 20, 2024, 3:46pm UTC](https://community.temporal.io/t/worker-factory-not-starting/12176/2 "2024-05-20T15:46:57Z")

</div>

Can you give more info on the exact error (including stack trace) what you are getting?  
If you could show your code would help too i think

---

<div class="post-metadata">

**Author:** ![Nikunj\_Mehadia](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/nikunj_mehadia/32/5366_2.png) [@Nikunj\_Mehadia](https://community.temporal.io/u/Nikunj_Mehadia)\
**Post date:** [May 20, 2024, 3:59pm UTC](https://community.temporal.io/t/worker-factory-not-starting/12176/3 "2024-05-20T15:59:32Z")

</div>

Actually, it’s working now.  
I was creating worker in another function and starting it’s factory in the calling function.  
Thanks anyways

---

<div class="post-metadata">

**Author:** ![satya\_panigrahy](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/satya_panigrahy/32/5649_2.png) [@satya\_panigrahy](https://community.temporal.io/u/satya_panigrahy)\
**Post date:** [August 1, 2024, 5:13am UTC](https://community.temporal.io/t/worker-factory-not-starting/12176/4 "2024-08-01T05:13:28Z")

</div>

Hi @Nikunj_Mehadia  
Can you help with little brief about …what is the fix to start worker factory ? I am stuck at same error (as you specified ) . Kindly suggest me …what changes you have made to come out of it. Here I have captured below file facing same error

@Configuration  
public class TemporalConfig {

```
@Autowired
private OrderActivityImpl orderActivity;

@PostConstruct
public void startWorkers() {
    var stub = WorkflowServiceStubs.newServiceStubs(WorkflowServiceStubsOptions.newBuilder()
            .setEnableHttps(false)
            .setTarget("172.21.0.4:7233")
            //.setTarget("192.168.100.5:7233")
            .build());
    var client = WorkflowClient.newInstance(stub);

    var factory = WorkerFactory.newInstance(client);
    Worker worker = factory.newWorker(WorkerHelper.ORDER_LIFECYCLE_WORKFLOW_TASK_QUEUE);
    worker.registerWorkflowImplementationTypes(OrderWorkflowImpl.class);
    worker.registerActivitiesImplementations(orderActivity);
    factory.start();
}

```

}

---

<div class="post-metadata">

**Author:** ![antonio.perez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/antonio.perez/32/2417_2.png) [@antonio.perez](https://community.temporal.io/u/antonio.perez)\
**Post date:** [August 1, 2024, 11:43am UTC](https://community.temporal.io/t/worker-factory-not-starting/12176/5 "2024-08-01T11:43:26Z")

</div>

Hi @satya_panigrahy

what is the error ?

Have to consider using the Temporal Spring Boot integration [sdk-java/temporal-spring-boot-autoconfigure at master · temporalio/sdk-java · GitHub](https://github.com/temporalio/sdk-java/tree/master/temporal-spring-boot-autoconfigure)

Antonio
