Worker Factory not starting

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);"

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

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

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();
}

}

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

Antonio