# Global webservice weather deploy successfully but with startProcessInstanceByKey null pointer exception occur

**URL:** <https://forum.flowable.org/t/global-webservice-weather-deploy-successfully-but-with-startprocessinstancebykey-null-pointer-exception-occur/1636>\
**Category:** Uncategorized\
**Created:** [February 13, 2018, 6:30am UTC](https://forum.flowable.org/t/global-webservice-weather-deploy-successfully-but-with-startprocessinstancebykey-null-pointer-exception-occur/1636 "2018-02-13T06:30:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musaid](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@musaid](https://forum.flowable.org/u/musaid)\
**Post date:** [February 13, 2018, 6:30am UTC](https://forum.flowable.org/t/global-webservice-weather-deploy-successfully-but-with-startprocessinstancebykey-null-pointer-exception-occur/1636/1 "2018-02-13T06:30:23Z")

</div>

I am calling global webservice weather .The import wsdl is working fine but When i start process by key  
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(“weather” , variables);  
Giving me exception .

11:28:02.321 [main] DEBUG org.flowable.engine.impl.history.AbstractHistoryManager - Current history level: FULL, level required: ACTIVITY  
11:28:02.324 [main] DEBUG org.flowable.engine.impl.history.AbstractHistoryManager - Current history level: FULL, level required: FULL  
11:28:02.326 [main] ERROR org.flowable.engine.common.impl.interceptor.CommandContext - Error while closing command context

Exception in thread “main” java.lang.NullPointerException  
at org.flowable.engine.impl.bpmn.webservice.Operation.sendMessage(Operation.java:54)  
at org.flowable.engine.impl.bpmn.behavior.WebServiceActivityBehavior.execute(WebServiceActivityBehavior.java:136)  
at org.flowable.engine.impl.agenda.ContinueProcessOperation.executeActivityBehavior(ContinueProcessOperation.java:256)  
at org.flowable.engine.impl.agenda.ContinueProcessOperation.executeSynchronous(ContinueProcessOperation.java:154)  
at org.flowable.engine.impl.agenda.ContinueProcessOperation.continueThroughFlowNode(ContinueProcessOperation.java:111)  
at org.flowable.engine.impl.agenda.ContinueProcessOperation.continueThroughSequenceFlow(ContinueProcessOperation.java:303)  
at org.flowable.engine.impl.agenda.ContinueProcessOperation.run(ContinueProcessOperation.java:77)  
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:88)  
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:72)  
at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:56)  
at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:25)  
at org.flowable.engine.common.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)  
at org.flowable.engine.common.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:72)  
at org.flowable.engine.common.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:35)  
at org.flowable.engine.common.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)  
at org.flowable.engine.common.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)  
at org.flowable.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:103)  
at org.activity.Main.main(Main.java:43)

Unit test case is

package org.activiti;

import java.util.HashMap;  
import java.util.List;  
import java.util.Map;  
import java.util.Scanner;

import javax.sql.DataSource;

import org.flowable.engine.ProcessEngine;  
import org.flowable.engine.ProcessEngineConfiguration;  
import org.flowable.engine.RepositoryService;  
import org.flowable.engine.RuntimeService;  
import org.flowable.engine.TaskService;  
import org.flowable.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration;  
import org.flowable.engine.runtime.ProcessInstance;  
import org.flowable.task.api.Task;  
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;  
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;  
import org.springframework.context.annotation.Bean;  
import org.springframework.context.annotation.ComponentScan;  
import org.springframework.context.annotation.Configuration;  
public class ProcessUnitTest {

```
public static void main (String args[]) {
	

	 ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration().buildProcessEngine();
	 RepositoryService repositoryService = processEngine.getRepositoryService();
   RuntimeService runtimeService = processEngine.getRuntimeService();
   TaskService taskService = processEngine.getTaskService();   

   repositoryService.createDeployment().addClasspathResource("service-activity.bpmn20.xml").deploy();
   

   Map<String, Object> variables = new HashMap<String, Object>();
  variables.put("employee", "abc");
  ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("weather");

```

![bpmn20](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/flowable/original/1X/05e3d23b8f61519f45fc996af71877866aece780.png)

```
  System.out.println(" **********id********" + processInstance.getId());
   
}

```

}

BPMN file is available on [https://expirebox.com/download/c367fea8b5ddad1b48d3d78a1b5dbfb9.html](https://expirebox.com/download/c367fea8b5ddad1b48d3d78a1b5dbfb9.html)

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [February 16, 2018, 12:22pm UTC](https://forum.flowable.org/t/global-webservice-weather-deploy-successfully-but-with-startprocessinstancebykey-null-pointer-exception-occur/1636/2 "2018-02-16T12:22:45Z")

</div>

The nullpointer is thrown when the operation is looked up it seems. Can you paste the wsdl to check what the operations defined are?

Also note that you’re creating variables in your code, but not pass it into the startProcessInstanceByKey method

---

<div class="post-metadata">

**Author:** ![musaid](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@musaid](https://forum.flowable.org/u/musaid)\
**Post date:** [February 19, 2018, 4:22am UTC](https://forum.flowable.org/t/global-webservice-weather-deploy-successfully-but-with-startprocessinstancebykey-null-pointer-exception-occur/1636/3 "2018-02-19T04:22:45Z")

</div>

@joram thanks alot for reply please find the wsdl link is [http://www.webservicex.net/globalweather.asmx?WSDL](http://www.webservicex.net/globalweather.asmx?WSDL)  
and BPMN file is available on [https://expirebox.com/download/e9a73860f9bfe2b73c09d43167c14610.html](https://expirebox.com/download/e9a73860f9bfe2b73c09d43167c14610.html)

Related to variables i checked also with variables its not an issue
